Skip to main content

UseMergedContext<F, O, Finalize>

Defined in: packages/react-querybuilder/src/hooks/useMergedContext.ts:44

Props passed down through context from a QueryBuilderContextProvider.

Extends

Type Parameters

Type ParameterDefault type
F extends FullFieldFullField
O extends stringstring
Finalize extends boolean | undefinedundefined

Properties

addRuleToNewGroups?

optional addRuleToNewGroups: boolean

Defined in: packages/core/src/types/queryBuilder.ts:385

Adds a new default rule automatically to each new group.

Default

false

Inherited from

QueryBuilderContextProps.addRuleToNewGroups


autoSelectField?

optional autoSelectField: boolean

Defined in: packages/core/src/types/queryBuilder.ts:367

Select the first field in the array automatically.

Default

true

Inherited from

QueryBuilderContextProps.autoSelectField


autoSelectOperator?

optional autoSelectOperator: boolean

Defined in: packages/core/src/types/queryBuilder.ts:373

Select the first operator in the array automatically.

Default

true

Inherited from

QueryBuilderContextProps.autoSelectOperator


autoSelectValue?

optional autoSelectValue: boolean

Defined in: packages/core/src/types/queryBuilder.ts:379

Select the first value in the array automatically. Only applicable when the value editor renders a select list.

Default

false

Inherited from

QueryBuilderContextProps.autoSelectValue


controlClassnames

controlClassnames: Classnames

Defined in: packages/react-querybuilder/src/hooks/useMergedContext.ts:54

This can be used to assign specific CSS classes to various controls that are rendered by QueryBuilder.

Overrides

QueryBuilderContextProps.controlClassnames


controlElements

controlElements: Finalize extends true ? Required<SetNonNullable<Partial<{ actionElement: ComponentType<ActionProps>; addGroupAction: ComponentType<ActionProps> | null; addRuleAction: ComponentType<ActionProps> | null; cloneGroupAction: ComponentType<ActionProps> | null; cloneRuleAction: ComponentType<ActionProps> | null; combinatorSelector: ComponentType<CombinatorSelectorProps> | null; dragHandle: ForwardRefExoticComponent<DragHandleProps & RefAttributes<HTMLElement>> | null; fieldSelector: ComponentType<FieldSelectorProps<F>> | null; inlineCombinator: ComponentType<InlineCombinatorProps> | null; lockGroupAction: ComponentType<ActionProps> | null; lockRuleAction: ComponentType<ActionProps> | null; matchModeEditor: ComponentType<MatchModeEditorProps> | null; muteGroupAction: ComponentType<ActionProps> | null; muteRuleAction: ComponentType<ActionProps> | null; notToggle: ComponentType<NotToggleProps> | null; operatorSelector: ComponentType<OperatorSelectorProps> | null; removeGroupAction: ComponentType<ActionProps> | null; removeRuleAction: ComponentType<ActionProps> | null; rule: ComponentType<RuleProps<string, string>>; ruleGroup: ComponentType<RuleGroupProps<F, O>>; ruleGroupBodyElements: ComponentType<RuleGroupProps<{[key: string]: unknown; disabled?: boolean; label: string; name: string; value: string; }, string> & UseRuleGroup>; ruleGroupHeaderElements: ComponentType<RuleGroupProps<{[key: string]: unknown; disabled?: boolean; label: string; name: string; value: string; }, string> & UseRuleGroup>; shiftActions: ComponentType<ShiftActionsProps> | null; valueEditor: ComponentType<ValueEditorProps<F, O>> | null; valueSelector: ComponentType<ValueSelectorProps<{[key: string]: unknown; disabled?: boolean; label: string; name: string; value: string; }>>; valueSourceSelector: ComponentType<ValueSourceSelectorProps> | null; }>, "rule" | "ruleGroup" | "inlineCombinator" | "notToggle" | "dragHandle" | "valueSourceSelector" | "shiftActions" | "actionElement" | "valueSelector" | "addGroupAction" | "addRuleAction" | "cloneGroupAction" | "cloneRuleAction" | "combinatorSelector" | "fieldSelector" | "lockGroupAction" | "lockRuleAction" | "muteGroupAction" | "muteRuleAction" | "matchModeEditor" | "operatorSelector" | "removeGroupAction" | "removeRuleAction" | "ruleGroupBodyElements" | "ruleGroupHeaderElements" | "valueEditor">> : Partial<Required<SetNonNullable<Partial<{ actionElement: ComponentType<ActionProps>; addGroupAction: ComponentType<ActionProps> | null; addRuleAction: ComponentType<ActionProps> | null; cloneGroupAction: ComponentType<ActionProps> | null; cloneRuleAction: ComponentType<ActionProps> | null; combinatorSelector: ComponentType<CombinatorSelectorProps> | null; dragHandle: ForwardRefExoticComponent<DragHandleProps & RefAttributes<HTMLElement>> | null; fieldSelector: ComponentType<FieldSelectorProps<F>> | null; inlineCombinator: ComponentType<InlineCombinatorProps> | null; lockGroupAction: ComponentType<ActionProps> | null; lockRuleAction: ComponentType<ActionProps> | null; matchModeEditor: ComponentType<MatchModeEditorProps> | null; muteGroupAction: ComponentType<ActionProps> | null; muteRuleAction: ComponentType<ActionProps> | null; notToggle: ComponentType<NotToggleProps> | null; operatorSelector: ComponentType<OperatorSelectorProps> | null; removeGroupAction: ComponentType<ActionProps> | null; removeRuleAction: ComponentType<ActionProps> | null; rule: ComponentType<RuleProps<string, string>>; ruleGroup: ComponentType<RuleGroupProps<F, O>>; ruleGroupBodyElements: ComponentType<RuleGroupProps<{[key: string]: unknown; disabled?: ... | ... | ...; label: string; name: string; value: string; }, string> & UseRuleGroup>; ruleGroupHeaderElements: ComponentType<RuleGroupProps<{[key: string]: unknown; disabled?: ... | ... | ...; label: string; name: string; value: string; }, string> & UseRuleGroup>; shiftActions: ComponentType<ShiftActionsProps> | null; valueEditor: ComponentType<ValueEditorProps<F, O>> | null; valueSelector: ComponentType<ValueSelectorProps<{[key: string]: unknown; disabled?: boolean; label: string; name: string; value: string; }>>; valueSourceSelector: ComponentType<ValueSourceSelectorProps> | null; }>, "rule" | "ruleGroup" | "inlineCombinator" | "notToggle" | "dragHandle" | "valueSourceSelector" | "shiftActions" | "actionElement" | "valueSelector" | "addGroupAction" | "addRuleAction" | "cloneGroupAction" | "cloneRuleAction" | "combinatorSelector" | "fieldSelector" | "lockGroupAction" | "lockRuleAction" | "muteGroupAction" | "muteRuleAction" | "matchModeEditor" | "operatorSelector" | "removeGroupAction" | "removeRuleAction" | "ruleGroupBodyElements" | "ruleGroupHeaderElements" | "valueEditor">>>

