taskeditor

package
v0.0.0-...-a02a1e0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultKeyMap = KeyMap{
	ToggleFocus: key.NewBinding(
		key.WithKeys("tab"),
		key.WithHelp("tab", "toggle focus between fields"),
	),
	Submit: key.NewBinding(
		key.WithKeys("enter"),
		key.WithHelp("enter", "submit the task"),
	),
}

Functions

This section is empty.

Types

type Fields

type Fields struct {
	Status    tasks.Status
	Due       *time.Time
	Scheduled *time.Time
	Completed *time.Time
	Priority  *int
	Every     *tasks.Every
	Name      string
	// contains filtered or unexported fields
}

func NewFields

func NewFields(ctx *context.ProgramContext) *Fields

func (*Fields) Init

func (f *Fields) Init() (tea.Model, tea.Cmd)

func (*Fields) Update

func (f *Fields) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*Fields) View

func (f *Fields) View() string

type KeyMap

type KeyMap struct {
	ToggleFocus key.Binding
	Submit      key.Binding
}

type Location

type Location struct {
	// contains filtered or unexported fields
}

func NewLocation

func NewLocation(ctx *context.ProgramContext) *Location

func (*Location) Init

func (l *Location) Init() (tea.Model, tea.Cmd)

func (*Location) SetLocation

func (l *Location) SetLocation(file string, line int) *Location

func (*Location) Update

func (l *Location) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*Location) View

func (l *Location) View() string

type Mode

type Mode func(*Model)

func WithAddToDaily

func WithAddToDaily(status tasks.Status, text string, date time.Time) Mode

func WithAddToProject

func WithAddToProject(status tasks.Status, text string, project projects.Project, date time.Time) Mode

func WithEdit

func WithEdit(task tasks.Task, date time.Time) Mode

type Model

type Model struct {
	// contains filtered or unexported fields
}

func New

func New(ctx *context.ProgramContext, nd notedown.Client, mode Mode) *Model

func (*Model) Init

func (m *Model) Init() (tea.Model, tea.Cmd)

func (*Model) Update

func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*Model) View

func (m *Model) View() string

type Status

type Status struct {
	// contains filtered or unexported fields
}

func NewStatus

func NewStatus(ctx *context.ProgramContext, value tasks.Status) *Status

func (*Status) Blur

func (s *Status) Blur() *Status

func (*Status) Focus

func (s *Status) Focus() *Status

func (*Status) Init

func (s *Status) Init() (tea.Model, tea.Cmd)

func (*Status) Margin

func (s *Status) Margin(i ...int) *Status

func (*Status) SetValue

func (s *Status) SetValue(value tasks.Status)

func (*Status) Update

func (s *Status) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (Status) Value

func (s Status) Value() tasks.Status

func (*Status) View

func (s *Status) View() string

type Text

type Text struct {
	IsValid bool
	// contains filtered or unexported fields
}

func NewText

func NewText(ctx *context.ProgramContext) *Text

func (Text) AtBeginning

func (t Text) AtBeginning() bool

func (*Text) Blur

func (t *Text) Blur() *Text

func (Text) Cursor

func (t Text) Cursor() int

func (*Text) Focus

func (t *Text) Focus() *Text

func (*Text) Init

func (t *Text) Init() (tea.Model, tea.Cmd)

func (*Text) SetCursor

func (t *Text) SetCursor(i int)

func (*Text) SetValue

func (t *Text) SetValue(s string) *Text

func (*Text) Update

func (t *Text) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (Text) Value

func (t Text) Value() string

func (*Text) View

func (s *Text) View() string

func (*Text) Width

func (t *Text) Width(i int) *Text

Jump to

Keyboard shortcuts

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