ui/table
Types
Keyboard messages for table component.
pub type Msg {
MoveDown
MoveUp
MoveRight
MoveLeft
MoveRowStart
MoveRowEnd
MoveTableFirst
MoveTableLast
SelectRow
SelectCell
ToggleRowSelection
ExtendSelectionDown
ExtendSelectionUp
EditCell
}
Constructors
-
MoveDownMove to next row (ArrowDown)
-
MoveUpMove to previous row (ArrowUp)
-
MoveRightMove to next cell (ArrowRight)
-
MoveLeftMove to previous cell (ArrowLeft)
-
MoveRowStartMove to first cell in row (Home)
-
MoveRowEndMove to last cell in row (End)
-
MoveTableFirstMove to first cell in table (Ctrl+Home)
-
MoveTableLastMove to last cell in table (Ctrl+End)
-
SelectRowSelect the currently focused row (Space)
-
SelectCellSelect the currently focused cell (Enter)
-
ToggleRowSelectionToggle row selection (Ctrl+Space)
-
ExtendSelectionDownExtend selection with Shift+Arrow (multi-select mode)
-
ExtendSelectionUpExtend selection with Shift+Arrow (multi-select mode)
-
EditCellEnter cell editing mode (F2 or Enter for editable cells)
pub type SelectionMode {
None
Single
Multiple
}
Constructors
-
None -
Single -
Multiple
Values
pub fn aria_activedescendant(
id: String,
) -> attribute.Attribute(a)
Attribute to indicate the currently active descendant.
pub fn aria_label(label: String) -> attribute.Attribute(a)
pub fn aria_sort(sort: String) -> attribute.Attribute(a)
Attribute to indicate sort direction.
pub fn keymap(
key_event: keyboard.KeyEvent,
multi_select: Bool,
editable: Bool,
) -> option.Option(Msg)
Keymap for table keyboard navigation. Follows WAI-ARIA grid pattern for tables:
- ArrowDown: Move to next row
- ArrowUp: Move to previous row
- ArrowRight: Move to next cell
- ArrowLeft: Move to previous cell
- Home: Move to first cell in row
- End: Move to last cell in row
- Ctrl+Home: Move to first cell in table
- Ctrl+End: Move to last cell in table
- Space: Select focused row
- Ctrl+Space: Toggle row selection
- Enter: Select cell or enter edit mode
- F2: Enter cell edit mode (for editable tables)
pub fn selection_mode(m: SelectionMode) -> attribute.Attribute(a)
pub fn size(s: Size) -> attribute.Attribute(a)
pub fn table(
attributes: List(attribute.Attribute(a)),
children: List(element.Element(a)),
) -> element.Element(a)
pub fn table_body(
attributes: List(attribute.Attribute(a)),
children: List(element.Element(a)),
) -> element.Element(a)
pub fn table_caption(
attributes: List(attribute.Attribute(a)),
children: List(element.Element(a)),
) -> element.Element(a)
pub fn table_cell(
attributes: List(attribute.Attribute(a)),
children: List(element.Element(a)),
) -> element.Element(a)
pub fn table_cell_element_id(row: Int, col: Int) -> String
Get the element ID for a table cell at the given row and column.
pub fn table_column_header(
attributes: List(attribute.Attribute(a)),
children: List(element.Element(a)),
) -> element.Element(a)
pub fn table_column_header_element_id(col: Int) -> String
Get the element ID for a table column header at the given index.
pub fn table_head_cell(
attributes: List(attribute.Attribute(a)),
children: List(element.Element(a)),
) -> element.Element(a)
pub fn table_header(
attributes: List(attribute.Attribute(a)),
children: List(element.Element(a)),
) -> element.Element(a)
pub fn table_header_row(
attributes: List(attribute.Attribute(a)),
children: List(element.Element(a)),
) -> element.Element(a)
pub fn table_row(
attributes: List(attribute.Attribute(a)),
children: List(element.Element(a)),
) -> element.Element(a)
pub fn table_row_element_id(row: Int) -> String
Get the element ID for a table row at the given index.
pub fn variant(v: Variant) -> attribute.Attribute(a)