Skip to main content

RulesEngineProps

Defined in: rules-engine/src/types/props.ts:184

Props for RulesEngineBuilder.

Properties

addConsequentToNewConditions?

optional addConsequentToNewConditions?: boolean

Defined in: rules-engine/src/types/props.ts:224

When true, newly added conditions are seeded with a consequent using the default consequent type for that condition.


allowDefaultConsequents?

optional allowDefaultConsequents?: boolean

Defined in: rules-engine/src/types/props.ts:217


allowNestedConditions?

optional allowNestedConditions?: boolean

Defined in: rules-engine/src/types/props.ts:218


autoSelectConsequentType?

optional autoSelectConsequentType?: boolean

Defined in: rules-engine/src/types/props.ts:215


classnames?

optional classnames?: Partial<ClassnamesRE>

Defined in: rules-engine/src/types/props.ts:228


components?

optional components?: Partial<ComponentsRE>

Defined in: rules-engine/src/types/props.ts:227


consequentTypes?

optional consequentTypes?: FlexibleOptionList<{[key: string]: unknown; disabled?: boolean; label: string; name: string; properties?: ConsequentPropertyDef[]; value?: string; }>

Defined in: rules-engine/src/types/props.ts:188


defaultRulesEngine?

optional defaultRulesEngine?: RulesEngine<RuleType<string, string, any, string, Record<string, any>>, string>

Defined in: rules-engine/src/types/props.ts:186


enableMountRulesEngineChange?

optional enableMountRulesEngineChange?: boolean

Defined in: rules-engine/src/types/props.ts:225


getConsequentTypes?

optional getConsequentTypes?: (conditionPath: Path, antecedent: RuleGroupTypeAny, context?: unknown) => FlexibleOptionListProp<{[key: string]: unknown; disabled?: boolean; label: string; name: string; properties?: ConsequentPropertyDef[]; value?: string; }> | null

Defined in: rules-engine/src/types/props.ts:189

Parameters

ParameterType
conditionPathPath
antecedentRuleGroupTypeAny
context?unknown

Returns

FlexibleOptionListProp<{[key: string]: unknown; disabled?: boolean; label: string; name: string; properties?: ConsequentPropertyDef[]; value?: string; }> | null


idGenerator?

optional idGenerator?: () => string

Defined in: rules-engine/src/types/props.ts:239

id generator function. Should always produce a unique/random string.

Returns

string

Default

crypto.randomUUID

onAddCondition?

optional onAddCondition?: (condition: REConditionAny, parentConditionPath: Path, rulesEngine: RulesEngineAny) => boolean | REConditionAny

Defined in: rules-engine/src/types/props.ts:194

Parameters

ParameterType
conditionREConditionAny
parentConditionPathPath
rulesEngineRulesEngineAny

Returns

boolean | REConditionAny


onMoveCondition?

optional onMoveCondition?: (condition: REConditionAny, fromPath: Path, direction: "up" | "down", rulesEngine: RulesEngineAny, nextRulesEngine: RulesEngineAny) => boolean | RulesEngineAny

Defined in: rules-engine/src/types/props.ts:208

This callback is invoked before a condition is shifted up or down. Return true to allow the shift, false to cancel it, or a new rules engine object which will become the new state.

Parameters

ParameterType
conditionREConditionAny
fromPathPath
direction"up" | "down"
rulesEngineRulesEngineAny
nextRulesEngineRulesEngineAny

Returns

boolean | RulesEngineAny


onRemoveCondition?

optional onRemoveCondition?: (condition: REConditionAny, conditionPath: Path, rulesEngine: RulesEngineAny) => boolean | REConditionAny

Defined in: rules-engine/src/types/props.ts:199

Parameters

ParameterType
conditionREConditionAny
conditionPathPath
rulesEngineRulesEngineAny

Returns

boolean | REConditionAny


onRulesEngineChange?

optional onRulesEngineChange?: (re: RulesEngine) => void

Defined in: rules-engine/src/types/props.ts:187

Parameters

ParameterType
reRulesEngine

Returns

void


queryBuilderProps?

optional queryBuilderProps?: Except<QueryBuilderProps<RuleGroupTypeAny, {[key: string]: unknown; disabled?: boolean; label: string; name: string; value: string; }, {[key: string]: unknown; disabled?: boolean; label: string; name: string; value: string; }, {[key: string]: unknown; disabled?: boolean; label: string; name: string; value: string; }>, "query" | "onQueryChange">

Defined in: rules-engine/src/types/props.ts:230


rulesEngine?

optional rulesEngine?: RulesEngine<RuleType<string, string, any, string, Record<string, any>>, string>

Defined in: rules-engine/src/types/props.ts:185


showBranches?

optional showBranches?: boolean

Defined in: rules-engine/src/types/props.ts:226


showShiftActions?

optional showShiftActions?: boolean

Defined in: rules-engine/src/types/props.ts:219


suppressStandardClassnames?

optional suppressStandardClassnames?: boolean

Defined in: rules-engine/src/types/props.ts:216


translations?

optional translations?: Partial<TranslationsRE>

Defined in: rules-engine/src/types/props.ts:229


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.