Skip to content
Snippets Groups Projects
Select Git revision
  • 02f03adbcfa6e4e1f48ce874e87f96e3a0decfae
  • master default protected
  • 1.31
  • 4.24.2
  • 4.24.1
  • 4.24.0
  • 4.23.6
  • 4.23.5
  • 4.23.4
  • 4.23.3
  • 4.23.2
  • 4.23.1
  • 4.23.0
  • 4.22.3
  • 4.22.2
  • 4.22.1
  • 4.22.0
  • 4.21.0
  • 4.20.1
  • 4.20.0
  • 4.19.0
  • 4.18.0
  • 4.17.0
23 results

tree-select.mjs

Blame
  • 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 {