import type Input from "./Input.js"; import type Choice from "./multipleChoice/Choice.js"; import type OtherChoice from "./multipleChoice/OtherChoice.js"; import type { ChoiceProperties } from "./multipleChoice/Choice.js"; import type { OtherChoiceProperties } from "./multipleChoice/OtherChoice.js"; export interface MultipleChoiceInputProperties extends Partial> { /** An array of available choices. */ choices?: ChoiceProperties[]; /** The configuration for the `other` choice. */ otherChoice?: OtherChoiceProperties | null; } /** * The `MultipleChoiceInput` class defines the desired user interface for a multiple choice group input. This [FieldElement.input](https://developers.arcgis.com/javascript/latest/references/core/form/elements/FieldElement/#input) is used in [field elements](https://developers.arcgis.com/javascript/latest/references/core/form/elements/FieldElement/) that are set within a [feature layer's](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#formTemplate) or [FeatureForm's](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureForm/#formTemplate) `formTemplate`. This is displayed within the [Editor](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/) widget. * * @since 5.1 * @see [FieldElement](https://developers.arcgis.com/javascript/latest/references/core/form/elements/FieldElement/) * @example * // Creates a new multiple choice input for a field element within a form * const multipleChoiceInput = new MultipleChoiceInput({ * includeSelectAllChoices: true, * otherChoice: { * fieldName: "other", * label: "Other", * hint: "Provide additional details" * }, * minimumChoices: 1, * maximumChoices: 3, * choices: [ * { label: "Option 1", value: "option1" }, * { label: "Option 2", value: "option2" }, * { label: "Option 3", value: "option3" } * ] * }); */ export default class MultipleChoiceInput extends Input { constructor(properties?: MultipleChoiceInputProperties); /** * Defines the delimiter used to separate multiple selected choice values. * * @default "," */ accessor choiceDelimiter: string; /** An array of available choices. */ get choices(): Choice[]; set choices(value: ChoiceProperties[]); /** Indicates whether a `select all` choice should be displayed. */ accessor includeSelectAllChoices: boolean | null | undefined; /** The maximum number of choices allowed. */ accessor maximumChoices: number | null | undefined; /** The minimum number of choices required. */ accessor minimumChoices: number | null | undefined; /** The configuration for the `other` choice. */ get otherChoice(): OtherChoice | null | undefined; set otherChoice(value: OtherChoiceProperties | null | undefined); /** The type of form element input. */ get type(): "multiple-choice"; /** * Creates a deep clone of the `MultipleChoiceInput` class. * * @returns A deep clone of the `MultipleChoiceInput` instance. */ clone(): MultipleChoiceInput; }