import { FormEvent } from 'react'; import { SelectableValue } from '@grafana/data'; import { selectors } from '@grafana/e2e-selectors'; import { SelectionOptionsForm } from './SelectionOptionsForm'; import { VariableLegend } from './VariableLegend'; import { VariableSelectField } from './VariableSelectField'; import { VariableTextField } from './VariableTextField'; interface DataSourceVariableFormProps { query: string; regex: string; multi: boolean; allValue?: string | null; allowCustomValue?: boolean; includeAll: boolean; onChange: (option: SelectableValue) => void; optionTypes: Array<{ value: string; label: string }>; onRegExBlur: (event: FormEvent) => void; onMultiChange: (event: FormEvent) => void; onIncludeAllChange: (event: FormEvent) => void; onAllValueChange: (event: FormEvent) => void; onAllowCustomValueChange?: (event: FormEvent) => void; onQueryBlur?: (event: FormEvent) => void; onAllValueBlur?: (event: FormEvent) => void; } export function DataSourceVariableForm({ query, regex, optionTypes, allowCustomValue, onChange, onRegExBlur, multi, includeAll, allValue, onMultiChange, onIncludeAllChange, onAllValueChange, onAllowCustomValueChange, }: DataSourceVariableFormProps) { const typeValue = optionTypes.find((o) => o.value === query) ?? optionTypes[0]; return ( <> Data source options Regex filter for which data source instances to choose from in the variable value list. Leave empty for all.

Example: /^prod/ } /> Selection options ); }