section

package
v4.7.3 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 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 BaseModel added in v4.5.0

type BaseModel 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
	IsSearchSupported         bool
}

func NewModel

func NewModel(
	ctx *context.ProgramContext,
	options NewSectionOptions,
) BaseModel

func (*BaseModel) CurrRow added in v4.5.0

func (m *BaseModel) CurrRow() int

func (*BaseModel) FirstItem added in v4.5.0

func (m *BaseModel) FirstItem() int

func (*BaseModel) GetDimensions added in v4.5.0

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

func (*BaseModel) GetFilters added in v4.5.0

func (m *BaseModel) GetFilters() string

func (*BaseModel) GetId added in v4.5.0

func (m *BaseModel) GetId() int

func (*BaseModel) GetMainContent added in v4.5.0

func (m *BaseModel) GetMainContent() string

func (*BaseModel) GetPromptConfirmation added in v4.5.0

func (m *BaseModel) GetPromptConfirmation() string

func (*BaseModel) GetPromptConfirmationAction added in v4.5.0

func (m *BaseModel) GetPromptConfirmationAction() string

func (*BaseModel) GetType added in v4.5.0

func (m *BaseModel) GetType() string

func (*BaseModel) IsLoading added in v4.6.0

func (m *BaseModel) IsLoading() bool

func (*BaseModel) IsPromptConfirmationFocused added in v4.5.0

func (m *BaseModel) IsPromptConfirmationFocused() bool

func (*BaseModel) IsSearchFocused added in v4.5.0

func (m *BaseModel) IsSearchFocused() bool

func (*BaseModel) LastItem added in v4.5.0

func (m *BaseModel) LastItem() int

func (*BaseModel) LastUpdated added in v4.5.0

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

func (*BaseModel) MakeSectionCmd added in v4.5.0

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

func (*BaseModel) NextRow added in v4.5.0

func (m *BaseModel) NextRow() int

func (*BaseModel) PrevRow added in v4.5.0

func (m *BaseModel) PrevRow() int

func (*BaseModel) ResetFilters added in v4.5.0

func (m *BaseModel) ResetFilters()

func (*BaseModel) ResetPageInfo added in v4.5.0

func (m *BaseModel) ResetPageInfo()

func (*BaseModel) ResetRows added in v4.5.0

func (m *BaseModel) ResetRows()

func (*BaseModel) SetIsPromptConfirmationShown added in v4.5.0

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

func (*BaseModel) SetIsSearching added in v4.5.0

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

func (*BaseModel) SetPromptConfirmationAction added in v4.5.0

func (m *BaseModel) SetPromptConfirmationAction(action string)

func (*BaseModel) UpdateProgramContext added in v4.5.0

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

func (*BaseModel) UpdateTotalItemsCount added in v4.5.0

func (m *BaseModel) UpdateTotalItemsCount(count int)

func (*BaseModel) View added in v4.5.0

func (m *BaseModel) View() string

type Component

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

type Identifier

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

type NewSectionOptions added in v4.6.0

type NewSectionOptions struct {
	Id          int
	Config      config.SectionConfig
	Type        string
	Columns     []table.Column
	Singular    string
	Plural      string
	LastUpdated time.Time
}

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
	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 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