<garbee-tree>

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

NameDescriptionTypeDefault
aria-multiselectableEnable multiple selection by setting the value to `true`.'true' | 'false'

Static Properties

NameAttributeDescriptionTypeDefault
debugModeDetermines if extra logging and performance marks are enabled while operating.booleanfalse

Properties

NameAttributeDescriptionTypeDefault
keyFunctionOverride the key function used by the repeater when rendering tree item elements.KeyFn<TreeItem<TreeItemType>>
renderItemThe function passed to lit-virtualizer that is used to render each individual item.RenderItemFunction<TreeItem<TreeItemType>>
contentProvide 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

NameDescription
garbee-tree-item-selection-changedWhen 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

NameAttributeDescriptionTypeDefault
internalsThe internals of the element for setting base aria requirements.ElementInternals
dataRetrieve the data that this tree item represents.DataType | undefined
treeItemThe 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

NameDescriptionType
selectedItemsThe currently selected items of the tree.Array<TreeItem>