Skip to content

@morph-mapper/source


@morph-mapper/source / useRules

Function: useRules()

useRules(variant): object

Defined in: hooks/use-rules.ts:9

This hook provides an external interface to the rules of a logic block. It is used to conditionally render UI elements based on the rules of a logic block.

Parameters

variant

SchemaVariant

Returns

object

hasMultipleChildren

hasMultipleChildren: (type) => boolean

Parameters

type

"split" | "substring" | "anchor" | "terminal" | "context" | "literal" | "docVariables" | "anchorVariable" | "concatenate" | "dateTime" | "removeWords" | "removeSpecialCharacters" | "removeLeadingAndTrailingSpaces" | "replaceSymbols" | "parseToNumber" | "parseToFloat" | "parseToFloatReversed" | "logicOr" | "logicAnd" | "logicEqual" | "logicNot" | "logicRegExpTest" | "logicIfElse" | "switchCase" | "mathPlus" | "mathSubtract" | "mathMultiply" | "mathRound" | "mathCeil" | "mathFloor" | "mathDivide" | "mathMaximal" | "mathLessThan" | "mathLessThanOrEqual" | "mathGreaterThan" | "mathGreaterThanOrEqual" | "genericRequest" | "vesselRequest" | "composeTableColumns" | "defineTableCell" | "iterateRowByColumn" | "countOccurences" | "iterableTable" | "getFromArray" | "sumFromArray" | "containerIterator" | "caseDefinition"

Returns

boolean

hasMultipleElements

hasMultipleElements: (type) => boolean

Parameters

type

"split" | "substring" | "anchor" | "terminal" | "context" | "literal" | "docVariables" | "anchorVariable" | "concatenate" | "dateTime" | "removeWords" | "removeSpecialCharacters" | "removeLeadingAndTrailingSpaces" | "replaceSymbols" | "parseToNumber" | "parseToFloat" | "parseToFloatReversed" | "logicOr" | "logicAnd" | "logicEqual" | "logicNot" | "logicRegExpTest" | "logicIfElse" | "switchCase" | "mathPlus" | "mathSubtract" | "mathMultiply" | "mathRound" | "mathCeil" | "mathFloor" | "mathDivide" | "mathMaximal" | "mathLessThan" | "mathLessThanOrEqual" | "mathGreaterThan" | "mathGreaterThanOrEqual" | "genericRequest" | "vesselRequest" | "composeTableColumns" | "defineTableCell" | "iterateRowByColumn" | "countOccurences" | "iterableTable" | "getFromArray" | "sumFromArray" | "containerIterator" | "caseDefinition"

Returns

boolean

hasNoChildren

hasNoChildren: (type) => boolean

Parameters

type

"split" | "substring" | "anchor" | "terminal" | "context" | "literal" | "docVariables" | "anchorVariable" | "concatenate" | "dateTime" | "removeWords" | "removeSpecialCharacters" | "removeLeadingAndTrailingSpaces" | "replaceSymbols" | "parseToNumber" | "parseToFloat" | "parseToFloatReversed" | "logicOr" | "logicAnd" | "logicEqual" | "logicNot" | "logicRegExpTest" | "logicIfElse" | "switchCase" | "mathPlus" | "mathSubtract" | "mathMultiply" | "mathRound" | "mathCeil" | "mathFloor" | "mathDivide" | "mathMaximal" | "mathLessThan" | "mathLessThanOrEqual" | "mathGreaterThan" | "mathGreaterThanOrEqual" | "genericRequest" | "vesselRequest" | "composeTableColumns" | "defineTableCell" | "iterateRowByColumn" | "countOccurences" | "iterableTable" | "getFromArray" | "sumFromArray" | "containerIterator" | "caseDefinition"

Returns

boolean

hasSingleChild

hasSingleChild: (type) => boolean

Parameters

type

"split" | "substring" | "anchor" | "terminal" | "context" | "literal" | "docVariables" | "anchorVariable" | "concatenate" | "dateTime" | "removeWords" | "removeSpecialCharacters" | "removeLeadingAndTrailingSpaces" | "replaceSymbols" | "parseToNumber" | "parseToFloat" | "parseToFloatReversed" | "logicOr" | "logicAnd" | "logicEqual" | "logicNot" | "logicRegExpTest" | "logicIfElse" | "switchCase" | "mathPlus" | "mathSubtract" | "mathMultiply" | "mathRound" | "mathCeil" | "mathFloor" | "mathDivide" | "mathMaximal" | "mathLessThan" | "mathLessThanOrEqual" | "mathGreaterThan" | "mathGreaterThanOrEqual" | "genericRequest" | "vesselRequest" | "composeTableColumns" | "defineTableCell" | "iterateRowByColumn" | "countOccurences" | "iterableTable" | "getFromArray" | "sumFromArray" | "containerIterator" | "caseDefinition"

Returns

boolean

isConfigurable

isConfigurable: (type) => boolean

Parameters

type

"split" | "substring" | "anchor" | "terminal" | "context" | "literal" | "docVariables" | "anchorVariable" | "concatenate" | "dateTime" | "removeWords" | "removeSpecialCharacters" | "removeLeadingAndTrailingSpaces" | "replaceSymbols" | "parseToNumber" | "parseToFloat" | "parseToFloatReversed" | "logicOr" | "logicAnd" | "logicEqual" | "logicNot" | "logicRegExpTest" | "logicIfElse" | "switchCase" | "mathPlus" | "mathSubtract" | "mathMultiply" | "mathRound" | "mathCeil" | "mathFloor" | "mathDivide" | "mathMaximal" | "mathLessThan" | "mathLessThanOrEqual" | "mathGreaterThan" | "mathGreaterThanOrEqual" | "genericRequest" | "vesselRequest" | "composeTableColumns" | "defineTableCell" | "iterateRowByColumn" | "countOccurences" | "iterableTable" | "getFromArray" | "sumFromArray" | "containerIterator" | "caseDefinition"

Returns

boolean