Text
@Js
@Gen
const mixin Text
Text wraps a string for display with localization macro support.
Localization "$<key>" // for keys in "pi" pod itself
Localization "$<pod::key>" // for keys in other pods
Create from string value
Empty string
Same as empty
Text to display
Coerce from any value
Map text from record or meta dict
Is this the blank / empty string
Text pattern
Return pattern (not dis)
static Text defVal()
Same as empty
abstract Str dis()
Text to display
const static Text : empty
Empty string
static Text fromData(Obj? val, Dict? meta := null)
Coerce from any value:
- Null returns empty string
- Text returns itself
- Str returns fromStr
- Dict returns fromDict
- Return Etc.valToDis
static Text? fromDict(Dict dict, Str? def := null)
Map text from record or meta dict:
- look for text tag, only use it if not empty
- fallback to def if provided
- fallback to Dict.dis
static new fromStr(Str s)
Create from string value
Bool isBlank()
Is this the blank / empty string
abstract Str pattern()
Text pattern
Str toStr()
Return pattern (not dis)