@serenity-is/corelib / BooleanFormatter
Class: BooleanFormatter
Defined in: src/ui/formatters/booleanformatter.tsx:9
Renders a boolean value as localized text and/or an icon.
Falls back to DialogTexts.YesButton / NoButton when no explicit texts are provided.
Implements
Constructors
Constructor
new BooleanFormatter(
props):BooleanFormatter
Defined in: src/ui/formatters/booleanformatter.tsx:24
Creates a new BooleanFormatter.
Parameters
props
Formatter options.
falseIcon?
Icon class for false values.
falseText?
string
Text for false values.
nullIcon?
Icon class for null values.
nullText?
string
Text for null values.
showHint?
boolean
Whether to show text as title hint.
showText?
boolean
Whether to show text alongside icon (default true).
trueIcon?
Icon class for true values.
trueText?
string
Text for true values.
Returns
BooleanFormatter
Properties
props
readonlyprops:object={}
Defined in: src/ui/formatters/booleanformatter.tsx:24
Formatter options.
falseIcon?
optionalfalseIcon:IconClassName
falseText?
optionalfalseText:string
nullIcon?
optionalnullIcon:IconClassName
nullText?
optionalnullText:string
showHint?
optionalshowHint:boolean
showText?
optionalshowText:boolean
trueIcon?
optionaltrueIcon:IconClassName
trueText?
optionaltrueText:string
[typeInfo]
static[typeInfo]:FormatterTypeInfo<"Serenity.">
Defined in: src/ui/formatters/booleanformatter.tsx:10
Accessors
falseText
Get Signature
get falseText():
string
Defined in: src/ui/formatters/booleanformatter.tsx:70
Gets the text for false values.
Returns
string
The false text.
Set Signature
set falseText(
value):void
Defined in: src/ui/formatters/booleanformatter.tsx:75
Sets the text for false values.
Parameters
value
string
The false text.
Returns
void
trueText
Get Signature
get trueText():
string
Defined in: src/ui/formatters/booleanformatter.tsx:78
Gets the text for true values.
Returns
string
The true text.
Set Signature
set trueText(
value):void
Defined in: src/ui/formatters/booleanformatter.tsx:83
Sets the text for true values.
Parameters
value
string
The true text.
Returns
void
Methods
format()
format(
ctx):FormatterResult
Defined in: src/ui/formatters/booleanformatter.tsx:42
Formats the boolean value for display.
Parameters
ctx
FormatterContext
Formatter context with value/item/column.
Returns
FormatterResult
Text, icon, or combined span per props.