/** * #field.ts * * Code generated by ts-proto. DO NOT EDIT. * @packageDocumentation */ import type { FormFieldType } from "./type.js"; import type { FormFieldValue } from "./value.js"; /** The base type */ export type FormField = { /** Unique ID within the actor or app */ fieldId: string; /** Field type */ fieldType: FormFieldType; /** Text to display above the input field */ label: string; /** Additional description to help the user */ helpText?: string | undefined; /** Default/initial value */ defaultValue?: FormFieldValue | undefined; /** Whether or not this field is required to submit the form */ required?: boolean | undefined; /** If true, disable the input */ disabled?: boolean | undefined; /** Additional field configuration */ fieldConfig?: FieldConfig | undefined; /** If true, this field is some sort of API key or password */ isSecret?: boolean | undefined; }; /** Per-type configuration options */ export type FieldConfig = { stringConfig?: FieldConfig_String | undefined; paragraphConfig?: FieldConfig_Paragraph | undefined; numberConfig?: FieldConfig_Number | undefined; booleanConfig?: FieldConfig_Boolean | undefined; listConfig?: FieldConfig_List | undefined; selectionConfig?: FieldConfig_Selection | undefined; groupConfig?: FieldConfig_Group | undefined; }; export type FieldConfig_String = { /** Minimum allowed length for the string */ minLength?: number | undefined; /** Maximum allowed length for the string */ maxLength?: number | undefined; /** Placeholder to use when rendering the input field */ placeholder?: string | undefined; }; export type FieldConfig_Paragraph = { /** Maximum allowed characters */ maxCharacters?: number | undefined; /** Height based on the number of lines to display in the text area */ lineHeight?: number | undefined; /** Placeholder to use when rendering the input field */ placeholder?: string | undefined; }; export type FieldConfig_Number = { /** Sets the amount the field can increment/decrement [Default: 1] */ step?: number | undefined; /** Minimum allowed value */ min?: number | undefined; /** Maximum allowed value */ max?: number | undefined; }; export type FieldConfig_Boolean = {}; export type FieldConfig_List = { /** The data type of each item in the list; LIST/SELECTION/GROUP not allowed */ itemType: FormFieldType; /** Additional configuration for items */ itemConfig?: FieldConfig | undefined; /** Minimum number of entries allowed in the list */ minEntries?: number | undefined; /** Maximum number of entries allowed in the list */ maxEntries?: number | undefined; /** Label on the new entry input */ entryLabel?: string | undefined; }; export type FieldConfig_Selection = { /** Ordered list of choices to display in this field */ choices: FieldConfig_Selection_Item[]; /** If true allow multiple selections */ multiSelect?: boolean | undefined; /** If multi_select the minimum number of selections required */ minSelections?: number | undefined; /** If multi_select the maximum number of selections allowed */ maxSelections?: number | undefined; /** Render the selection as a list of radio buttons or checkboxes */ renderAsList?: boolean | undefined; }; export type FieldConfig_Selection_Item = { /** User-facing label */ label: string; /** Value to use when this option is selected */ value: string; }; export type FieldConfig_Group = { /** Fields included in this group */ fields: FormField[]; }; //# sourceMappingURL=field.d.ts.map