iink-ts - v5.0.0
    Preparing search index...

    Class IIAbstractMenu<TConfig>Abstract

    Every member is protected or public, never private: menus are replaced through options.override.menu. A zone is built on its first item, so a menu shows no empty row nor an empty dropdown.

    Type Parameters

    Hierarchy (View Summary)

    Index
    • get openTowards(): TMenuDirection | undefined

      Undefined for a menu outside the layout, whose items keep their own directions

      Returns TMenuDirection | undefined

    • get slot(): | "top-left"
      | "top-center"
      | "top-right"
      | "middle-left"
      | "middle-right"
      | "bottom-left"
      | "bottom-center"
      | "bottom-right"
      | undefined

      The slot the layout put this menu in

      Returns
          | "top-left"
          | "top-center"
          | "top-right"
          | "middle-left"
          | "middle-right"
          | "bottom-left"
          | "bottom-center"
          | "bottom-right"
          | undefined

    • Keeps item with the menu's items and inserts its element: next to before/after when that item is rendered, else at the end of its zone; in place of the item it replaces with replace. A key already taken is refused (logged) unless replace is set.

      Parameters

      Returns void

    • The class laying the bar out along orientation

      Returns string

    • Where a dropdown opening from the bar goes: towards openTowards, growing away from the slot's side

      Returns TMenuPosition | undefined

    • Where a sub-menu opening from a dropdown's column goes: sideways, towards the inside of the canvas

      Returns TMenuPosition | undefined

    • Builds a dropdown: trigger toggles content, a pointerdown anywhere outside closes it.

      Parameters

      • trigger: HTMLButtonElement
      • content: HTMLElement
      • position: TMenuPosition

      Returns { content: HTMLDivElement; element: HTMLDivElement }

      the dropdown element to insert, and the element holding content

    • Builds the container of zone and inserts it in wrapper

      Parameters

      Returns HTMLElement

    • The wrapper items go to. A new wrapper is a new render: the zones and items of the previous one belong to the old wrapper, so they are forgotten (not destroyed: they stay where that render put them).

      Returns HTMLElement

    • Returns void

    • The container of zone, built on first use

      Parameters

      Returns HTMLElement

    • Returns void

    • Inserts an item's element in its zone; a menu overrides it to keep its own elements in place

      Parameters

      Returns void

    • Inserts element before or after the item options names; false when there is none to name or render

      Parameters

      Returns boolean

    • Parameters

      • layer: HTMLElement

      Returns void

    • Adds the items registered through IIMenuManager.addItem, after the menu's own: called once it rendered. A factory that throws is logged and skipped, the other items still render.

      Parameters

      Returns void

    • Alone in its slot, the menu just turns invisible and keeps its room. Sharing it, its host folds away (animated in CSS) so the other occupants close the gap instead of leaving a hole.

      Parameters

      • hidden: boolean

      Returns void

    • Whether another occupant shares this menu's slot

      Returns boolean

    • Returns void

    • A sub-menu's config entry: true enables it with its defaults, an object configures it

      Type Parameters

      • T

      Parameters

      • config: boolean | T

      Returns T | undefined

    • Returns void

    config: TConfig
    defaultZone: TMenuZone

    Where an item goes when addItem names no zone

    documentPointerdownHandler?: (e: PointerEvent) => void

    Closes the dropdown on a pointerdown outside it; set by createDropdown

    id: string
    items: Map<string, BaseMenuItem<HTMLElement>> = ...

    The rendered items, by key: updated and destroyed with the menu

    layoutName?: string

    The name the layout places this menu by (configuration.layout); none for a menu outside the layout

    logger: Logger = ...
    wrapper?: HTMLElement
    zones: Partial<Record<TMenuZone, HTMLElement>> = {}

    The containers of the zones built so far

    zonesWrapper?: HTMLElement

    The wrapper zones and items belong to