Options
All
  • Public
  • Public/Protected
  • All
Menu

An abstract base class for left side bar nav menu. This class provides more capabilities than AbstractNavMenu in case of that it can be showed/hidden by sliding the panel in/out from the left side of the screen. You can subscribe to the ObservableManager's topic name nav-left-layout.[sub-topic-name].toggled to listen on the event emitted from this component when the left panel is toggled (showed/hidden). Futhermore, instead of sliding the panel in/out from the left side of the screen, it can be fixed by setting a flag fixed to true. By setting a flag fixed to true, the left panel will be always shown on the screen. This component will automatically publish an event to topic name nav-left-layout.[sub-topic-name].fixed when the flag fixed is changed. You can also control the toggled and fixed flag sending an event into command topic name nav-left-layout.[sub-topic-name].cmd.toggled and nav-left-layout.[sub-topic-name].cmd.fixed respectively.

author

shiorin, tee4cute

see

ObservableManager

Type parameters

Hierarchy

Implements

Index

Constructors

constructor

Properties

Private _fixed

_fixed: boolean

Private _toggled

_toggled: boolean

Protected bypass

bypass: boolean

Protected fixedSubjects

fixedSubjects: Subject<any>[]

Protected i18nKey

i18nKey: string

Protected i18nValue

i18nValue: any

Protected items

items: T[]

Protected navigateSubjects

navigateSubjects: Subject<any>[]

Protected observableMgr

observableMgr: ObservableManager

Protected options

options: any

Protected phloxAppService

phloxAppService: PhloxAppService

Protected subTopicName

subTopicName: string

Protected toggledSubjects

toggledSubjects: Subject<any>[]

Static FIXED_CHANGE_TOPIC_NAME

FIXED_CHANGE_TOPIC_NAME: string = FIXED_CHANGE_TOPIC_NAME

Static FIXED_CMD_TOPIC_NAME

FIXED_CMD_TOPIC_NAME: string = FIXED_CMD_TOPIC_NAME

Static NAVIGATE_CMD_TOPIC_NAME

NAVIGATE_CMD_TOPIC_NAME: string = NAVIGATE_CMD_TOPIC_NAME

Static NAVIGATE_TOPIC_NAME

NAVIGATE_TOPIC_NAME: string = NAVIGATE_TOPIC_NAME

Static SUB_TOPIC_NAME

SUB_TOPIC_NAME: string = SUB_TOPIC_NAME

Static TOGGLED_CHANGE_TOPIC_NAME

TOGGLED_CHANGE_TOPIC_NAME: string = TOGGLED_CHANGE_TOPIC_NAME

Static TOGGLED_CMD_TOPIC_NAME

TOGGLED_CMD_TOPIC_NAME: string = TOGGLED_CMD_TOPIC_NAME

Accessors

Private app

  • Returns PhloxApp

fixed

  • get fixed(): boolean
  • set fixed(newFixed: boolean): void
  • Returns boolean

  • Parameters

    • newFixed: boolean

    Returns void

toggled

  • get toggled(): boolean
  • set toggled(newToggled: boolean): void
  • Returns boolean

  • Parameters

    • newToggled: boolean

    Returns void

Methods

addItem

  • addItem(item: T): boolean
  • Add a new nav item into this nav menu. If there already is the given item in this nav menu, this method will do nothing and return false.

    Parameters

    • item: T

      A new nav item to be added into this nav menu.

    Returns boolean

    Returns true if the given item is added into this nav menu. Otherwise, returns false.

applyI18N

  • applyI18N(value: any): void

containsItem

  • containsItem(item: T): boolean
  • To check that the given item is in this nav menu or not.

    Parameters

    • item: T

      A nav item to check that it is in this nav menu or not.

    Returns boolean

    Returns true if the given item is in this nav menu.

Abstract doNavigate

  • doNavigate(item: T): Promise<boolean>
  • A method to perform the actual navigation, for example, changing a router's path, etc.

    Parameters

    • item: T

      A nav item to navigate to.

    Returns Promise<boolean>

    Returns a Promise which will be resolved when the navigation is done. The Promise's result will be a boolean value which its value will be true if the navigation is successful.

getActiveIndex

  • getActiveIndex(): number
  • Get an active nav item index of this nav menu.

    Returns number

    Returns -1 if there is no current active item. Otherwise, return the array index of current active item.

getActiveItem

  • getActiveItem(): T

getApplication

getI18NKey

  • getI18NKey(): string

getI18NValue

  • getI18NValue(): any

getItemByIndex

  • getItemByIndex(idx: number): T

getItemByName

  • getItemByName(name: string): T

getItemCount

  • getItemCount(): number

getItemIndex

  • getItemIndex(item: T): number
  • Get the index of the given nav item (item).

    Parameters

    • item: T

      The nav item to find index.

    Returns number

    Returns an index of the specified item. Returns -1 if not found.

