@termun/core - v0.0.0
    Preparing search index...

    Class MenuField

    Hierarchy (View Summary)

    Index

    Constructors

    Methods

    • Returns the underlying choice menu if configured, or undefined.

      Returns MenuChoice | undefined

    • Returns the underlying input menu if configured, or undefined.

      Returns MenuInput | undefined

    • Returns true when a choice menu has been configured.

      Returns boolean

    • Returns true when an input menu has been configured.

      Returns boolean

    • Returns an option by name from the choice menu, or undefined if not found.

      Parameters

      • name: string

        Option value/name to look up.

      Returns MenuFieldOption | undefined

    • Returns the option list from the choice menu, optionally sorted for display.

      Parameters

      • sorted: boolean = false

        When true, applies the display-order sorting algorithm.

      Returns MenuFieldOption[]

    • Returns the currently selected option names from the choice menu.

      Returns string[]

    • Returns the global sidebar choices rendered alongside the menu.

      Returns (Separator | Choice)[]

    • Replaces the global sidebar choices.

      Parameters

      • choices: (Separator | Choice)[]

        Array of Choice or Separator items.

      Returns this

    • Renders and runs the field menu (choice + optional input).

      Parameters

      • Optionallanguage: string

        Optional language override for label translation.

      Returns Promise<string | string[]>

    • Returns the menu's unique name.

      Returns string

    • Returns the menu type: "choice", "input", "field", or "editor".

      Returns "input" | "field" | "choice" | "editor"

    • Returns the plugin namespace this menu belongs to, or undefined for the default plugin.

      Returns string | undefined

    • Sets the plugin namespace for this menu.

      Parameters

      • plugin: string | undefined

        Plugin name string.

      Returns this

    • Returns the display order index, or undefined if not set.

      Returns number | undefined

    • Sets the display order index.

      Parameters

      • index: number | undefined

        Numeric sort position.

      Returns this

    • Returns all registered parent names as a flat array.

      Returns string[]

    • Returns the parent entry matching the given name, or undefined.

      Parameters

      • name: string

        Parent name to look up.

      Returns string | undefined

    • Registers a parent menu name.

      Parameters

      • name: string

        Parent name to add.

      Returns this

    • Returns true when this menu is accessible from every context.

      Returns boolean

    • Returns true when this menu is the anchor point of a wizard/flow. Global actions that target this menu will be hidden in this menu and in all its descendants, resolved through the regular parents chain.

      Returns boolean

    • Sets the styles for this menu from an instance or a plain JSON object.

      Parameters

      • styles: MenuStyles

        MenuStyles instance or compatible JSON.

      Returns this

    • Sets the styles for this menu from an instance or a plain JSON object.

      Parameters

      Returns this

    • Sets the labels for this menu from an instance or a plain JSON object.

      Parameters

      • labels: MenuLabels

        MenuLabels instance or compatible JSON.

      Returns this

    • Sets the labels for this menu from an instance or a plain JSON object.

      Parameters

      Returns this

    Properties

    type: "input" | "field" | "choice" | "editor" = "field"
    choice?: MenuChoice
    input?: MenuInput
    globalChoices: (Separator | Choice)[] = []
    name: string
    plugin?: string
    parents: Record<string, Exclude<MenuJson["parents"], undefined>[number]> = {}
    index: number | undefined
    global: boolean
    anchorGlobal: boolean
    styles: MenuStyles
    labels: MenuLabels