This commit is contained in:
NoryiE
2025-02-24 22:54:38 +00:00
parent c3f9dfa735
commit 47fef51a0c
21 changed files with 188 additions and 1114 deletions

View File

@@ -20,59 +20,17 @@ row selection, and scrolling capabilities.
|Method|Returns|Description|
|---|---|---|
|[Table.new](#Table.new)|Table|Creates a new Table instance
|[Table:sortData](#Table:sortData)|Table|Sorts the table data by the specified column
## Protected Functions
|Method|Returns|Description|
|---|---|---|
|[Table:init](#Table:init)|Table|Initializes the Table instance
|[Table:mouse_click](#Table:mouse_click)|boolean|Handles header clicks for sorting and row selection
|[Table:mouse_scroll](#Table:mouse_scroll)|boolean|Handles scrolling through the table data
|[Table:render](#Table:render)|-|Renders the table with headers, data and scrollbar
|[Table:sortData](#Table:sortData)|Table|Sorts the table data by the specified column
## Table.new()
Creates a new Table instance
### Returns
* `Table` `self` The newly created Table instance
### Usage
```lua
local table = Table.new()
```
## Table:init(props, basalt)
Initializes the Table instance
### Parameters
* `props` `table` The properties to initialize the element with
* `basalt` `table` The basalt instance
### Returns
* `Table` `self` The initialized instance
## Table:mouse_click(button, x, y)
Handles mouse click events
### Parameters
* `button` `number` The button that was clicked
* `x` `number` The x position of the click
* `y` `number` The y position of the click
### Returns
* `boolean` `handled` Whether the event was handled
## Table:mouse_scroll(direction, x, y)
Handles mouse scroll events
### Parameters
* `direction` `number` The scroll direction (-1 up, 1 down)
* `x` `number` The x position of the scroll
* `y` `number` The y position of the scroll
### Returns
* `boolean` `handled` Whether the event was handled
## Table:render()
Renders the table
## Table:sortData(columnIndex)
Sorts the table data by column