Debian Codegraph @

internal/cli/interactive_tea_input.go

raw symbols SCIP
1 package cliscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/
2
3 import (
4 "github.com/charmbracelet/bubbles/textareascip-go gomod github.com/charmbracelet/bubbles v1.0.0 `github.com/charmbracelet/bubbles/textarea`/"
5 teascip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/ "github.com/charmbracelet/bubbleteascip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/"
6 )
7
8 type interactiveInputModelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveInputModel# struct {
9 sharedDatascip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveInputModel#sharedData. *interactiveSharedDatascip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveSharedData#
10 inputModelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveInputModel#inputModel. textareascip-go gomod github.com/charmbracelet/bubbles v1.0.0 `github.com/charmbracelet/bubbles/textarea`/.Modelscip-go gomod github.com/charmbracelet/bubbles v1.0.0 `github.com/charmbracelet/bubbles/textarea`/Model#
11 }
12
13 func newInteractiveInputModelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/newInteractiveInputModel().(sharedData *interactiveSharedDatascip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveSharedData#) *interactiveInputModelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveInputModel# {
14 ti := textareascip-go gomod github.com/charmbracelet/bubbles v1.0.0 `github.com/charmbracelet/bubbles/textarea`/.Newscip-go gomod github.com/charmbracelet/bubbles v1.0.0 `github.com/charmbracelet/bubbles/textarea`/New().()
15 ti.Placeholderscip-go gomod github.com/charmbracelet/bubbles v1.0.0 `github.com/charmbracelet/bubbles/textarea`/Model#Placeholder. = "Enter a query..."
16 ti.SetValuescip-go gomod github.com/charmbracelet/bubbles v1.0.0 `github.com/charmbracelet/bubbles/textarea`/Model#SetValue().(sharedData.selectorscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveSharedData#selector.)
17 ti.Focusscip-go gomod github.com/charmbracelet/bubbles v1.0.0 `github.com/charmbracelet/bubbles/textarea`/Model#Focus().()
18 ti.SetHeightscip-go gomod github.com/charmbracelet/bubbles v1.0.0 `github.com/charmbracelet/bubbles/textarea`/Model#SetHeight().(5)
19 ti.ShowLineNumbersscip-go gomod github.com/charmbracelet/bubbles v1.0.0 `github.com/charmbracelet/bubbles/textarea`/Model#ShowLineNumbers. = false
20
21 return &interactiveInputModelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveInputModel#{
22 sharedDatascip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveInputModel#sharedData.: sharedData,
23 inputModelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveInputModel#inputModel.: ti,
24 }
25 }
26
27 func (m *interactiveInputModelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveInputModel#) Initscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveInputModel#Init().() teascip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/.Cmdscip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/Cmd# {
28 return textareascip-go gomod github.com/charmbracelet/bubbles v1.0.0 `github.com/charmbracelet/bubbles/textarea`/.Blinkscip-go gomod github.com/charmbracelet/bubbles v1.0.0 `github.com/charmbracelet/bubbles/textarea`/Blink().
29 }
30
31 func (m *interactiveInputModelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveInputModel#) Updatescip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveInputModel#Update().(msg teascip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/.Msgscip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/Msg#) (teascip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/.Modelscip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/Model#, teascip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/.Cmdscip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/Cmd#) {
32 var cmds []teascip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/.Cmdscip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/Cmd#
33 var cmd teascip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/.Cmdscip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/Cmd#
34
35 m.sharedDatascip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveInputModel#sharedData..selectorscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveSharedData#selector. = m.inputModelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveInputModel#inputModel..Valuescip-go gomod github.com/charmbracelet/bubbles v1.0.0 `github.com/charmbracelet/bubbles/textarea`/Model#Value().()
36
37 switch msg := msg.(type) {
38 case teascip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/.WindowSizeMsgscip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/WindowSizeMsg#:
39 m.inputModelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveInputModel#inputModel..SetWidthscip-go gomod github.com/charmbracelet/bubbles v1.0.0 `github.com/charmbracelet/bubbles/textarea`/Model#SetWidth().(msg.Widthscip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/WindowSizeMsg#Width.)
40 }
41
42 m.inputModelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveInputModel#inputModel., cmd = m.inputModelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveInputModel#inputModel..Updatescip-go gomod github.com/charmbracelet/bubbles v1.0.0 `github.com/charmbracelet/bubbles/textarea`/Model#Update().(msg)
43 cmds = append(cmds, cmd)
44
45 return m, teascip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/.Batchscip-go gomod github.com/charmbracelet/bubbletea v1.3.10 `github.com/charmbracelet/bubbletea`/Batch().(cmds...)
46 }
47
48 func (m *interactiveInputModelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveInputModel#) Viewscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveInputModel#View().() string {
49 return m.inputModelscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal/cli`/interactiveInputModel#inputModel..Viewscip-go gomod github.com/charmbracelet/bubbles v1.0.0 `github.com/charmbracelet/bubbles/textarea`/Model#View().()
50 }