Documentation
¶
Index ¶
- func DisplayErrorNotification(message string)
- func DisplayInfoNotification(message string)
- func DisplayNotification(message, messageType string)
- func DisplayWarningNotification(message string)
- func GetTableScreen(tbHandler TableDataHandler, customStyles map[string]lipgloss.Color) string
- func GetTableScreenCustom(tbHandler TableDataHandler, customStyles map[string]lipgloss.Color, ...) string
- func NavigateAndExecuteForm(config FormConfig) (map[string]string, error)
- func NavigateAndExecuteTable(tbHandler TableDataHandler, customStyles map[string]lipgloss.Color) error
- func NavigateAndExecuteTableCustom(tbHandler TableDataHandler, customStyles map[string]lipgloss.Color, ...) error
- func ShowForm(config FormConfig) (map[string]string, error)
- func ShowFormWithNotification(config FormConfig) (map[string]string, error)
- func ShowNotification(notification Notification)
- func StartTableScreen(tbHandler TableDataHandler, customStyles map[string]lipgloss.Color) error
- func StartTableScreenCustom(tbHandler TableDataHandler, customStyles map[string]lipgloss.Color, ...) error
- func StartTableScreenFromRenderer(k *TableRenderer) error
- type FormModel
- type Notification
- type NotificationType
- type StyleFunc
- type TableRenderer
- func (k *TableRenderer) ApplyFilter()
- func (k *TableRenderer) ExportToCSV(filename string)
- func (k *TableRenderer) ExportToExcel(filename string)
- func (k *TableRenderer) ExportToJSON(filename string)
- func (k *TableRenderer) ExportToMarkdown(filename string)
- func (k *TableRenderer) ExportToPDF(filename string)
- func (k *TableRenderer) ExportToXML(filename string)
- func (k *TableRenderer) ExportToYAML(filename string)
- func (k *TableRenderer) GetArrayMap() map[string][]string
- func (k *TableRenderer) GetByteMap() map[string][]byte
- func (k *TableRenderer) GetCurrentPageRows() [][]string
- func (k *TableRenderer) GetHashMap() map[string]string
- func (k *TableRenderer) GetHeaders() []string
- func (k *TableRenderer) GetObjectMap() []map[string]string
- func (k *TableRenderer) GetRows() [][]string
- func (k *TableRenderer) Init() tea.Cmd
- func (k *TableRenderer) RowsNavigate(direction string) error
- func (k *TableRenderer) SortRows()
- func (k *TableRenderer) ToggleColumnVisibility()
- func (k *TableRenderer) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (k *TableRenderer) View() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DisplayErrorNotification ¶ added in v1.1.2
func DisplayErrorNotification(message string)
func DisplayInfoNotification ¶ added in v1.1.2
func DisplayInfoNotification(message string)
func DisplayNotification ¶ added in v1.1.2
func DisplayNotification(message, messageType string)
func DisplayWarningNotification ¶ added in v1.1.2
func DisplayWarningNotification(message string)
func GetTableScreen ¶
GetTableScreen returns the string representation of the table with custom styles.
func GetTableScreenCustom ¶ added in v1.2.0
func GetTableScreenCustom(tbHandler TableDataHandler, customStyles map[string]lipgloss.Color, styleFunc StyleFunc) string
GetTableScreenCustom returns the string representation of the table with custom styles and an optional style function.
func NavigateAndExecuteForm ¶ added in v1.1.2
func NavigateAndExecuteTable ¶ added in v1.1.2
func NavigateAndExecuteTable(tbHandler TableDataHandler, customStyles map[string]lipgloss.Color) error
NavigateAndExecuteTable navigates and executes the table screen with custom styles.
func NavigateAndExecuteTableCustom ¶ added in v1.2.0
func NavigateAndExecuteTableCustom(tbHandler TableDataHandler, customStyles map[string]lipgloss.Color, styleFunc StyleFunc) error
NavigateAndExecuteTableCustom navigates and executes the table screen with custom styles and an optional style function.
func ShowFormWithNotification ¶ added in v1.1.2
func ShowNotification ¶ added in v1.1.2
func ShowNotification(notification Notification)
func StartTableScreen ¶
StartTableScreen starts the table screen with custom styles.
func StartTableScreenCustom ¶ added in v1.2.0
func StartTableScreenCustom(tbHandler TableDataHandler, customStyles map[string]lipgloss.Color, styleFunc StyleFunc) error
StartTableScreenCustom starts the table screen with custom styles and an optional style function.
func StartTableScreenFromRenderer ¶ added in v1.1.2
func StartTableScreenFromRenderer(k *TableRenderer) error
StartTableScreenFromRenderer starts the table screen from a given TableRenderer.
Types ¶
type FormModel ¶
type Notification ¶ added in v1.1.2
type Notification struct {
Message string
Type NotificationType
}
type NotificationType ¶ added in v1.1.2
type NotificationType string
const ( Info NotificationType = "info" Warning NotificationType = "warning" Error NotificationType = "error" )
type StyleFunc ¶ added in v1.2.0
StyleFunc defines a function that returns a lipgloss.Style based on row, column, and cell value.
type TableRenderer ¶
type TableRenderer struct {
// contains filtered or unexported fields
}
TableRenderer is responsible for rendering tables in the terminal with customizable styles and dynamic behavior.
func NewTableRenderer ¶
func NewTableRenderer(tbHandler TableDataHandler, customStyles map[string]lipgloss.Color, styleFunc StyleFunc) *TableRenderer
NewTableRenderer creates a new TableRenderer with custom styles and an optional style function.
func (*TableRenderer) ApplyFilter ¶
func (k *TableRenderer) ApplyFilter()
ApplyFilter applies a filter to the table rows.
func (*TableRenderer) ExportToCSV ¶
func (k *TableRenderer) ExportToCSV(filename string)
ExportToCSV exports the table data to a CSV file.
func (*TableRenderer) ExportToExcel ¶
func (k *TableRenderer) ExportToExcel(filename string)
ExportToExcel is a placeholder for exporting the table data to an Excel file.
func (*TableRenderer) ExportToJSON ¶
func (k *TableRenderer) ExportToJSON(filename string)
ExportToJSON exports the table data to a JSON file.
func (*TableRenderer) ExportToMarkdown ¶
func (k *TableRenderer) ExportToMarkdown(filename string)
ExportToMarkdown exports the table data to a Markdown file.
func (*TableRenderer) ExportToPDF ¶
func (k *TableRenderer) ExportToPDF(filename string)
ExportToPDF exports the table data to a PDF file.
func (*TableRenderer) ExportToXML ¶
func (k *TableRenderer) ExportToXML(filename string)
ExportToXML exports the table data to an XML file.
func (*TableRenderer) ExportToYAML ¶
func (k *TableRenderer) ExportToYAML(filename string)
ExportToYAML exports the table data to a YAML file.
func (*TableRenderer) GetArrayMap ¶ added in v1.1.2
func (k *TableRenderer) GetArrayMap() map[string][]string
GetArrayMap returns the table data as a map of arrays.
func (*TableRenderer) GetByteMap ¶ added in v1.1.2
func (k *TableRenderer) GetByteMap() map[string][]byte
GetByteMap returns the table data as a map of byte slices.
func (*TableRenderer) GetCurrentPageRows ¶
func (k *TableRenderer) GetCurrentPageRows() [][]string
GetCurrentPageRows returns the rows for the current page.
func (*TableRenderer) GetHashMap ¶ added in v1.1.2
func (k *TableRenderer) GetHashMap() map[string]string
GetHashMap returns the table data as a hash map.
func (*TableRenderer) GetHeaders ¶ added in v1.1.2
func (k *TableRenderer) GetHeaders() []string
GetHeaders returns the table headers.
func (*TableRenderer) GetObjectMap ¶ added in v1.1.2
func (k *TableRenderer) GetObjectMap() []map[string]string
GetObjectMap returns the table data as a slice of maps.
func (*TableRenderer) GetRows ¶ added in v1.1.2
func (k *TableRenderer) GetRows() [][]string
GetRows returns the table rows.
func (*TableRenderer) Init ¶
func (k *TableRenderer) Init() tea.Cmd
Init initializes the table renderer.
func (*TableRenderer) RowsNavigate ¶
func (k *TableRenderer) RowsNavigate(direction string) error
RowsNavigate navigates through the table rows.
func (*TableRenderer) ToggleColumnVisibility ¶ added in v1.1.2
func (k *TableRenderer) ToggleColumnVisibility()
ToggleColumnVisibility toggles the visibility of the columns in the table.
func (*TableRenderer) View ¶
func (k *TableRenderer) View() string
View returns the string representation of the table for rendering.