Item
@Js
const mixin Item
Item wraps a data value for presentation with text, icon, and meta.
Construct wrapped data
Constant for null value
Sorting
Wrapped data value
Presentation text string
Convenience for meta.get
Convenience for meta.has
Presentation icon if available
Get the item id
Return if this item an subtype of ItemCollection
Is this the special nullVal constant
Metadata
Convenience for meta.missing
Get the item subject navigation identifier
Spec type for this item resolved from data
Presentation text
Return text display
Int compare(Obj that)
Sorting
abstract Obj data()
Wrapped data value. Use isNull to check for null data
virtual Str dis()
Presentation text string
@Operator
virtual Obj? get(Str name)
Convenience for meta.get
virtual Bool has(Str name)
Convenience for meta.has
abstract Icon? icon()
Presentation icon if available
abstract Ref id()
Get the item id
virtual Bool isCollection()
Return if this item an subtype of ItemCollection
Bool isNull()
Is this the special nullVal constant
static new make(Obj? data, Icon? icon := null, Obj? text := null, Dict? meta := null)
Construct wrapped data:
- if data is null then return nullVal constant
- if data is Item, return it
- text is normalized via Text.fromData
- if meta is data if Dict, otherwise empty dict
- id/sni comes from meta or is auto-generated
abstract Dict meta()
Metadata
virtual Bool missing(Str name)
Convenience for meta.missing
const static Item : nullVal
Constant for null value
abstract Sni sni()
Get the item subject navigation identifier
virtual Spec spec()
Spec type for this item resolved from data
abstract Text text()
Presentation text
virtual Str toStr()
Return text display