diff --git a/source/components/tree-menu/tree-menu.mjs b/source/components/tree-menu/tree-menu.mjs index 9c4f0f9b91ab0e8074d2f9053d71cf5222c1e79e..cd6942823066838cfb76eac3ed4cd410ffc96e45 100644 --- a/source/components/tree-menu/tree-menu.mjs +++ b/source/components/tree-menu/tree-menu.mjs @@ -25,10 +25,9 @@ import { assembleMethodSymbol, CustomElement, getSlottedElements, - initMethodSymbol, registerCustomElement, } from "../../dom/customelement.mjs"; -import { findTargetElementFromEvent } from "../../dom/events.mjs"; +import {findTargetElementFromEvent, fireEvent} from "../../dom/events.mjs"; import { findElementWithSelectorUpwards } from "../../dom/util.mjs"; import { Formatter } from "../../text/formatter.mjs"; import { isFunction, isString } from "../../types/is.mjs"; @@ -81,7 +80,7 @@ const firstRunDoneSymbol = Symbol("firstRunDone"); * * @since 1.0.0 * @summary A TreeMenu control - * @fires monster-fetched + * @fires entries-imported */ class TreeMenu extends CustomElement { /** @@ -120,13 +119,13 @@ class TreeMenu extends CustomElement { * @property {string} templates.main Main template * @property {Datasource} datasource data source * @property {Object} mapping - * @property {String} mapping.selector=* Path to select the appropriate entries - * @property {String} mapping.labelTemplate="" template with the label placeholders in the form ${name}, where name is the key - * @property {String} mapping.keyTemplate="" template with the key placeholders in the form ${name}, where name is the key - * @property {String} mapping.rootReferences=['0', undefined, null] - * @property {String} mapping.idTemplate=id - * @property {String} mapping.parentKey=parent - * @property {String} mapping.selection + * @property {String} mapping.selector Path to select the appropriate entries + * @property {String} mapping.labelTemplate template with the label placeholders in the form ${name}, where name is the key + * @property {String} mapping.keyTemplate template with the key placeholders in the form ${name}, where name is the key + * @property {String} mapping.rootReferences the root references + * @property {String} mapping.idTemplate template with the id placeholders in the form ${name}, where name is the key + * @property {String} mapping.parentKey the parent key + * @property {String} mapping.selection the selection */ get defaults() { return Object.assign({}, super.defaults, { @@ -513,6 +512,7 @@ function importEntries() { queueMicrotask(() => { this.setOption("entries", options); + fireEvent(this, "entries-imported"); }); return this;