API
Elements
TreeElement
<garbee-tree>
The TreeElement is what renders and manages the tree
itself. Roving focus of tree items as well as all
interaction with the elements. The individual rendering
is delegated to a provided renderItem method
which renders an element that extends the TreeItemElement
class.
Attributes
| Name | Description | Type | Default |
| aria-multiselectable | Enable multiple selection by setting the value to `true`. | 'true' | 'false' | |
Static Properties
| Name | Attribute | Description | Type | Default |
| debugMode | | Determines if extra logging and performance marks
are enabled while operating. | boolean | false |
Properties
| Name | Attribute | Description | Type | Default |
| keyFunction | | Override the key function used by the repeater when
rendering tree item elements. | KeyFn<TreeItem<TreeItemType>> | |
| renderItem | | The function passed to lit-virtualizer
that is used to render each individual item. | RenderItemFunction<TreeItem<TreeItemType>> | |
| content | | Provide the data that the tree represents. Setting this
will override any currently set data. It is a
replace operation, not append. | Array<TreeItem<TreeItemType>> | |
Events
| Name | Description |
| garbee-tree-item-selection-changed | When item selection changes happen. |
TreeItemElement
<undefined>
An abstract element class that represents an individual
item within the tree. This is the class developers
should extend in order to create an element to show
the item to a user.
This maintains all needed exposure to assistive
technology as the TreeItem's signals change.
Properties
| Name | Attribute | Description | Type | Default |
| internals | | The internals of the element for setting base aria
requirements. | ElementInternals | |
| data | | Retrieve the data that this tree item represents. | DataType | undefined | |
| treeItem | | The TreeItem that this element represents when
rendered. | TreeItem<DataType> | undefined | |
Events
ItemSelectionEvent
Fires when the item selection changes. This can be
since either an item was selected or deselected.
Properties
| Name | Description | Type |
| selectedItems | The currently selected items of the tree. | Array<TreeItem> |