Skip to main content

Conditions class

📖 Description

The Conditions class represents a collection of conditions in a form definition. Each condition in the collection is a Condition instance.

🗃️ Fields


🏷️ all

Retrieves all the conditions that are in the collection.

Type

Condition[]


🏷️ branch

Retrieves the parent branch.

Type

Branch


🏷️ count

Retrieves the number of conditions in the collection.

Type

number


🏷️ firstItem

Retrieves the first condition in the collection.

Type

Condition | undefined


🏷️ lastItem

Retrieves the last condition in the collection.

Type

Condition | undefined

▶️ Methods


🔧 each

Iterates through all conditions in the collection.

Signature

each(fn: (condition: Condition) => boolean | void): boolean

Parameters

NameTypeOptionalDescription
fn(condition: Condition) => boolean | voidNoFunction that is called for each condition in the collection. If you want to stop the iteration, you can return true from this function to do so.

Return value

Returns true if the iteration was stopped (break).


🔧 reverseEach

Iterates through all conditions in the collection in reverse direction (starting with the last condition).

Signature

reverseEach(fn: (condition: Condition) => boolean | void): boolean

Parameters

NameTypeOptionalDescription
fn(condition: Condition) => boolean | voidNoFunction that is called for each condition in the collection. If you want to stop the iteration, you can return true from this function to do so.

Return value

Returns true if the iteration was stopped (break).