Supports various kinds of Menus. Part of this class is a menu description to be used by all kinds of applications.

Requires the following integrations:

  • Desktop main menu bar
  • Tablet main menu
  • Phone side menu
  • Insert context menu (of Editor)
  • View context menu

Implements

Constructors

Properties

localizer: ILocalizer = null

Accessors

  • get insertContextMenuData(): {
        children: (
            | {
                children: {
                    iconCls: string;
                    id: string;
                    locate: string;
                }[];
                iconCls: string;
                id: string;
                locate: string;
                separator?: undefined;
                text?: undefined;
            }
            | {
                children?: undefined;
                iconCls: string;
                id: string;
                locate: string;
                separator?: undefined;
                text?: undefined;
            }
            | {
                children?: undefined;
                iconCls?: undefined;
                id?: undefined;
                locate?: undefined;
                separator: boolean;
                text?: undefined;
            }
            | {
                children?: undefined;
                iconCls: string;
                id: string;
                locate?: undefined;
                separator?: undefined;
                text: string;
            })[];
        iconCls: string;
        id: string;
        locate: string;
    }
  • Returns {
        children: (
            | {
                children: {
                    iconCls: string;
                    id: string;
                    locate: string;
                }[];
                iconCls: string;
                id: string;
                locate: string;
                separator?: undefined;
                text?: undefined;
            }
            | {
                children?: undefined;
                iconCls: string;
                id: string;
                locate: string;
                separator?: undefined;
                text?: undefined;
            }
            | {
                children?: undefined;
                iconCls?: undefined;
                id?: undefined;
                locate?: undefined;
                separator: boolean;
                text?: undefined;
            }
            | {
                children?: undefined;
                iconCls: string;
                id: string;
                locate?: undefined;
                separator?: undefined;
                text: string;
            })[];
        iconCls: string;
        id: string;
        locate: string;
    }

    • children: (
          | {
              children: {
                  iconCls: string;
                  id: string;
                  locate: string;
              }[];
              iconCls: string;
              id: string;
              locate: string;
              separator?: undefined;
              text?: undefined;
          }
          | {
              children?: undefined;
              iconCls: string;
              id: string;
              locate: string;
              separator?: undefined;
              text?: undefined;
          }
          | {
              children?: undefined;
              iconCls?: undefined;
              id?: undefined;
              locate?: undefined;
              separator: boolean;
              text?: undefined;
          }
          | {
              children?: undefined;
              iconCls: string;
              id: string;
              locate?: undefined;
              separator?: undefined;
              text: string;
          })[]
    • iconCls: string
    • id: string
    • locate: string
  • get sidemenuData(): any
  • Given a standard piece of menu data, transforms it to side menu format and returns it.

    Returns any

    menu tree transformed to side menu format

  • get tabletMenu(): string
  • Transforms the menu data into a ready to use html string. TODO: Too complex, could be like mainMenu. To be used ?

    Returns string

    the ready to use html

  • get treeMenuFolderData(): {
        children: {
            custom: string;
            iconCls: string;
            id: string;
            locate: string;
            tooltip: string;
        }[];
        id: string;
    }
  • Returns {
        children: {
            custom: string;
            iconCls: string;
            id: string;
            locate: string;
            tooltip: string;
        }[];
        id: string;
    }

    • children: {
          custom: string;
          iconCls: string;
          id: string;
          locate: string;
          tooltip: string;
      }[]
    • id: string
  • get treeMenuLeaf(): string
  • TODO: the addClass API seems to have no effect, but in viewMenu it has one. What is going on? In the mean time I set class 'easyui-menu' for all menus but not simple menu items.

    Returns string

  • get treeMenuLeafData(): {
        children: ({
            custom: string;
            iconCls: string;
            id: string;
            locate: string;
            separator?: undefined;
            tooltip: string;
        } | {
            custom?: undefined;
            iconCls?: undefined;
            id?: undefined;
            locate?: undefined;
            separator: boolean;
            tooltip?: undefined;
        })[];
        id: string;
    }
  • Returns {
        children: ({
            custom: string;
            iconCls: string;
            id: string;
            locate: string;
            separator?: undefined;
            tooltip: string;
        } | {
            custom?: undefined;
            iconCls?: undefined;
            id?: undefined;
            locate?: undefined;
            separator: boolean;
            tooltip?: undefined;
        })[];
        id: string;
    }

    • children: ({
          custom: string;
          iconCls: string;
          id: string;
          locate: string;
          separator?: undefined;
          tooltip: string;
      } | {
          custom?: undefined;
          iconCls?: undefined;
          id?: undefined;
          locate?: undefined;
          separator: boolean;
          tooltip?: undefined;
      })[]
    • id: string
  • get viewContextMenuData(): {
        children: ({
            iconCls: string;
            id: string;
            locate: string;
            separator?: undefined;
        } | {
            iconCls?: undefined;
            id?: undefined;
            locate?: undefined;
            separator: boolean;
        })[];
        iconCls: string;
        id: string;
        locate: string;
    }
  • Returns {
        children: ({
            iconCls: string;
            id: string;
            locate: string;
            separator?: undefined;
        } | {
            iconCls?: undefined;
            id?: undefined;
            locate?: undefined;
            separator: boolean;
        })[];
        iconCls: string;
        id: string;
        locate: string;
    }

    • children: ({
          iconCls: string;
          id: string;
          locate: string;
          separator?: undefined;
      } | {
          iconCls?: undefined;
          id?: undefined;
          locate?: undefined;
          separator: boolean;
      })[]
    • iconCls: string
    • id: string
    • locate: string

Methods

  • Common transformation method.

    Parameters

    • data: any

      menu tree

    • map: ((item: any) => any)

      map function of a single entry

        • (item): any
        • Parameters

          • item: any

          Returns any

    • filter: ((item: any) => boolean) = ...

      filter function of a single entry

        • (item): boolean
        • Parameters

          • item: any

          Returns boolean

    Returns any

    the transformed menu tree

  • Transforms an item into a menuitem entry, provided we have a single menu item. We have 3 cases:

    • menu separator
    • latex menu
    • the common case with localized text

    Parameters

    • item: any

    Returns string

  • Maps a single menu item to a html string. The item can have a nested menu. LaTeX text is a special case. It cannot be localized.

    Parameters

    • item: any

    Returns string | any[]

  • Populates a side menu in a wrapper menu panel for reduced space.

    Parameters

    • data: any
    • onMenuClick: (() => void)
        • (): void
        • Returns void

    Returns void