Something went wrong on our end
Select Git revision
tree-select.mjs
-
Volker Schukai authoredVolker Schukai authored
tree-select.mjs 13.46 KiB
/**
* Copyright © schukai GmbH and all contributing authors, {{copyRightYear}}. All rights reserved.
* Node module: @schukai/monster
*
* This source code is licensed under the GNU Affero General Public License version 3 (AGPLv3).
* The full text of the license can be found at: https://www.gnu.org/licenses/agpl-3.0.en.html
*
* For those who do not wish to adhere to the AGPLv3, a commercial license is available.
* Acquiring a commercial license allows you to use this software without complying with the AGPLv3 terms.
* For more information about purchasing a commercial license, please contact schukai GmbH.
*
* SPDX-License-Identifier: AGPL-3.0
*/
import { buildTree } from "../../data/buildtree.mjs";
import { findClosestByAttribute } from "../../dom/attributes.mjs";
import {
ATTRIBUTE_ROLE,
ATTRIBUTE_UPDATER_INSERT_REFERENCE,
} from "../../dom/constants.mjs";
import { instanceSymbol } from "../../constants.mjs";
import {
assembleMethodSymbol,
registerCustomElement,
} from "../../dom/customelement.mjs";
import {
findTargetElementFromEvent,
fireCustomEvent,
fireEvent,
} from "../../dom/events.mjs";
import { Formatter } from "../../text/formatter.mjs";
import { isString } from "../../types/is.mjs";
import { Node } from "../../types/node.mjs";
import { NodeRecursiveIterator } from "../../types/noderecursiveiterator.mjs";
import { validateInstance } from "../../types/validate.mjs";
import { ATTRIBUTE_FORM_URL, ATTRIBUTE_INTEND } from "./constants.mjs";
import { Select } from "./select.mjs";
import { SelectStyleSheet } from "./stylesheet/select.mjs";
import { TreeSelectStyleSheet } from "./stylesheet/tree-select.mjs";
export { TreeSelect, formatHierarchicalSelection };
/**
* @private
* @type {symbol}
*/
const internalNodesSymbol = Symbol("internalNodes");
/**
* @private
* @type {symbol}
*/
const keyEventHandler = Symbol("keyEventHandler");
/**
* A tree select control is a select control that can be used to select a value from a tree structure.
*
* @fragments /fragments/components/form/tree-select
*
* @example /examples/components/form/tree-select
*
* @since 1.9.0
* @copyright schukai GmbH
* @summary A beautiful tree select control with a lot of options
* @fires monster-options-set
* @fires monster-selected
* @fires monster-change
* @fires monster-changed
*/
class TreeSelect extends Select {