Documentation
¶
Overview ¶
Copyright Project Harbor Authors
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
RowLabels []string
ColLabels []string
Data [][]CellStatus
Disabled map[int]map[int]bool
ColumnWidths []int
Styles *Styles
Icons *Icons
}
Config holds parameters for creating a new TableGrid
type Icons ¶
type Icons struct {
Selected string // Icon for selected cells
Unselected string // Icon for unselected cells
Empty string // Icon for disabled cells
}
Icons defines how cells are displayed
type Styles ¶
type Styles struct {
Selected lipgloss.Style
Unselected lipgloss.Style
Disabled lipgloss.Style
Header lipgloss.Style
Cursor string // Cursor indicator
}
Styles contains customizable styles for the table grid
type TableGrid ¶
type TableGrid struct {
Table table.Model
Data [][]CellStatus // 2D grid of cell states (true = selected, false = not selected)
RowLabels []string // Labels for rows
ColLabels []string // Labels for columns
Disabled map[int]map[int]bool // Which cells are disabled
SelectedCol int // Currently selected column
Styles Styles // Custom styles
Icons Icons // Custom icons
}
TableGrid is a generic interactive grid for toggling options
func (*TableGrid) GetData ¶
func (m *TableGrid) GetData() [][]CellStatus
GetData returns the current selection state
func (*TableGrid) GetSelectedItems ¶
GetSelectedItems returns the coordinates of all selected cells