Documentation
¶
Overview ¶
Package targetdate is targetlist's sibling for rows that need a prominent leading badge — an hour, a day, anything view.Item.LeadTop/Main/Bottom carries — instead of a plain label. Same selection/⋮-menu mechanics as targetlist, copied rather than shared: the two rows diverge enough in markup (the three-line badge has no targetlist equivalent) that factoring a common base would cost more indirection than the ~80 duplicated lines save. Both satisfy crudview.ListView (see layout/crudview), so a host picks whichever row shape fits its data without crudview knowing which one it got.
Index ¶
- Constants
- type Item
- type TargetDate
- func (t *TargetDate) CloseMenus()
- func (t *TargetDate) Count() int
- func (t *TargetDate) IconSvg() *sprite.Sprite
- func (t *TargetDate) Init(_ Ctx)
- func (t *TargetDate) Items() []Item
- func (t *TargetDate) Render() *Element
- func (t *TargetDate) RenderCSS() *css.Stylesheet
- func (t *TargetDate) SetItems(items []Item)
- func (t *TargetDate) WidgetKind() widget.Kind
- func (t *TargetDate) WidgetName() widget.Name
Constants ¶
const ( PartRow = widget.Part("row") PartContent = widget.Part("content") PartOptions = widget.Part("options") PartBadge = widget.Part("badge") PartLabel = widget.Part("label") PartList = widget.Part("list") PartLead = widget.Part("lead") PartLeadStack = widget.Part("lead-stack") PartLeadTop = widget.Part("lead-top") PartLeadMain = widget.Part("lead-main") PartLeadBottom = widget.Part("lead-bottom") PartButton = widget.Part("button") PartIcon = widget.Part("icon") PartItemDanger = widget.Part("item-danger") PartItemIcon = widget.Part("item-icon") PartItemLabel = widget.Part("item-label") )
const NameTargetDate = widget.Name("targetdate")
NameTargetDate is the widget identity.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Item ¶
Item is view.Item — see targetlist.Item's comment for why this is an alias, not a copy. TargetDate is the one row that actually reads LeadTop/Main/Bottom.
type TargetDate ¶
type TargetDate struct {
Element
Selected *SignalString
OnSelect func(it Item)
OnDelete func(id string)
// contains filtered or unexported fields
}
TargetDate is a selectable list of records with a per-row options menu and a prominent leading badge (LeadTop/Main/Bottom) instead of a plain label lead-in. Same field/method surface as targetlist.TargetList on purpose — see crudview.ListView.
func (*TargetDate) CloseMenus ¶
func (t *TargetDate) CloseMenus()
CloseMenus — see targetlist.TargetList.CloseMenus for why a host needs this.
func (*TargetDate) Count ¶
func (t *TargetDate) Count() int
func (*TargetDate) IconSvg ¶
func (t *TargetDate) IconSvg() *sprite.Sprite
IconSvg registers the ⋮ (vertical dots) options glyph and the trash can (Eliminar) — identical paths to targetlist's own, under a td- prefix so the two sprites never collide once ssr fuses every IconSvg() into one.
func (*TargetDate) Init ¶
func (t *TargetDate) Init(_ Ctx)
func (*TargetDate) Items ¶
func (t *TargetDate) Items() []Item
func (*TargetDate) Render ¶
func (t *TargetDate) Render() *Element
func (*TargetDate) RenderCSS ¶
func (t *TargetDate) RenderCSS() *css.Stylesheet
RenderCSS defines the targetdate visual contract using the style DSL.
func (*TargetDate) SetItems ¶
func (t *TargetDate) SetItems(items []Item)
SetItems replaces the visible rows — see targetlist.TargetList.SetItems.
func (*TargetDate) WidgetKind ¶
func (t *TargetDate) WidgetKind() widget.Kind
func (*TargetDate) WidgetName ¶
func (t *TargetDate) WidgetName() widget.Name