MMOframework
Pourquoi l'IA Playground Bibliothèques Documentation Rechercher Agence
FR EN
Index

mmo-tree

1 symbole · générée le 27 Oct 2026

element

mmo-tree

mmo-tree.jhs:1

Tree element to display a tree of items

<mmo-tree multiple value></mmo-tree>
Étend
CustomShadowElement
Config: { {label}: { icon: {string}, color: {string} -- a name of COLORS or any css colour: tints the icon, or the label without one type: {string} -- the kind of node: as soon as one has a type, a button per type shows above the tree to hide or show them (`hiddenTypes`), named after the title of its first node value: {string}, title: {string} children: { {label}: ... } } or {label}: {value} }

Index

multipleif true, the tree is multiple
valuethe value of the tree
placeholderthe placeholder of the tree
COLORS staticthe colours a node can be given by name: the theme's, so they follow it into the dark
ViewDefault static readonly accessor
config accessorGet the config of the tree
multiple accessorGet the multiple of the tree
value accessorGet the value of the tree
hiddenTypes accessorHide the nodes of these types, show the others.
_hiddenTypesKey readonly accessorwhere 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()
.searchingadd a badge to the nodes to show the group id
.type-hiddenset on the nodes whose type is filtered out: a leaf is hidden, a branch keeps its children

Attributs3

placeholder

mmo-tree.jhs

the placeholder of the tree

placeholder

Constantes1

COLORS

staticmmo-tree.jhs:39

the colours a node can be given by name: the theme's, so they follow it into the dark

static COLORS = { gray: 'var(--mmo-color-text-3)', blue: 'var(--mmo-color-viz-1)', teal: 'var(--mmo-color-viz-2)', green: 'var(--mmo-color-ok)', yellow: 'var(--mmo-color-warn)', orange: 'var(--mmo-color-viz-4)', red: 'var(--mmo-color-bad)', pink: '#D6409F', purple: 'var(--mmo-color-viz-3)' };

Propriétés7

config

accessormmo-tree.jhs:70

Get the config of the tree

get config() set config(value)
Type
object

multiple

accessormmo-tree.jhs:92

Get the multiple of the tree

get multiple() set multiple(value)
Type
boolean

value

accessormmo-tree.jhs:111

Get the value of the tree

get value() set value(value)
Type
array

hiddenTypes

accessormmo-tree.jhs:273

Hide the nodes of these types, show the others. Kept for the next visit of the page, per tree.

get hiddenTypes() set hiddenTypes(value)
Type
string[]

_hiddenTypesKey

readonlyaccessormmo-tree.jhs:347

where the hidden types are kept: per page and per tree

get _hiddenTypesKey()

Méthodes15

toggleSelectAll()

mmo-tree.jhs:140

Toggle the select all of the select

toggleSelectAll()

_addItemChildren(children, root)

mmo-tree.jhs:165

Add the children of the item

_addItemChildren(children, root)
childrenobject- The children of the item
rootHTMLLIElement- The root of the item

getItemNode(value)

mmo-tree.jhs:182

Get the node of the item

getItemNode(value)
valuestring- The value of the item
retourneHTMLLIElementThe node of the item

addItem(item, root)

mmo-tree.jhs:192

Add the item to the tree

addItem(item, root = null)
itemobject- The item to add
root = nullHTMLLIElement- The root of the item
retourneHTMLLIElementThe node of the item

updateItem(value, item)

mmo-tree.jhs:228

Change how an item already in the tree shows: its label, icon, colour or title -- its place and its children stay

updateItem(value, item)
valuestring- The value of the item
itemobject- {label, icon, color, title}: the ones given replace the item's
retourne?HTMLLIElementThe node of the item, null when the tree has none with this value

_itemLabel(item)

mmo-tree.jhs:255

The 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

_itemLabel(item)
itemobject- {label, icon, color}
retourneArray<Node | string>

toggleType(type, visible)

mmo-tree.jhs:298

Show or hide the nodes of a type

toggleType(type, visible = null)
typestring
visible = null?boolean- toggled when not given

_setItemType(node, item)

mmo-tree.jhs:310

Give a node its type, and the filter a button for it when it is a new one

_setItemType(node, item)
nodeHTMLLIElement
itemobject- {type, title, icon, color}

_renderTypes()

mmo-tree.jhs:328

Draw the filter's buttons: one per type, then one to show them all. None for a tree without types.

_renderTypes()

clickItem(event)

mmo-tree.jhs:368

Click the item

clickItem(event)
eventMouseEvent- The event

toggleDetail(event)

mmo-tree.jhs:397

Toggle the detail of the item

toggleDetail(event)
eventMouseEvent- The event

Points d'accroche CSS2

.searching

mmo-tree.jhs

add a badge to the nodes to show the group id

.searching

.type-hidden

mmo-tree.jhs

set on the nodes whose type is filtered out: a leaf is hidden, a branch keeps its children

.type-hidden