@samatawy/diagrams
    Preparing search index...

    Class TopMenu

    Lightweight context menu that renders at fixed viewport coordinates.

    Hierarchy (View Summary)

    Index

    Constructors

    • Creates a TopMenu. Styles are injected once.

      Parameters

      • host: HTMLElement

        Element to append the menu into. Must establish a stacking context so CSS variables are inherited.

      • target: unknown
      • config: TopMenuConfig = {}

        Optional class-name overrides.

      Returns TopMenu

    Properties

    host: HTMLElement
    target: unknown
    menuElement: HTMLElement | null = null
    topLevel: (TopMenuItem | DropDownMenu)[] = []

    The top-level menu items, including both dropdowns and individual items.

    dropDownMenus: DropDownMenu[] = []

    All dropdown menus, extracted from the top-level items.

    selectedDropDown?: DropDownMenu

    The currently selected dropdown menu, if any.

    activeDropDown?: DropDownMenu

    The currently opened dropdown menu, if any.

    selectedMenuItem?: TopMenuItem | DropDownMenu

    The currently selected menu item, if any. This may be a top-level dropdown or a menu item inside a dropdown.

    Accessors

    Methods

    • Appends a visual separator line.

      Parameters

      • Optionalparent: HTMLElement

      Returns void