Documentation ¶
Index ¶
- type Cell
- func (r *Cell) GetContent() string
- func (r *Cell) GetHeight() int
- func (r *Cell) GetStyle() lipgloss.Style
- func (r *Cell) GetWidth() int
- func (r *Cell) SetContent(content string) *Cell
- func (r *Cell) SetID(id string) *Cell
- func (r *Cell) SetMinHeigth(value int) *Cell
- func (r *Cell) SetMinWidth(value int) *Cell
- func (r *Cell) SetStyle(style lipgloss.Style) *Cell
- type Column
- func (r *Column) AddCells(cells ...*Cell) *Column
- func (r *Column) CellsLen() int
- func (r *Column) GetCell(index int) *Cell
- func (r *Column) GetCellCopy(index int) *Cell
- func (r *Column) GetCellWithID(id string) *Cell
- func (r *Column) SetStyle(style lipgloss.Style) *Column
- func (r *Column) StylePassing(value bool) *Column
- func (r *Column) UpdateCellWithIndex(index int, cell *Cell)
- type FlexBox
- func (r *FlexBox) AddRows(rows []*Row) *FlexBox
- func (r *FlexBox) ForceRecalculate()
- func (r *FlexBox) GetHeight() int
- func (r *FlexBox) GetRow(index int) *Row
- func (r *FlexBox) GetRowCellCopy(rowIndex, cellIndex int) *Cell
- func (r *FlexBox) GetRowCopy(index int) *Row
- func (r *FlexBox) GetWidth() int
- func (r *FlexBox) LockRowHeight(value int) *FlexBox
- func (r *FlexBox) NewRow() *Row
- func (r *FlexBox) Render() string
- func (r *FlexBox) RowsLen() int
- func (r *FlexBox) SetHeight(value int) *FlexBox
- func (r *FlexBox) SetRows(rows []*Row) *FlexBox
- func (r *FlexBox) SetStyle(style lipgloss.Style) *FlexBox
- func (r *FlexBox) SetWidth(value int) *FlexBox
- func (r *FlexBox) StylePassing(value bool) *FlexBox
- func (r *FlexBox) UpdateRow(index int, row *Row) *FlexBox
- type HorizontalFlexBox
- func (r *HorizontalFlexBox) AddColumns(columns []*Column) *HorizontalFlexBox
- func (r *HorizontalFlexBox) ColumnsLen() int
- func (r *HorizontalFlexBox) ForceRecalculate()
- func (r *HorizontalFlexBox) GetColumn(index int) *Column
- func (r *HorizontalFlexBox) GetColumnCellCopy(columnIndex, cellIndex int) *Cell
- func (r *HorizontalFlexBox) GetColumnCopy(index int) *Column
- func (r *HorizontalFlexBox) GetHeight() int
- func (r *HorizontalFlexBox) GetWidth() int
- func (r *HorizontalFlexBox) LockColumnWidth(value int) *HorizontalFlexBox
- func (r *HorizontalFlexBox) NewColumn() *Column
- func (r *HorizontalFlexBox) Render() string
- func (r *HorizontalFlexBox) SetColumns(columns []*Column) *HorizontalFlexBox
- func (r *HorizontalFlexBox) SetHeight(value int) *HorizontalFlexBox
- func (r *HorizontalFlexBox) SetStyle(style lipgloss.Style) *HorizontalFlexBox
- func (r *HorizontalFlexBox) SetWidth(value int) *HorizontalFlexBox
- func (r *HorizontalFlexBox) StylePassing(value bool) *HorizontalFlexBox
- func (r *HorizontalFlexBox) UpdateColumn(index int, column *Column) *HorizontalFlexBox
- type Row
- func (r *Row) AddCells(cells ...*Cell) *Row
- func (r *Row) CellsLen() int
- func (r *Row) GetCell(index int) *Cell
- func (r *Row) GetCellCopy(index int) *Cell
- func (r *Row) GetCellWithID(id string) *Cell
- func (r *Row) SetStyle(style lipgloss.Style) *Row
- func (r *Row) StylePassing(value bool) *Row
- func (r *Row) UpdateCellWithIndex(index int, cell *Cell)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cell ¶
type Cell struct {
// contains filtered or unexported fields
}
Cell is a building block object of the FlexBox, it represents a single cell within a box A FlexBox stacks cells horizonally. A HorizontalFlexBox stacks cells vertically. (controverse, isn't it?)
func (*Cell) GetContent ¶
GetContent returns the cells raw content
func (*Cell) SetContent ¶
SetContent sets the cells content
func (*Cell) SetMinHeigth ¶
SetMinHeigth sets the cells minimum height, this will not disable responsivness. This has only an effect to cells of a HorizontalFlexBox.
func (*Cell) SetMinWidth ¶
SetMinWidth sets the cells minimum width, this will not disable responsivness. This has only an effect to cells of a normal FlexBox, not a HorizontalFlexBox.
type Column ¶
type Column struct {
// contains filtered or unexported fields
}
Column is the container for the cells, this object has the least to do with the ratio of the construction as it takes all of the needed ratio information from the cell slice columns are stacked horizontally.
func (*Column) AddCells ¶
AddCells appends the cells to the column if the cell ID is not set it will default to the index of the cell
func (*Column) GetCell ¶
GetCell returns the Cell on the given index if it exists note: forces the recalculation if found
returns nil if not found
func (*Column) GetCellCopy ¶
GetCellCopy returns a copy of the Cell on the given index, if cell does not exist it will return nil. This is useful when you need to get cells attribute without triggering a recalculation.
func (*Column) GetCellWithID ¶
GetCellWithID returns the cell with the given ID if existing note: forces the recalculation if found
returns nil if not found
func (*Column) StylePassing ¶
StylePassing set whether the style should be passed to the cells
func (*Column) UpdateCellWithIndex ¶
UpdateCellWithIndex replaces the cell on the given index if it exists if its not existing no changes will apply
type FlexBox ¶
type FlexBox struct {
// contains filtered or unexported fields
}
FlexBox responsive box grid insipred by CSS flexbox
func (*FlexBox) ForceRecalculate ¶
func (r *FlexBox) ForceRecalculate()
ForceRecalculate forces the recalculation for the box and all the rows
func (*FlexBox) GetRow ¶
GetRow returns the Row on the given index if it exists note: forces the recalculation if found
returns nil if not found
func (*FlexBox) GetRowCellCopy ¶
GetRowCellCopy returns a copy of the FlexBoxCell on the given index x, within the given row with index y, if row or cell do not exist it will return nil. This is useful when you need to get rows attribute without triggering a recalculation.
func (*FlexBox) GetRowCopy ¶
GetRowCopy returns a copy of the Row on the given index, if row does not exist it will return nil. Copied row also gets copies of the cells. This is useful when you need to get rows attribute without triggering a recalculation.
func (*FlexBox) LockRowHeight ¶
LockRowHeight sets the fixed height value for all the rows this will disable vertical scaling
func (*FlexBox) Render ¶
Render initiates the recalculation of the rows dimensions(height) if the recalculate flag is on, and then it renders all the rows and combines them on the vertical axis
func (*FlexBox) StylePassing ¶
StylePassing set whether the style should be passed to the rows
type HorizontalFlexBox ¶
type HorizontalFlexBox struct {
// contains filtered or unexported fields
}
HorizontalFlexBox responsive box grid insipred by CSS flexbox
func NewHorizontal ¶
func NewHorizontal(width, height int) *HorizontalFlexBox
NewHorizontal initialize a HorizontalFlexBox object with defaults
func (*HorizontalFlexBox) AddColumns ¶
func (r *HorizontalFlexBox) AddColumns(columns []*Column) *HorizontalFlexBox
AddColumns appends additional columns to the FlexBox
func (*HorizontalFlexBox) ColumnsLen ¶
func (r *HorizontalFlexBox) ColumnsLen() int
ColumnsLen returns the len of the columns slice
func (*HorizontalFlexBox) ForceRecalculate ¶
func (r *HorizontalFlexBox) ForceRecalculate()
ForceRecalculate forces the recalculation for the box and all the columns
func (*HorizontalFlexBox) GetColumn ¶
func (r *HorizontalFlexBox) GetColumn(index int) *Column
GetColumn returns the FlexBoxColumn on the given index if it exists note: forces the recalculation if found
returns nil if not found
func (*HorizontalFlexBox) GetColumnCellCopy ¶
func (r *HorizontalFlexBox) GetColumnCellCopy(columnIndex, cellIndex int) *Cell
GetColumnCellCopy returns a copy of the FlexBoxCell on the given index x, within the given column with index y, if column or cell do not exist it will return nil. This is useful when you need to get columns attribute without triggering a recalculation.
func (*HorizontalFlexBox) GetColumnCopy ¶
func (r *HorizontalFlexBox) GetColumnCopy(index int) *Column
GetColumnCopy returns a copy of the FlexBoxColumn on the given index, if column does not exist it will return nil. Copied column also gets copies of the cells. This is useful when you need to get columns attribute without triggering a recalculation.
func (*HorizontalFlexBox) GetHeight ¶
func (r *HorizontalFlexBox) GetHeight() int
GetHeight yields current FlexBox height
func (*HorizontalFlexBox) GetWidth ¶
func (r *HorizontalFlexBox) GetWidth() int
GetWidth yields current FlexBox width
func (*HorizontalFlexBox) LockColumnWidth ¶
func (r *HorizontalFlexBox) LockColumnWidth(value int) *HorizontalFlexBox
LockColumnWidth sets the fixed width value for all the columns this will disable horizontal scaling
func (*HorizontalFlexBox) NewColumn ¶
func (r *HorizontalFlexBox) NewColumn() *Column
NewColumn initialize a new FlexBoxColumn with width inherited from the FlexBox
func (*HorizontalFlexBox) Render ¶
func (r *HorizontalFlexBox) Render() string
Render initiates the recalculation of the columns dimensions(width) if the recalculate flag is on, and then it renders all the columns and combines them on the horizontal axis
func (*HorizontalFlexBox) SetColumns ¶
func (r *HorizontalFlexBox) SetColumns(columns []*Column) *HorizontalFlexBox
SetColumns replace columns on the FlexBox
func (*HorizontalFlexBox) SetHeight ¶
func (r *HorizontalFlexBox) SetHeight(value int) *HorizontalFlexBox
SetHeight sets the FlexBox height
func (*HorizontalFlexBox) SetStyle ¶
func (r *HorizontalFlexBox) SetStyle(style lipgloss.Style) *HorizontalFlexBox
SetStyle replaces the style, it unsets width/height related keys
func (*HorizontalFlexBox) SetWidth ¶
func (r *HorizontalFlexBox) SetWidth(value int) *HorizontalFlexBox
SetWidth sets the FlexBox width
func (*HorizontalFlexBox) StylePassing ¶
func (r *HorizontalFlexBox) StylePassing(value bool) *HorizontalFlexBox
StylePassing set whether the style should be passed to the columns
func (*HorizontalFlexBox) UpdateColumn ¶
func (r *HorizontalFlexBox) UpdateColumn(index int, column *Column) *HorizontalFlexBox
UpdateColumn replaces the FlexBoxColumn on the given index
type Row ¶
type Row struct {
// contains filtered or unexported fields
}
Row is the container for the cells, this object has the least to do with the ratio of the construction as it takes all of the needed ratio information from the cell slice rows are stacked vertically
func (*Row) AddCells ¶
AddCells appends the cells to the row if the cell ID is not set it will default to the index of the cell
func (*Row) GetCell ¶
GetCell returns the FlexBoxCell on the given index if it exists note: forces the recalculation if found
returns nil if not found
func (*Row) GetCellCopy ¶
GetCellCopy returns a copy of the FlexBoxCell on the given index, if cell does not exist it will return nil. This is useful when you need to get cells attribute without triggering a recalculation.
func (*Row) GetCellWithID ¶
GetCellWithID returns the cell with the given ID if existing note: forces the recalculation if found
returns nil if not found
func (*Row) StylePassing ¶
StylePassing set whether the style should be passed to the cells
func (*Row) UpdateCellWithIndex ¶
UpdateCellWithIndex replaces the cell on the given index if it exists if its not existing no changes will apply