Documentation
¶
Index ¶
- Constants
- type Commander
- type Config
- type FilePicker
- func (f *FilePicker) Accessor(accessor huh.Accessor[string]) *FilePicker
- func (f *FilePicker) AllowedTypes(types []string) *FilePicker
- func (f *FilePicker) Blur() tea.Cmd
- func (f *FilePicker) CurrentDirectory(directory string) *FilePicker
- func (f *FilePicker) Cursor(cursor string) *FilePicker
- func (f *FilePicker) Description(description string) *FilePicker
- func (f *FilePicker) DirAllowed(v bool) *FilePicker
- func (f *FilePicker) Error() error
- func (f *FilePicker) FileAllowed(v bool) *FilePicker
- func (f *FilePicker) Focus() tea.Cmd
- func (f *FilePicker) GetKey() string
- func (f *FilePicker) GetValue() any
- func (f *FilePicker) Height(height int) *FilePicker
- func (f *FilePicker) Init() tea.Cmd
- func (f *FilePicker) Key(k string) *FilePicker
- func (f *FilePicker) KeyBinds() []key.Binding
- func (f *FilePicker) Picking(v bool) *FilePicker
- func (f *FilePicker) Run() error
- func (f *FilePicker) RunAccessible(_ io.Writer, _ io.Reader) error
- func (f *FilePicker) ShowPermissions(v bool) *FilePicker
- func (f *FilePicker) ShowSize(v bool) *FilePicker
- func (*FilePicker) Skip() bool
- func (f *FilePicker) Title(title string) *FilePicker
- func (f *FilePicker) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (f *FilePicker) Validate(validate func(string) error) *FilePicker
- func (f *FilePicker) Value(value *string) *FilePicker
- func (f *FilePicker) View() string
- func (f *FilePicker) WithAccessible(_ bool) huh.Field
- func (f *FilePicker) WithHeight(height int) huh.Field
- func (f *FilePicker) WithKeyMap(k *huh.KeyMap) huh.Field
- func (f *FilePicker) WithPosition(p huh.FieldPosition) huh.Field
- func (f *FilePicker) WithTheme(theme *huh.Theme) huh.Field
- func (f *FilePicker) WithWidth(width int) huh.Field
- func (f *FilePicker) Zoom() bool
- type Model
- type Result
Constants ¶
const ( FieldFile = "file" FieldExtraArgs = "extraArgs" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
CommonModel *common.CommonModel
}
type FilePicker ¶
type FilePicker struct {
// contains filtered or unexported fields
}
FilePicker is a form file file field.
func NewFilePicker ¶
func NewFilePicker(base filepicker.Model) *FilePicker
NewFilePicker returns a new file field.
func (*FilePicker) Accessor ¶
func (f *FilePicker) Accessor(accessor huh.Accessor[string]) *FilePicker
Accessor sets the accessor of the file field.
func (*FilePicker) AllowedTypes ¶
func (f *FilePicker) AllowedTypes(types []string) *FilePicker
AllowedTypes sets the allowed types of the file field. These will be the only valid file types accepted, other files will show as disabled.
func (*FilePicker) CurrentDirectory ¶
func (f *FilePicker) CurrentDirectory(directory string) *FilePicker
CurrentDirectory sets the directory of the file field.
func (*FilePicker) Cursor ¶
func (f *FilePicker) Cursor(cursor string) *FilePicker
Cursor sets the cursor of the file field.
func (*FilePicker) Description ¶
func (f *FilePicker) Description(description string) *FilePicker
Description sets the description of the file field.
func (*FilePicker) DirAllowed ¶
func (f *FilePicker) DirAllowed(v bool) *FilePicker
DirAllowed sets whether to allow directories to be selected.
func (*FilePicker) Error ¶
func (f *FilePicker) Error() error
Error returns the error of the file field.
func (*FilePicker) FileAllowed ¶
func (f *FilePicker) FileAllowed(v bool) *FilePicker
FileAllowed sets whether to allow files to be selected.
func (*FilePicker) GetKey ¶
func (f *FilePicker) GetKey() string
GetKey returns the key of the field.
func (*FilePicker) GetValue ¶
func (f *FilePicker) GetValue() any
GetValue returns the value of the field.
func (*FilePicker) Height ¶
func (f *FilePicker) Height(height int) *FilePicker
Height sets the height of the file field. If the number of options exceeds the height, the file field will become scrollable.
func (*FilePicker) Key ¶
func (f *FilePicker) Key(k string) *FilePicker
Key sets the key of the file field which can be used to retrieve the value after submission.
func (*FilePicker) KeyBinds ¶
func (f *FilePicker) KeyBinds() []key.Binding
KeyBinds returns the help keybindings for the file field.
func (*FilePicker) Picking ¶
func (f *FilePicker) Picking(v bool) *FilePicker
Picking sets whether the file picker should be in the picking files state.
func (*FilePicker) RunAccessible ¶
RunAccessible runs an accessible file field.
func (*FilePicker) ShowPermissions ¶
func (f *FilePicker) ShowPermissions(v bool) *FilePicker
ShowPermissions sets whether to show file permissions.
func (*FilePicker) ShowSize ¶
func (f *FilePicker) ShowSize(v bool) *FilePicker
ShowSize sets whether to show file sizes.
func (*FilePicker) Skip ¶
func (*FilePicker) Skip() bool
Skip returns whether the file should be skipped or should be blocking.
func (*FilePicker) Title ¶
func (f *FilePicker) Title(title string) *FilePicker
Title sets the title of the file field.
func (*FilePicker) Validate ¶
func (f *FilePicker) Validate(validate func(string) error) *FilePicker
Validate sets the validation function of the file field.
func (*FilePicker) Value ¶
func (f *FilePicker) Value(value *string) *FilePicker
Value sets the value of the file field.
func (*FilePicker) WithAccessible ¶
func (f *FilePicker) WithAccessible(_ bool) huh.Field
func (*FilePicker) WithHeight ¶
func (f *FilePicker) WithHeight(height int) huh.Field
WithHeight sets the height of the file field.
func (*FilePicker) WithKeyMap ¶
func (f *FilePicker) WithKeyMap(k *huh.KeyMap) huh.Field
WithKeyMap sets the keymap on a file field.
func (*FilePicker) WithPosition ¶
func (f *FilePicker) WithPosition(p huh.FieldPosition) huh.Field
WithPosition sets the position of the file field.
func (*FilePicker) WithTheme ¶
func (f *FilePicker) WithTheme(theme *huh.Theme) huh.Field
WithTheme sets the theme of the file field.
func (*FilePicker) WithWidth ¶
func (f *FilePicker) WithWidth(width int) huh.Field
WithWidth sets the width of the file field.
func (*FilePicker) Zoom ¶
func (f *FilePicker) Zoom() bool
Zoom returns whether the input should be zoomed.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}