Rule
The Rule
component represents query conditions. Rule
calls the useRule
hook to prepare the subcomponent props.
Subcomponents
Subcomponents are rendered by RuleComponents
by default. If the matchModes
property of a rule's field
evaluates to an array with one or more elements, then RuleComponentsWithSubQuery
is used instead.
RuleComponents
Renders a React.Fragment
containing components in this order:
- Shift actions1
- Drag handle2
- Field selector
- Operator selector3
- Value source selector4 5
- Value editor5
- Clone rule button6
- Lock rule button7
- Remove rule button
RuleComponentsWithSubQuery
Renders a React.Fragment
containing components in this order:
- Shift actions1
- Drag handle2
- Field selector
- Match mode editor
- Rule group header components8
- Clone rule button6
- Lock rule button7
- Remove rule button
- Rule group body components8
Footnotes
-
Only rendered if
showShiftActions
istrue
. ↩ ↩2 -
Only rendered if
enableDragAndDrop
istrue
. ↩ ↩2 -
Only rendered if
autoSelectField
istrue
or the rule'sfield
doesn't matchtranslations.fields.placeholderName
. ↩ -
Only rendered if the rule's
operator
is neither"null"
nor"notNull"
and the derivedvalueSources
array has more than one element. ↩ -
Only rendered when all of these conditions are met:
- The
arity
property of the rule'soperator
is not"unary"
and is not a number less than2
autoSelectOperator
istrue
or the rule'soperator
doesn't matchtranslations.operators.placeholderName
- The
-
Only rendered if
showCloneButtons
istrue
. ↩ ↩2 -
Only rendered if
showLockButtons
istrue
. ↩ ↩2 -
The wrapper element around these components is a
<div>
by default. Customize it with thegroupComponentsWrapper
prop. ↩ ↩2