useQueryBuilderSchema()
useQueryBuilderSchema<
RG
,F
,O
,C
>(props
,setup
):object
For given QueryBuilderProps and setup values from useQueryBuilderSetup, prepares and returns all values required to render a query builder.
Type Parameters
Type Parameter |
---|
RG extends RuleGroupTypeAny |
F extends FullField <string , string , string , Option <string >, Option <string >> |
O extends FullOperator <string > |
C extends FullCombinator <string > |
Parameters
Parameter | Type |
---|---|
props | QueryBuilderProps <RG , F , O , C > |
setup | object |
setup.combinators | WithUnknownIndex <BaseOption <string > & FullOption <string >>[] | OptionGroup <WithUnknownIndex <BaseOption <string > & FullOption <string >>>[] |
setup.createRule | () => GetRuleTypeFromGroupWithFieldAndOperator <RG , F , O > |
setup.createRuleGroup | (independentCombinators ?) => RG |
setup.fieldMap | FullOptionMap <FullField <string , string , string , Option <string >, Option <string >>, GetOptionIdentifierType <F >> |
setup.fields | FullOptionList <F > |
setup.getInputTypeMain | (field , operator , __namedParameters ) => InputType |
setup.getOperatorsMain | (field , __namedParameters ) => FullOptionList <O > |
setup.getRuleDefaultOperator | (field ) => GetOptionIdentifierType <O > |
setup.getRuleDefaultValue | <RT >(r ) => any |
setup.getValueEditorTypeMain | (field , operator , __namedParameters ) => ValueEditorType |
setup.getValueSourcesMain | (field , operator ) => ValueSources |
setup.getValuesMain | (field , operator , __namedParameters ) => WithUnknownIndex <BaseOption <string > & FullOption <string >>[] | OptionGroup <WithUnknownIndex <BaseOption <string > & FullOption <string >>>[] |
setup.qbId | string |
setup.rqbContext | UseMergedContextReturn <F , GetOptionIdentifierType <O >> |
Returns
object
actions
actions:
QueryActions
combinatorPropObject
combinatorPropObject:
Pick
<RuleGroupProps
<FullOption
<string
>,string
>,"combinator"
>
dndEnabledAttr
dndEnabledAttr:
string
inlineCombinatorsAttr
inlineCombinatorsAttr:
string
queryDisabled
queryDisabled:
boolean
rootGroup
rootGroup:
RuleGroupTypeAny
<GetRuleTypeFromGroupWithFieldAndOperator
<RG
,F
,O
>>
rootGroupDisabled
rootGroupDisabled:
boolean
rqbContext
rqbContext:
object
rqbContext.controlClassnames
rqbContext.controlClassnames:
Partial
<Classnames
> &Classnames
This can be used to assign specific CSS classes to various controls that are rendered by QueryBuilder.
rqbContext.controlElements
rqbContext.controlElements:
Partial
<object
> &Required
<SetNonNullable
<Partial
<object
>,"ruleGroup"
|"rule"
|"shiftActions"
|"actionElement"
|"addGroupAction"
|"addRuleAction"
|"cloneGroupAction"
|"cloneRuleAction"
|"combinatorSelector"
|"dragHandle"
|"fieldSelector"
|"inlineCombinator"
|"lockGroupAction"
|"lockRuleAction"
|"notToggle"
|"operatorSelector"
|"removeGroupAction"
|"removeRuleAction"
|"ruleGroupBodyElements"
|"ruleGroupHeaderElements"
|"valueEditor"
|"valueSelector"
|"valueSourceSelector"
>>
Defines replacement components.
rqbContext.debugMode
rqbContext.debugMode:
boolean
Enables debug logging for QueryBuilder (and React DnD when applicable).
Default
false
rqbContext.enableDragAndDrop
rqbContext.enableDragAndDrop:
boolean
Enables drag-and-drop features.
Default
false
rqbContext.enableMountQueryChange
rqbContext.enableMountQueryChange:
boolean
Set to false
to avoid calling the onQueryChange
callback
when the component mounts.
Default
true
rqbContext.initialQuery
rqbContext.initialQuery:
RuleGroupType
<GetRuleTypeFromGroupWithFieldAndOperator
<RG
,F
,O
>,string
> |RuleGroupTypeIC
<GetRuleTypeFromGroupWithFieldAndOperator
<RG
,F
,O
>,string
>
rqbContext.qbId?
optional
rqbContext.qbId:string
rqbContext.translations
rqbContext.translations:
Partial
<Translations
> &TranslationsFull
This can be used to override translatable texts applied to the various controls that are rendered by QueryBuilder.
schema
schema:
Schema
<F
,GetOptionIdentifierType
<O
>>
translations
translations:
Partial
<Translations
> &TranslationsFull
wrapperClassName
wrapperClassName:
string
Defined in
packages/react-querybuilder/src/hooks/useQueryBuilderSchema.ts:61
API documentation is generated from the latest commit on the main
branch. It may be somewhat inconsistent with official releases of React Query Builder.