Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EntryFilter ¶
EntryFilter defines the interface for filtering entries
type FiltersList ¶
type FiltersList map[ID]EntryFilter
func NewFiltersList ¶
func NewFiltersList(ef ...EntryFilter) FiltersList
func (*FiltersList) Reset ¶
func (fl *FiltersList) Reset()
func (*FiltersList) ToggleFilter ¶
func (fl *FiltersList) ToggleFilter(id ID)
func (*FiltersList) Update ¶
func (fl *FiltersList) Update(msg tea.Msg)
type NameFilter ¶
type NameFilter struct {
// contains filtered or unexported fields
}
NameFilter filters individual *structure.Entry instances by their path value. If an entry's path value does not contain the user input, it will not be filtered/discarded.
User input is handled by a textinput.Model instance, so the filter must update its internal state by providing the corresponding Updater implementation.
func NewNameFilter ¶
func NewNameFilter(placeholder string) *NameFilter
NewNameFilter creates a new name filter.
func (*NameFilter) ClearInput ¶
func (nf *NameFilter) ClearInput()
ClearInput clears the input content but keeps the filter enabled.
func (*NameFilter) Filter ¶
func (nf *NameFilter) Filter(e *structure.Entry) bool
Filter filters a *structure.Entry by checking if its path value contains the current filter input.
func (*NameFilter) ID ¶
func (nf *NameFilter) ID() ID
ID returns the unique identifier of the filter.
func (*NameFilter) IsEnabled ¶
func (nf *NameFilter) IsEnabled() bool
IsEnabled returns whether the filter is enabled.
func (*NameFilter) Reset ¶
func (nf *NameFilter) Reset()
func (*NameFilter) Toggle ¶
func (nf *NameFilter) Toggle()
Toggle switches the enabled state of the filter.
func (*NameFilter) Update ¶
func (nf *NameFilter) Update(msg tea.Msg)
func (*NameFilter) View ¶
func (nf *NameFilter) View() string