gridblock

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EntityRef

func EntityRef(m *grid.Model) *entity.Ref

EntityRef returns the entity.Ref stored (as pointer or value) in the Ref of m's highlighted row, or nil when there is none.

func RefOf

func RefOf(v any) *entity.Ref

RefOf returns the entity.Ref held by v (a *entity.Ref or an entity.Ref, as found in grid.Row.Ref and grid.PinRowMsg.Ref), or nil for anything else, including a nil pointer.

Types

type Block

type Block struct{ *grid.Model }

Block adapts *grid.Model to transcript.Block, transcript.EntityBlock and transcript.SelfFramed. Model is embedded, so every other grid method (Title, CapturesEsc, SetSize, SetFocused, SelectRow, ...) is promoted unchanged, and View(width, focused) satisfies transcript.Block as is.

The grid's own messages (grid.PinRowMsg, grid.SelectionChangedMsg, ...) are returned untouched: what "pin" means is the composing layer's decision.

func Wrap

func Wrap(m *grid.Model) *Block

Wrap returns m as a transcript block.

func (*Block) Current

func (b *Block) Current() *entity.Ref

Current returns the entity under the cursor, or nil.

func (*Block) Focusable

func (b *Block) Focusable() bool

Focusable reports that a grid block always takes a focus stop.

func (*Block) SelfFramed

func (b *Block) SelfFramed() bool

SelfFramed reports that the grid draws its own complete border, so transcript must not wrap it in a card fill.

func (*Block) Update

func (b *Block) Update(msg tea.Msg) (transcript.Block, tea.Cmd)

Update forwards msg to the grid and returns the same Block (identity is kept).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL