Open Forms TS types
    Preparing search index...

    Interface SelectboxesComponentSchema

    Component shape/options for the selectboxes component.

    Selectboxes allow users to check one or more checkboxes for predefined options. It's the multi-option variant of the radio component.

    The submission data value type is a mapping of the option value to a boolean that indicates if the option is checked or not.

    interface SelectboxesComponentSchema {
        clearOnHide?: boolean;
        conditional?: {
            eq?: string | number | boolean;
            show?: boolean;
            when?: string;
        };
        defaultValue?: Record<string, boolean>;
        description?: string;
        errors?: {
            maxSelectedCount?: string;
            minSelectedCount?: string;
            required?: string;
        };
        hidden?: boolean;
        id: string;
        isSensitiveData?: boolean;
        key: string;
        label: string;
        openForms: | {
            dataSrc: "manual";
            translations?: {
                en?: { description?: string; label?: string; tooltip?: string };
                nl?: { description?: string; label?: string; tooltip?: string };
            };
        }
        | {
            dataSrc: "variable";
            itemsExpression: JsonLogicExpression;
            translations?: {
                en?: { description?: string; label?: string; tooltip?: string };
                nl?: { description?: string; label?: string; tooltip?: string };
            };
        }
        | {
            code: string;
            dataSrc: "referenceLists";
            service: string;
            translations?: {
                en?: { description?: string; label?: string; tooltip?: string };
                nl?: { description?: string; label?: string; tooltip?: string };
            };
        };
        registration?: { attribute: string };
        showInEmail?: boolean;
        showInPDF?: boolean;
        showInSummary?: boolean;
        tooltip?: string;
        translatedErrors?: {
            en?: {
                maxSelectedCount?: string;
                minSelectedCount?: string;
                required?: string;
            };
            nl?: {
                maxSelectedCount?: string;
                minSelectedCount?: string;
                required?: string;
            };
        };
        type: "selectboxes";
        validate?: {
            maxSelectedCount?: number;
            minSelectedCount?: number;
            plugins?: string[];
            required?: boolean;
        };
        values: Option[];
    }
    Index

    Properties

    clearOnHide?: boolean

    Clear the value (remove the key from the submission data) when the field is hidden. This is applied if the component itself or any parent is hidden, irrespective the mechanism that made it hidden.

    Related: hidden, conditional.

    conditional?: { eq?: string | number | boolean; show?: boolean; when?: string }

    Type declaration

    • Optionaleq?: string | number | boolean

      The value that should be checked against the reference component value.

      For array values (of the reference component), the array is checked if it contains the specified value.

      Only (a subset of) primitives are supported.

    • Optionalshow?: boolean

      Whether the field should be shown (true) or hidden (false) when the condition is met.

    • Optionalwhen?: string

      The reference component key. Its value will be retrieved and tested against eq.

    defaultValue?: Record<string, boolean>

    The default/initial value to populate the field with if no value is set yet.

    The typevar T determines the (intrinsic) value type of the component. If the component supports the multiple property, use the WithMultiple type instead.

    description?: string

    Additional information for the form field, displayed unconditionally.

    errors?: {
        maxSelectedCount?: string;
        minSelectedCount?: string;
        required?: string;
    }

    Resolved custom error messages, for the active locale. Set by the backend from translatedErrors - should never be written to.

    hidden?: boolean

    Hide or show the form field. This only controls the visibility - whether submission data is retained or not is controlled through clearOnHide.

    id: string

    Unique ID for a component in a form definition. Used to render HTML IDs.

    The new renderer does not need this.

    isSensitiveData?: boolean

    Marker for a form field that requests potentially (privacy) sensitive information.

    Pruning of submission data will clear the data of components marked as sensitive data.

    This is specific to Open Forms.

    key: string

    Unique key for the component in a larger form definition.

    The value must comply with the (\w|\w[\w.\-]*\w) regex, meaning that periods/dots are allowed unless they're start or end. The period character creates a nesting level in the submission data.

    'myField'
    
    'parent.child' // creates `{parent: {child: <value}}` data.
    
    label: string

    The form field label text.

    openForms:
        | {
            dataSrc: "manual";
            translations?: {
                en?: { description?: string; label?: string; tooltip?: string };
                nl?: { description?: string; label?: string; tooltip?: string };
            };
        }
        | {
            dataSrc: "variable";
            itemsExpression: JsonLogicExpression;
            translations?: {
                en?: { description?: string; label?: string; tooltip?: string };
                nl?: { description?: string; label?: string; tooltip?: string };
            };
        }
        | {
            code: string;
            dataSrc: "referenceLists";
            service: string;
            translations?: {
                en?: { description?: string; label?: string; tooltip?: string };
                nl?: { description?: string; label?: string; tooltip?: string };
            };
        }

    Type declaration

    • {
          dataSrc: "manual";
          translations?: {
              en?: { description?: string; label?: string; tooltip?: string };
              nl?: { description?: string; label?: string; tooltip?: string };
          };
      }
    • {
          dataSrc: "variable";
          itemsExpression: JsonLogicExpression;
          translations?: {
              en?: { description?: string; label?: string; tooltip?: string };
              nl?: { description?: string; label?: string; tooltip?: string };
          };
      }
      • dataSrc: "variable"
      • itemsExpression: JsonLogicExpression

        JsonLogic expression to extract the available options. The result must be an array of [value, label] tuples.

      • Optionaltranslations?: {
            en?: { description?: string; label?: string; tooltip?: string };
            nl?: { description?: string; label?: string; tooltip?: string };
        }
    • {
          code: string;
          dataSrc: "referenceLists";
          service: string;
          translations?: {
              en?: { description?: string; label?: string; tooltip?: string };
              nl?: { description?: string; label?: string; tooltip?: string };
          };
      }
      • code: string

        Identifying code for a table in the reference lists API. The items present in this table will be returned as options.

      • dataSrc: "referenceLists"
      • service: string

        Identifier to resolve the service pointing to the reference lists API.

      • Optionaltranslations?: {
            en?: { description?: string; label?: string; tooltip?: string };
            nl?: { description?: string; label?: string; tooltip?: string };
        }
    registration?: { attribute: string }

    Configuration on how to process the value of the component in the registration plugin(s).

    Component-level registration configuration does not work reliably when multiple registration plugins are enabled on the form. This will be moved in the new admin UI.

    showInEmail?: boolean

    Include the component and its value in the confirmation email data.

    showInPDF?: boolean

    Include the component and its value in the submission report PDF available for download by the end-user and often included in registration plugins.

    showInSummary?: boolean

    Include the component and its value in the submission data summary on the confirmation page or not.

    tooltip?: string

    Extra information or background for the form field. Displayed after interacting with the tooltip icon/control near the label.

    translatedErrors?: {
        en?: {
            maxSelectedCount?: string;
            minSelectedCount?: string;
            required?: string;
        };
        nl?: {
            maxSelectedCount?: string;
            minSelectedCount?: string;
            required?: string;
        };
    }

    Custom, user-supplied validation error messages for each error message type supported by the validators used in the validation configuration.

    Specified for each supported language - the backend reads this configuration and writes it to errors.

    type: "selectboxes"

    Discriminator to determine the component type. Uniquely determines the shape of the component configuration options.

    validate?: {
        maxSelectedCount?: number;
        minSelectedCount?: number;
        plugins?: string[];
        required?: boolean;
    }

    The validation configuration of the component.

    Type declaration

    • OptionalmaxSelectedCount?: number

      The maximum number of options that may be selected for fields that support multi-option selection, like select and selectboxes.

    • OptionalminSelectedCount?: number

      The minimum number of options that must be selected for fields that support multi-option selection, like select and selectboxes.

    • Optionalplugins?: string[]

      List of plugin identifiers for async backend validation. The value is considered valid as soon as one plugin considers the value valid.

      This is an Open Forms-specific feature.

    • Optionalrequired?: boolean

      Set to true to require a non-empty value to be provided for the field.

    values: Option[]

    The available options that the user can choose from. Either configured manually on the component itself, or programmatically by the backend after resolving the configured data source set in openForms.dataSrc.