section

package
v4.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Component

type Component interface {
	Update(msg tea.Msg) (Section, tea.Cmd)
	View() string
}

type Identifier

type Identifier interface {
	GetId() int
	GetType() string
}

type Model

type Model struct {
	Id                        int
	Config                    config.SectionConfig
	Ctx                       *context.ProgramContext
	Spinner                   spinner.Model
	SearchBar                 search.Model
	IsSearching               bool
	SearchValue               string
	Table                     table.Model
	Type                      string
	SingularForm              string
	PluralForm                string
	Columns                   []table.Column
	TotalCount                int
	PageInfo                  *data.PageInfo
	PromptConfirmationBox     prompt.Model
	IsPromptConfirmationShown bool
	PromptConfirmationAction  string
	LastFetchTaskId           string
}

func NewModel

func NewModel(
	id int,
	ctx *context.ProgramContext,
	cfg config.SectionConfig,
	sType string,
	columns []table.Column,
	singular, plural string,
	lastUpdated time.Time,
) Model

func (*Model) CreateNextTickCmd

func (m *Model) CreateNextTickCmd(nextTickCmd tea.Cmd) tea.Cmd

func (*Model) CurrRow

func (m *Model) CurrRow() int

func (*Model) FirstItem

func (m *Model) FirstItem() int

func (*Model) GetDimensions

func (m *Model) GetDimensions() constants.Dimensions

func (*Model) GetFilters

func (m *Model) GetFilters() string

func (*Model) GetId

func (m *Model) GetId() int

func (*Model) GetMainContent

func (m *Model) GetMainContent() string

func (*Model) GetPagerContent

func (m *Model) GetPagerContent() string

func (*Model) GetPromptConfirmation

func (m *Model) GetPromptConfirmation() string

func (*Model) GetPromptConfirmationAction

func (m *Model) GetPromptConfirmationAction() string

func (*Model) GetType

func (m *Model) GetType() string

func (*Model) IsPromptConfirmationFocused

func (m *Model) IsPromptConfirmationFocused() bool

func (*Model) IsSearchFocused

func (m *Model) IsSearchFocused() bool

func (*Model) LastItem

func (m *Model) LastItem() int

func (*Model) LastUpdated

func (m *Model) LastUpdated() time.Time

func (*Model) MakeSectionCmd

func (m *Model) MakeSectionCmd(cmd tea.Cmd) tea.Cmd

func (*Model) NextRow

func (m *Model) NextRow() int

func (*Model) PrevRow

func (m *Model) PrevRow() int

func (*Model) ResetFilters

func (m *Model) ResetFilters()

func (*Model) ResetPageInfo

func (m *Model) ResetPageInfo()

func (*Model) SetIsPromptConfirmationShown

func (m *Model) SetIsPromptConfirmationShown(val bool) tea.Cmd

func (*Model) SetIsSearching

func (m *Model) SetIsSearching(val bool) tea.Cmd

func (*Model) SetPromptConfirmationAction

func (m *Model) SetPromptConfirmationAction(action string)

func (*Model) UpdateLastUpdated

func (m *Model) UpdateLastUpdated(t time.Time)

func (*Model) UpdateProgramContext

func (m *Model) UpdateProgramContext(ctx *context.ProgramContext)

func (*Model) UpdateTotalItemsCount

func (m *Model) UpdateTotalItemsCount(count int)

func (*Model) View

func (m *Model) View() string

type PromptConfirmation

type PromptConfirmation interface {
	SetIsPromptConfirmationShown(val bool) tea.Cmd
	IsPromptConfirmationFocused() bool
	SetPromptConfirmationAction(action string)
	GetPromptConfirmationAction() string
	GetPromptConfirmation() string
}
type Search interface {
	SetIsSearching(val bool) tea.Cmd
	IsSearchFocused() bool
	ResetFilters()
	GetFilters() string
	ResetPageInfo()
}

type Section

type Section interface {
	Identifier
	Component
	Table
	Search
	PromptConfirmation
	UpdateProgramContext(ctx *context.ProgramContext)
	MakeSectionCmd(cmd tea.Cmd) tea.Cmd
	LastUpdated() time.Time
	UpdateLastUpdated(time.Time)
	GetPagerContent() string
	GetItemSingularForm() string
	GetItemPluralForm() string
	GetTotalCount() *int
}

type SectionMsg

type SectionMsg struct {
	Id          int
	Type        string
	InternalMsg tea.Msg
}

type SectionRowsFetchedMsg

type SectionRowsFetchedMsg struct {
	SectionId int
	Issues    []data.RowData
}

func (SectionRowsFetchedMsg) GetSectionId

func (msg SectionRowsFetchedMsg) GetSectionId() int

type SectionTickMsg

type SectionTickMsg struct {
	InternalTickMsg tea.Msg
}

type Table

type Table interface {
	NumRows() int
	GetCurrRow() data.RowData
	CurrRow() int
	NextRow() int
	PrevRow() int
	FirstItem() int
	LastItem() int
	FetchNextPageSectionRows() []tea.Cmd
	BuildRows() []table.Row
	ResetRows()
	IsLoading() bool
}

Jump to

Keyboard shortcuts

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