Skip to main content

getValueSourcesUtil()

getValueSourcesUtil<F, O>(fieldData: F, operator: string, getValueSources?: (field: GetOptionIdentifierType<F>, operator: O, misc: { fieldData: F; }) => ValueSources): ValueSources

Defined in: packages/react-querybuilder/src/utils/getValueSourcesUtil.ts:19

Utility function to get the value sources array for the given field and operator. If the field definition does not define a valueSources property, the getValueSources prop is used. Returns ["value"] by default.

Type Parameters

Type Parameter
F extends {[key: string]: unknown; className?: Classname; comparator?: string | (f: {[key: string]: unknown; className?: Classname; comparator?: string | ((f: { [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; id?: string | undefined; operators?: FlexibleOptionList<{ [x: string]: unknown; value?: string | undefined; label: string; disabled?: boolean | undefined; name: string; }> | undefined; ... 9 more ...; cl...; defaultOperator?: string; defaultValue?: any; disabled?: boolean; id?: string; inputType?: null | InputType; label: string; name: string; operators?: FlexibleOptionList<{[key: string]: unknown; disabled?: boolean; label: string; name: string; value?: string; }>; placeholder?: string; validator?: RuleValidator; value: string; valueEditorType?: ValueEditorType | (operator: string) => ValueEditorType; values?: FlexibleOptionList<{[key: string]: unknown; disabled?: boolean; label: string; name: string; value?: string; }>; valueSources?: ValueSources | (operator: string) => ValueSources; }, operator: string) => boolean; defaultOperator?: string; defaultValue?: any; disabled?: boolean; id?: string; inputType?: null | InputType; label: string; name: string; operators?: FlexibleOptionList<{[key: string]: unknown; disabled?: boolean; label: string; name: string; value?: string; }>; placeholder?: string; validator?: RuleValidator; value: string; valueEditorType?: ValueEditorType | (operator: string) => ValueEditorType; values?: FlexibleOptionList<{[key: string]: unknown; disabled?: boolean; label: string; name: string; value?: string; }>; valueSources?: ValueSources | (operator: string) => ValueSources; }
O extends string

Parameters

ParameterType
fieldDataF
operatorstring
getValueSources?(field: GetOptionIdentifierType<F>, operator: O, misc: { fieldData: F; }) => ValueSources

Returns

ValueSources


caution

API documentation is generated from the latest commit on the main branch. It may be somewhat inconsistent with official releases of React Query Builder.