david-swift 1c50b3b923 Make lists dynamic
Make one @State always reference the same value
This is important when views with closures appear after the first render
2024-01-01 16:08:17 +01:00

70 lines
1.2 KiB
Markdown

**STRUCT**
# `List`
A list box widget.
## Properties
### `elements`
The elements.
### `content`
The content.
### `selection`
The identifier of the selected element.
### `elementsID`
The identifier of the elements storage.
## Methods
### `init(_:selection:content:)`
Initialize `List`.
- Parameters:
- elements: The elements.
- selection: The identifier of the selected element.
- content: The view for an element.
### `update(_:modifiers:)`
Update a view storage.
- Parameters:
- storage: The view storage.
- modifiers: Modify views before being updated.
### `container(modifiers:)`
Get a view storage.
- Parameter modifiers: Modify views before being updated.
- Returns: The view storage.
### `updateList(box:content:modifiers:)`
Update the list's content and selection.
- Parameters:
- box: The list box.
- content: The content's view storage.
- modifiers: The view modifiers.
### `updateSelection(box:)`
Update the list's selection.
- Parameter box: The list box.
### `getWidget(element:modifiers:)`
Get the view storage of an element.
- Parameters:
- element: The element.
- modifiers: The modifiers.
- Returns: The view storage.
### `sidebarStyle()`
Add the "navigation-sidebar" style class.