TreeMenu

A TreeMenu control

Import
the javascript logo
import { TreeMenu } from "@schukai/monster/source/components/tree-menu/tree-menu.mjs";
Source
the git logo
Package
the npm logo
Since
1.0.0

HTML Structure

<monster-tree-menu></monster-tree-menu>

JavaScript Initialization

const element = document.createElement('monster-tree-menu');
document.body.appendChild(element);

Exported

TreeMenu

Derived from

CustomElement

Options

The Options listed in this section are defined directly within the class. This class is derived from several parent classes, including the CustomElement class. Therefore, it inherits Options from these parent classes. If you cannot find a specific Options in this list, we recommend consulting the documentation of the CustomElement.

Option
Type
Default
Description
templates
object
Template definitions
templates.main
string
undefined
Main template
datasource
datasource
data source
object
mapping
mapping.selector
string
*
Path to select the appropriate entries
mapping.labelTemplate
string
template with the label placeholders in the form ${name}, where name is the key
mapping.keyTemplate
string
undefined
template with the key placeholders in the form ${name}, where name is the key
mapping.rootReferences
string
0, null
the root references
mapping.idTemplate
string
id
template with the id placeholders in the form ${name}, where name is the key
mapping.parentKey
string
parent
the parent key
mapping.selection
string
undefined
the selection
mapping.filter
function
undefined
a filter function to filter the entries
object
classes
classes.control
string
monster-theme-primary-1
the class for the control element
classes.label
string
monster-theme-primary-1
the class for the label element
object
actions
actions.open
function
the action to open an entry (arguments, etnry, index, event)
actions.close
function
the action to close an entry (arguments, etnry, index, event)
actions.select
function
undefined
the action to select an entry (arguments, etnry, index, event)

  • since
  • deprecated

Properties and Attributes

The Properties and Attributes listed in this section are defined directly within the class. This class is derived from several parent classes, including the CustomElement class and ultimately from HTMLElement. Therefore, it inherits Properties and Attributes from these parent classes. If you cannot find a specific Properties and Attributes in this list, we recommend consulting the documentation of the CustomElement.

  • data-monster-options: Sets the configuration options for the collapse component when used as an HTML attribute.
  • data-monster-option-[name]: Sets the value of the configuration option [name] for the collapse component when used as an HTML attribute.

Methods

The methods listed in this section are defined directly within the class. This class is derived from several parent classes, including the CustomElement class and ultimately from HTMLElement. Therefore, it inherits methods from these parent classes. If you cannot find a specific method in this list, we recommend consulting the documentation of the CustomElement.

Constructor

constructor()

Static methods

[instanceSymbol]()
Returns
  • {symbol}
This method is called by the instanceof operator.
getCSSStyleSheet()
Returns
  • {CSSStyleSheet[]}
This method is called internal and should not be called directly.
getTag()
Returns
  • {string}
This method is called internal and should not be called directly.

Lifecycle methods

Lifecycle methods are called by the environment and are usually not intended to be called directly.

[assembleMethodSymbol]()
Returns
  • {void}

Other methods

selectEntry(value)
Parameters
  • value {string}: value

Events

The component emits the following events:

  • entries-imported

For more information on how to handle events, see the mdn documentation.

The current width of the area is too small to display the content correctly.