Defined in: packages/react-querybuilder/src/hooks/useMergedContext.ts:53

Defines replacement components.

Overrides

QueryBuilderContextProps.controlElements


debugMode?

optional debugMode: boolean

Defined in: packages/core/src/types/queryBuilder.ts:312

Enables debug logging for query builders (and React DnD when applicable).

Default

false

Inherited from

QueryBuilderContextProps.debugMode


enableDragAndDrop

enableDragAndDrop: Finalize extends true ? boolean : boolean | undefined

Defined in: packages/react-querybuilder/src/hooks/useMergedContext.ts:50

Enables drag-and-drop features.

Default

false

Overrides

QueryBuilderContextProps.enableDragAndDrop


enableMountQueryChange?

optional enableMountQueryChange: boolean

Defined in: packages/core/src/types/queryBuilder.ts:300

Set to false to avoid calling the onQueryChange callback when the component mounts.

Default

true

Inherited from

QueryBuilderContextProps.enableMountQueryChange


initialQuery?

optional initialQuery: RuleGroupTypeAny

Defined in: packages/react-querybuilder/src/hooks/useMergedContext.ts:51


listsAsArrays?

optional listsAsArrays: boolean

Defined in: packages/core/src/types/queryBuilder.ts:391

Store list-type values as native arrays instead of comma-separated strings.

Default

false

Inherited from

QueryBuilderContextProps.listsAsArrays


qbId?

optional qbId: string

Defined in: packages/react-querybuilder/src/hooks/useMergedContext.ts:52


resetOnFieldChange?

optional resetOnFieldChange: boolean

Defined in: packages/core/src/types/queryBuilder.ts:355

Reset the operator and value when the field changes.

Default

true

Inherited from

QueryBuilderContextProps.resetOnFieldChange


resetOnOperatorChange?

optional resetOnOperatorChange: boolean

Defined in: packages/core/src/types/queryBuilder.ts:361

Reset the value when the operator changes.

Default

false

Inherited from

QueryBuilderContextProps.resetOnOperatorChange


showCloneButtons?

optional showCloneButtons: boolean

Defined in: packages/core/src/types/queryBuilder.ts:337

Show the "Clone rule" and "Clone group" buttons.

Default

false

Inherited from

QueryBuilderContextProps.showCloneButtons


showCombinatorsBetweenRules?

optional showCombinatorsBetweenRules: boolean

Defined in: packages/core/src/types/queryBuilder.ts:319

Show group combinator selectors in the body of the group, between each child rule/group, instead of in the group header.

Default

false

Inherited from

QueryBuilderContextProps.showCombinatorsBetweenRules


showLockButtons?

optional showLockButtons: boolean

Defined in: packages/core/src/types/queryBuilder.ts:343

Show the "Lock rule" and "Lock group" buttons.

Default

false

Inherited from

QueryBuilderContextProps.showLockButtons


showMuteButtons?

optional showMuteButtons: boolean

Defined in: packages/core/src/types/queryBuilder.ts:349

Show the "Mute rule" and "Mute group" buttons.

Default

false

Inherited from

QueryBuilderContextProps.showMuteButtons


showNotToggle?

optional showNotToggle: boolean

Defined in: packages/core/src/types/queryBuilder.ts:325

Show the "not" (aka inversion) toggle for rule groups.

Default

false

Inherited from

QueryBuilderContextProps.showNotToggle


showShiftActions?

optional showShiftActions: boolean

Defined in: packages/core/src/types/queryBuilder.ts:331

Show the "Shift up"/"Shift down" actions.

Default

false

Inherited from

QueryBuilderContextProps.showShiftActions


suppressStandardClassnames?

optional suppressStandardClassnames: boolean

Defined in: packages/core/src/types/queryBuilder.ts:398

Prevent any assignment of standard classes to elements. This includes conditional and event-based classes for validation, drag-and-drop, etc.

Default

false

Inherited from

QueryBuilderContextProps.suppressStandardClassnames


translations

translations: Finalize extends true ? TranslationsFull : Partial<Translations>

Defined in: packages/react-querybuilder/src/hooks/useMergedContext.ts:55

This can be used to override translatable texts applied to the various controls that are rendered by QueryBuilder.

Overrides

QueryBuilderContextProps.translations


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.