Interface QuestionConfigs<Custom>

interface QuestionConfigs<Custom> {
    choices?: ChoiceConfigs<Custom>[];
    custom?: Custom;
    defaultAnswer?: any;
    defaultDisabled?: boolean;
    disabledOnSelected?: ItemAbledOnSelected;
    enabledOnSelected?: ItemAbledOnSelected;
    id?: string;
    type: QuestionType;
    validators?: string[];
}

Type Parameters

  • Custom = any

Hierarchy

  • ItemConfigs<Custom>
    • QuestionConfigs

Properties

choices?: ChoiceConfigs<Custom>[]

Choices for questions with choice or choices as [[type]].

custom?: Custom

Any values that help you determine on how to render the frontend UI or how to perform validation.

defaultAnswer?: any

Default answer.

Questions with any as [[type]] accept any as answer.

Questions with choice as [[type]] accept any as answer.

Questions with choices as [[type]] accept any[] as answer.

defaultDisabled?: boolean

Whether or not this item is disabled by default.

disabledOnSelected?: ItemAbledOnSelected

A list of choice id.

This item will be disabled if the requirement is fulfilled.

enabledOnSelected?: ItemAbledOnSelected

A list of choice id.

This item will be enabled if the requirement is fulfilled.

id?: string

Item id.

It should be unique throughout the entire form.

It will be auto generated if you leave it falsy.

Question type.

Questions with any as [[type]] accept any as answer. You shouldn't have to specify [[choices]] for this question.

Questions with choice as [[type]] accept any as answer. You should specify [[choices]] for this question. Usually radio button group or dropdown select will be used for this type of questions.

Questions with choices as [[type]] accept any[] as answer. You should specify [[choices]] for this question. Usually checkbox group or select with multiple mode turned on will be used for this type of questions.

validators?: string[]

Names of the validators to be used for validation when answer of this question is changed.

Validators will be executed in sequence of their positions in the list.