mmo-tree
1 symbole · générée le 27 Oct 2026
mmo-tree
mmo-tree.jhs:1Tree element to display a tree of items
- Étend
- CustomShadowElement
Index
| multiple | if true, the tree is multiple | |
| value | the value of the tree | |
| placeholder | the placeholder of the tree | |
| COLORS static | the colours a node can be given by name: the theme's, so they follow it into the dark | |
| ViewDefault static readonly accessor | ||
| config accessor | Get the config of the tree | |
| multiple accessor | Get the multiple of the tree | |
| value accessor | Get the value of the tree | |
| hiddenTypes accessor | Hide the nodes of these types, show the others. | |
| _hiddenTypesKey readonly accessor | where the hidden types are kept: per page and per tree | |
| search accessor | ||
| init() | ||
| toggleSelectAll() | Toggle the select all of the select | |
| _addItemChildren(children, root) | Add the children of the item | |
| getItemNode(value) | Get the node of the item | |
| addItem(item, root) | Add the item to the tree | |
| updateItem(value, item) | Change how an item already in the tree shows: its label, icon, colour or title -- its place and its children stay | |
| _itemLabel(item) | The content of an item's row: its icon when it has one, then its label. | |
| toggleType(type, visible) | Show or hide the nodes of a type | |
| _setItemType(node, item) | Give a node its type, and the filter a button for it when it is a new one | |
| _renderTypes() | Draw the filter's buttons: one per type, then one to show them all. | |
| _loadHiddenTypes() | ||
| _saveHiddenTypes() | ||
| clickItem(event) | Click the item | |
| toggleDetail(event) | Toggle the detail of the item | |
| clearSearch() | ||
| .searching | add a badge to the nodes to show the group id | |
| .type-hidden | set on the nodes whose type is filtered out: a leaf is hidden, a branch keeps its children |
Attributs3
multiple
mmo-tree.jhsif true, the tree is multiple
multiple
value
mmo-tree.jhsthe value of the tree
value
placeholder
mmo-tree.jhsthe placeholder of the tree
placeholder
Constantes1
COLORS
staticmmo-tree.jhs:39the colours a node can be given by name: the theme's, so they follow it into the dark
Propriétés7
ViewDefault
staticreadonlyaccessormmo-tree.jhs:51config
accessormmo-tree.jhs:70Get the config of the tree
- Type
object
multiple
accessormmo-tree.jhs:92Get the multiple of the tree
- Type
boolean
value
accessormmo-tree.jhs:111Get the value of the tree
- Type
array
search
accessormmo-tree.jhs:424- Type
string
Méthodes15
init()
mmo-tree.jhs:58toggleSelectAll()
mmo-tree.jhs:140Toggle the select all of the select
_addItemChildren(children, root)
mmo-tree.jhs:165Add the children of the item
| children | object | - The children of the item |
| root | HTMLLIElement | - The root of the item |
getItemNode(value)
mmo-tree.jhs:182Get the node of the item
| value | string | - The value of the item |
| retourne | HTMLLIElement | The node of the item |
addItem(item, root)
mmo-tree.jhs:192Add the item to the tree
| item | object | - The item to add |
| root = null | HTMLLIElement | - The root of the item |
| retourne | HTMLLIElement | The node of the item |
updateItem(value, item)
mmo-tree.jhs:228Change how an item already in the tree shows: its label, icon, colour or title -- its place and its children stay
| value | string | - The value of the item |
| item | object | - {label, icon, color, title}: the ones given replace the item's |
| retourne | ?HTMLLIElement | The node of the item, null when the tree has none with this value |
_itemLabel(item)
mmo-tree.jhs:255The content of an item's row: its icon when it has one, then its label. The colour goes to the icon, or to the label without one -- set on that element only, so a branch never passes it to its children
| item | object | - {label, icon, color} |
| retourne | Array<Node | string> |
toggleType(type, visible)
mmo-tree.jhs:298Show or hide the nodes of a type
| type | string | |
| visible = null | ?boolean | - toggled when not given |
_setItemType(node, item)
mmo-tree.jhs:310Give a node its type, and the filter a button for it when it is a new one
| node | HTMLLIElement | |
| item | object | - {type, title, icon, color} |
_renderTypes()
mmo-tree.jhs:328Draw the filter's buttons: one per type, then one to show them all. None for a tree without types.
clickItem(event)
mmo-tree.jhs:368Click the item
| event | MouseEvent | - The event |
toggleDetail(event)
mmo-tree.jhs:397Toggle the detail of the item
| event | MouseEvent | - The event |
clearSearch()
mmo-tree.jhs:408Points d'accroche CSS2
.searching
mmo-tree.jhsadd a badge to the nodes to show the group id
.searching