/** @module Survey Builder Configuration Panel Presets */ import { CustomConditionFunction } from './config-panel-controls'; /** * A schema describing which preset selection (e.g. choice/answer) behaviors should be applied from the base question type. */ export interface SelectionPresets { /** * Expand the selection control header by default. */ expandByDefault: boolean; standardControls?: { /** * Configures the "Edit Multiple" control */ editMultiple?: CustomConditionFunction | boolean; /** * Configures the "Reusable Choices" control */ reusableChoices?: CustomConditionFunction | boolean; /** * Configures the "Use suggested choices" control */ automaticChoices?: CustomConditionFunction | boolean; }; /** * Custom function which determines whether the selection controls should be disabled. */ disabled?: CustomConditionFunction; /** * Controls the minimum & maximum limits on the selection count control. */ selectionRange?: { min?: number; max?: number; }; } /** * A schema describing which preset choice behaviors should be applied from the base question type */ export interface ChoiceSelectionPresets { /** * A schema describing which preset choice behaviors should be applied from the base question type. * If an object, it will apply the features as configured within the object. * If `false`, it disables any choice configuration behaviors. * If `true`, it uses the base question type's default choice configuration behaviors. * Defaults to `true` */ Choices?: boolean | SelectionPresets; } /** * A schema describing which preset answer behaviors should be applied from the base question type */ export interface AnswerSelectionPresets { /** * A schema describing which preset answer behaviors should be applied from the base question type * If an object, it will apply the features as configured within the object. * If `false`, it disables any answer configuration behaviors. * If `true`, it uses the base question type's default answer configuration behaviors. * Defaults to `true` */ Answers?: boolean | SelectionPresets; } /** * The schema describing all configurable behavior controls. * There are some controls such as 'Display Logic', 'Skip Logic', and "Recode values" that will always be there and are not customizable here. * The rest of these behaviors may be turned off if the property is set to false. Otherwise, it defaults to the default base question behavior. */ export interface StandardBehaviorOptions { /** * Configures the carry forward option for choices in the X direction. * Typically labeled "Carry Forward Choices". */ carryForwardChoices?: boolean; /** * Configures the randomization of the choices in the x direction. * Typically labeled "Choice randomization". */ randomizeChoices?: boolean; /** * Configures the "Default choices" control. */ defaultChoices?: boolean; } /** * A schema describing which preset question behaviors should be applied to the base question type */ export interface QuestionBehaviorPresets { /** * A schema describing which preset question behaviors should be applied to the base question type. * If not provided or is an empty object, these options will default to their base question type's behavior. */ QuestionBehavior?: { /** * Expand the selection control header by default. */ expandByDefault?: boolean; /** * The schema describing all configurable behavior controls. * There are some controls such as 'Display Logic' or 'Skip Logic' that will always be there and are not customizable here. * The rest of these behaviors may be turned off if the property is set to false. Otherwise, it defaults to the default base question behavior. */ standardBehaviors?: StandardBehaviorOptions; }; } /** * A schema describing which preset question behaviors should be applied to the base question type. This applies to questions have an x axis like matrix does - i.e. choices AND answers. */ export interface QuestionsWithXAxisBehaviorPresets { /** * A schema describing which preset question behaviors should be applied to the base question type that has an X axis like matrix does - i.e. choices AND answers. * If not provided or is an empty object, these options will default to their base question type's behavior. */ QuestionBehavior?: { /** * Expand the selection control header by default. */ expandByDefault?: boolean; /** * The schema describing all configurable behavior controls. * There are some controls such as 'Display Logic' or 'Skip Logic' that will always be there and are not customizable here. * The rest of these behaviors may be turned off if the property is set to false. Otherwise, it defaults to the default base question behavior. */ standardBehaviors?: StandardBehaviorOptions & { /** * Configures the carry forward option answers for answers in the x direction. * For Matrix questions, it's called "Carry forward scale points". */ carryForwardAnswers?: boolean; /** * Configures the randomization of answers in the x direction. * For Matrix questions, this is labeled "Scale point randomization". */ randomizeAnswers?: boolean; }; }; } /** * A schema describing which response requirement controls should be applied to the base question type */ export interface ResponseRequirementsPresets { /** * A schema describing which response requirement controls should be applied to the base question type * If set to false, all configurable fields will be turned off. * If set to an object, individual fields can be specified */ ResponseRequirements?: boolean | { /** * Expand the selection control header by default. */ expandByDefault?: boolean; /** * The schema describing all configurable responserequirement controls. * These behaviors may be turned off if the property is set to false. Otherwise, it defaults to the default base question behavior. */ responseRequirementControls?: { /** * Configures the "Add requirements" toggle. When toggled it will show "Force response" or "Request response" options beneath it. * Appears on question types such as multiple choice, matrix, and text entry */ addRequirements?: boolean; /** * Configures the "Add validation" field. */ validation?: boolean; }; }; } /** * A schema describing which preset choice and answer behaviors should be applied from the base question type */ export interface ChoiceAndAnswerSelectionPresets extends ChoiceSelectionPresets, AnswerSelectionPresets { } export interface MultipleChoiceControlPresets extends ChoiceSelectionPresets, QuestionBehaviorPresets, ResponseRequirementsPresets { } export interface TextEntryFormControlPresets extends ChoiceSelectionPresets, QuestionBehaviorPresets, ResponseRequirementsPresets { } export interface MatrixControlPresets extends ChoiceAndAnswerSelectionPresets, QuestionsWithXAxisBehaviorPresets, ResponseRequirementsPresets { } export interface TextEntryControlPresets extends QuestionBehaviorPresets, ResponseRequirementsPresets { } export interface FileUploadControlPresets extends QuestionBehaviorPresets, ResponseRequirementsPresets { } /** * A schema describing which preset behaviors from the base question type to enable / disable. */ export type ConfigPanelPresetsSchema = MultipleChoiceControlPresets | TextEntryFormControlPresets | MatrixControlPresets | TextEntryControlPresets | FileUploadControlPresets; //# sourceMappingURL=config-panel-presets.d.ts.map