ConditionBlock class
đ Descriptionâ
The ConditionBlock
class is an abstract class for creating condition blocks for the builder. A condition block defines a behavior for a Condition
. An instance of a derived ConditionBlock
class is created using the assignBlock
method of a Condition
.
Follow this tutorial to learn how to build a custom condition block.
đ Applicable decoratorsâ
The following decorators can be applied in this class:
Class decorators âšī¸â
Property decorators âšī¸â
Method decorators âšī¸â
đ Staticsâ
đˇī¸ context
â
Contains the context for the block. It can be one of the following values:
*
: The block defines a global condition (it can be used anywhere and it is not dependent on a section, branch, node or block type);section
: The block defines a condition that applies to a section;branch
: The block defines a condition that applies to a branch;node
: The block defines a condition that applies to a node;typeof NodeBlock
: The blocks defines a condition that applies to the specifiedNodeBlock
.
Typeâ
"*" | "section" | "branch" | "node" | typeof NodeBlock
đˇī¸ icon
â
Contains the icon of the block.
Typeâ
SVGImage
| string
đˇī¸ identifier
â
Contains the type identifier of the block.
Typeâ
string
đˇī¸ label
â
Retrieves the localized label (name) of the block.
Typeâ
string
đˇī¸ version
â
Contains the version of the block.
Typeâ
string
đ§ flag
â
Verifies if the block has the specified flag enabled.
Flags can be set using the flag
function.
Signatureâ
flag(id: string): boolean
Parametersâ
Name | Type | Optional | Description |
---|---|---|---|
id | string | No | Specifies the flag identifier to verify. |
Return valueâ
Returns true
if the specified flag was enabled.
đī¸ Fieldsâ
đˇī¸ allowMarkdown
â
Specifies if markdown is supported in the label of the block.
When omitted, basic markdown formatting (bold, italic, underline, strikethrough and hyperlinks) is supported.
Typeâ
boolean
đˇī¸ branch
â
Contains the branch attached to the block.
Typeâ
Branch
| undefined
đˇī¸ condition
â
Retrieves a reference to the Condition
instance that holds the block.
Typeâ
đˇī¸ editor
â
Retrieves the EditorOrchestrator
instance used to define the controls to manage the block.
Typeâ
đˇī¸ icon
â
Retrieves the icon of the condition block.
Typeâ
SVGImage
| string
đˇī¸ id
â
Retrieves the identifier of the condition.
Typeâ
string
đˇī¸ isInitialized
â
Retrieves if the block is initialized.
Typeâ
boolean
đˇī¸ label
â
Retrieves the label of the condition block.
Typeâ
string
đˇī¸ name
â
Retrieves the name of the condition block.
Typeâ
string
đˇī¸ node
â
Contains the node attached to the block.
Typeâ
Node
| undefined
đˇī¸ section
â
Contains the section attached to the block.
Typeâ
Section
| undefined
đˇī¸ slot
â
Contains the slot attached to the block.
Typeâ
Slot
| undefined
đˇī¸ title
â
Retrieves the title of the condition block. This is often the name of the item that is attached to the block.
Typeâ
string | undefined
âļī¸ Methodsâ
đ§ detectChange
â
Notifies the builder that a change has occurred and the definition has changed.
Change detection is normally handled automatically. The builder monitors all block properties that are decorated with the @definition
decorator.
Signatureâ
detectChange(): void
đ§ rerender
â
Rerenders the block.
Signatureâ
rerender(force?: boolean): void
Parametersâ
Name | Type | Optional | Description |
---|---|---|---|
force | boolean | Yes | Specifies to force the rerendering (default is false ). |