Documentation
¶
Overview ¶
Package targethour 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 TargetHour
- func (t *TargetHour) CloseMenus()
- func (t *TargetHour) Count() int
- func (t *TargetHour) IconSvg() *sprite.Sprite
- func (t *TargetHour) Init(_ Ctx)
- func (t *TargetHour) Items() []Item
- func (t *TargetHour) Render() *Element
- func (t *TargetHour) RenderCSS() *css.Stylesheet
- func (t *TargetHour) SetItems(items []Item)
- func (t *TargetHour) WidgetKind() widget.Kind
- func (t *TargetHour) 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 NameTargetHour = widget.Name("targethour")
NameTargetHour 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. TargetHour is the one row that actually reads LeadTop/Main/Bottom.
type TargetHour ¶
type TargetHour struct {
Element
Selected *SignalString
OnSelect func(it Item)
OnDelete func(id string)
// contains filtered or unexported fields
}
TargetHour 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 (*TargetHour) CloseMenus ¶
func (t *TargetHour) CloseMenus()
CloseMenus — see targetlist.TargetList.CloseMenus for why a host needs this.
func (*TargetHour) Count ¶
func (t *TargetHour) Count() int
func (*TargetHour) IconSvg ¶
func (t *TargetHour) IconSvg() *sprite.Sprite
IconSvg registers the ⋮ (vertical dots) options glyph and the trash can (Eliminar) — identical paths to targetlist's own, under a th- prefix so the two sprites never collide once ssr fuses every IconSvg() into one.
func (*TargetHour) Init ¶
func (t *TargetHour) Init(_ Ctx)
func (*TargetHour) Items ¶
func (t *TargetHour) Items() []Item
func (*TargetHour) Render ¶
func (t *TargetHour) Render() *Element
func (*TargetHour) RenderCSS ¶
func (t *TargetHour) RenderCSS() *css.Stylesheet
RenderCSS defines the targethour visual contract using the style DSL.
func (*TargetHour) SetItems ¶
func (t *TargetHour) SetItems(items []Item)
SetItems replaces the visible rows — see targetlist.TargetList.SetItems.
func (*TargetHour) WidgetKind ¶
func (t *TargetHour) WidgetKind() widget.Kind
func (*TargetHour) WidgetName ¶
func (t *TargetHour) WidgetName() widget.Name