/usr/share/grafana/public/app/features/variables/editor
import { ChangeEvent, FormEvent, useCallback } from 'react'; import { VariableWithMultiSupport } from '@grafana/data'; import { SelectionOptionsForm } from 'app/features/dashboard-scene/settings/variables/components/SelectionOptionsForm'; import { KeyedVariableIdentifier } from '../state/types'; import { toKeyedVariableIdentifier } from '../utils'; import { VariableEditorProps } from './types'; export interface SelectionOptionsEditorProps<Model extends VariableWithMultiSupport = VariableWithMultiSupport> extends VariableEditorProps<Model> { onMultiChanged: (identifier: KeyedVariableIdentifier, value: boolean) => void; } export const SelectionOptionsEditor = ({ onMultiChanged: onMultiChangedProps, onPropChange, variable, }: SelectionOptionsEditorProps) => { const onMultiChanged = useCallback( (event: ChangeEvent<HTMLInputElement>) => { onMultiChangedProps(toKeyedVariableIdentifier(variable), event.target.checked); }, [onMultiChangedProps, variable] ); const onIncludeAllChanged = useCallback( (event: ChangeEvent<HTMLInputElement>) => { onPropChange({ propName: 'includeAll', propValue: event.target.checked }); }, [onPropChange] ); const onAllValueChanged = useCallback( (event: FormEvent<HTMLInputElement>) => { onPropChange({ propName: 'allValue', propValue: event.currentTarget.value }); }, [onPropChange] ); return ( <SelectionOptionsForm multi={variable.multi} includeAll={variable.includeAll} allValue={variable.allValue} onMultiChange={onMultiChanged} onIncludeAllChange={onIncludeAllChanged} onAllValueChange={onAllValueChanged} /> ); }; SelectionOptionsEditor.displayName = 'SelectionOptionsEditor';
.
Edit
..
Edit
ConfirmDeleteModal.tsx
Edit
LegacyVariableQueryEditor.tsx
Edit
SelectionOptionsEditor.tsx
Edit
VariableEditorContainer.tsx
Edit
VariableEditorEditor.tsx
Edit
VariableEditorList.tsx
Edit
VariableEditorListRow.tsx
Edit
VariableTypeSelect.tsx
Edit
actions.test.ts
Edit
actions.ts
Edit
getVariableQueryEditor.test.tsx
Edit
getVariableQueryEditor.tsx
Edit
reducer.test.ts
Edit
reducer.ts
Edit
selectors.test.ts
Edit
selectors.ts
Edit
types.ts
Edit