getItemIndexByName

  • getItemIndexByName(name: string): number
  • Get the index of the given item name.

    Parameters

    • name: string

      The item name to find index.

    Returns number

    Returns an index of nav item having the specified name. Returns -1 if not found.

getItems

  • getItems(): T[]

getOptions

  • getOptions(): any

getSubTopicName

  • getSubTopicName(): string

Private initNavLeftEventTopics

  • initNavLeftEventTopics(fixedChange: string, toggledChanged: string, fixedCmd: string, toggledCmd: string): void
  • Parameters

    • fixedChange: string
    • toggledChanged: string
    • fixedCmd: string
    • toggledCmd: string

    Returns void

isBypassKey

  • isBypassKey(): boolean

isFixed

  • isFixed(): boolean
  • Returns boolean

isToggled

  • isToggled(): boolean
  • Returns boolean

navigateTo

  • navigateTo(item: T): Promise<boolean>
  • Navigate this nav menu to the specified nav item. This method returns Promise to support asynchronous execution. The result value of returned Promise is a boolean indicating the navigation result. The result value must be true if the navigation is successful. Otherwise, for example, if the given item does not exist, the result value will be false.

    Parameters

    • item: T

      The nav item to navigate to.

    Returns Promise<boolean>

    Returns a Promise which will be resolved when the navigation is done. The Promise's result will be a boolean value which its value will be true if the navigation is successful.

navigateToIndex

  • navigateToIndex(idx: number): Promise<boolean>
  • Navigate this nav menu to the specified index (idx). This method returns Promise to support asynchronous execution. The result value of returned Promise is a boolean indicating the navigation result. The result value must be true if the navigation is successful. Otherwise, the result value will be false.

    Parameters

    • idx: number

      The item index to navigate to.

    Returns Promise<boolean>

    Returns a Promise which will be resolved when the navigation is done. The Promise's result will be a boolean value which its value will be true if the navigation is successful.

navigateToName

  • navigateToName(name: string): Promise<boolean>
  • Navigate this nav menu to a nav item having the specified name. This method returns Promise to support asynchronous execution. The result value of returned Promise is a boolean indicating the navigation result. The result value must be true if the navigation is successful. Otherwise, for example, if the given item does not exist, the result value will be false.

    Parameters

    • name: string

      The name of a nav item to navigate to.

    Returns Promise<boolean>

    Returns a Promise which will be resolved when the navigation is done. The Promise's result will be a boolean value which its value will be true if the navigation is successful.

ngOnInit

  • ngOnInit(): void

Abstract onFixedChange

  • onFixedChange(fixed: boolean): void
  • Parameters

    • fixed: boolean

    Returns void

Abstract onToggledChange

  • onToggledChange(toggled: boolean): void
  • Parameters

    • toggled: boolean

    Returns void

removeItem

  • removeItem(item: T): boolean
  • Remove the given item from this nav menu. If the given item is not in this nav menu, this method will do nothing and return false. If the item being removed is a current active item, this nav menu will be navigated to the first nav item.

    Parameters

    • item: T

      A nav item to be removed from this nav menu.

    Returns boolean

    Returns true if the given item is found and removed from this nav menu. Otherwise, returns false.

reset

  • reset(): void
  • Reset this nav menu. This method simply navigates back to the item at index 0.

    Returns void

setBypassKey

  • setBypassKey(bypass: boolean): void

setFixed

  • setFixed(fixed: boolean): void
  • Parameters

    • fixed: boolean

    Returns void

setI18NKey

  • setI18NKey(i18nKey: string): void

setItems

  • setItems(items: T[]): void
  • Set nav items of this nav menu.

    Parameters

    • items: T[]

    Returns void

setOptions

  • setOptions(options: any): void

setToggled

  • setToggled(toggled: boolean): void
  • Parameters

    • toggled: boolean

    Returns void

Static getFixedChangeTopicName

  • getFixedChangeTopicName(subTopicName: string): string
  • Parameters

    • subTopicName: string

    Returns string

Static getFixedCmdTopicName

  • getFixedCmdTopicName(subTopicName: string): string
  • Parameters

    • subTopicName: string

    Returns string

Static getNavigateCmdTopicName

  • getNavigateCmdTopicName(subTopicName: string): string

Static getNavigateTopicName

  • getNavigateTopicName(subTopicName: string): string
  • Get the navigation event topic name with the given subTopicName. The returning topic name will be prefixed by NAVIGATE_TOPIC_NAME.

    Parameters

    • subTopicName: string

    Returns string

Static getToggledChangeTopicName

  • getToggledChangeTopicName(subTopicName: string): string
  • Parameters

    • subTopicName: string

    Returns string

Static getToggledCmdTopicName

  • getToggledCmdTopicName(subTopicName: string): string
  • Parameters

    • subTopicName: string

    Returns string

Generated using TypeDoc