1.1.6 • Published 3 years ago

panel-navigator v1.1.6

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

Panel Navigator

This Angular Module (Component) allows you to have dynamic navigation with icons and status type and navigation controlloer.

Installation

npm install panel-navigation-scroller

Scaffolding

Import the module into your project under imports

imports: [
    BrowserModule,
    AppRoutingModule,
    PanelNavigationScrollerModule
  ],

Use

To use in your component, use the following tag for a basic setup

<wav-panel-navigator
    [title]="title"
    [description]="description"
    [data]="dataObservable"
></wav-panel-navigator>

Inputs

The following Inputs are available

InputTypeDefautDescription
titleSTRINGNULLtitle for navigation section
descriptionSTRINGNULLdescription below title area for navigation
dataObject or Observable[]data for items
navigationBOOLEANFALSEnavigation controller at top of navigation
navigationTitleSTRINGNULLnavigation controller title
navigationColorSTRINGNULLnavigation controller background color
navigationTextColorSTRINGNULLnavigation controller text color
navigationRedirectSTRINGNULLback button on navigation controller will appear and redirect to this route
bindSelectionToTitleBOOLEANNULLthe selected item will be reflected in the navigation controller
stateTypesOBJECTS[]NULLstates for items - appears on right of menu items
lineAboveBOOLEANFALSEadd line above navigation list
lineBelowBOOLEANFALSEadd line below navigation list
displayIconsBOOLEANFALSEdisplay icons from data to line items on left
displayStatesBOOLEANFALSEdisplay state icons from data to line items on left
enableScrollingBOOLEANFALSEadd line below navigation list

Data Structure

Object or Observable, this is the data strtucture object that defines each list item. All, Some none of the properties may be provided for eah list item. You do need at least a name property to display something in the list.

  data: MenuItem[] = [
    { name: 'Vendor Onboarding', disabled: false, icon: 'person', iconColor: 'purple', color: 'green', state: 1, ref: 'sec2'},
    { name: 'Required Information', disabled: false, state: 0 },
    { name: 'Private Details', disabled: false, state: -1 },
    { name: 'Negotiated Terms', disabled: false, state: 2 },
  ]

Inputs

InputTypeDefautDescription
nameSTRINGNULLlist item text
disabledSTRINGNULLdisable list item
iconSTRINGNULLicon to use (mat icons)
iconColorSTRINGNULLicon (left on list item color) color
colorSTRINGNULLcolor of the text
stateSTRINGNULLthe state ID (State Types) that is assigned to this list item
refSTRINGNULLthis is the div reference ID for the target to be scrolled to

Outputs

InputTypeDefautDescription
selectedItemMenuItemNULLmenu item object

State Type Structure

This is the different state types (icon on the right of list) that is provided when a state of a menu item has changed Provided all the types that are assigned to the data structure. if no type is provided, nothing will be rendered.

stateTypes: StateType[] = [
  {name: 'testing', icon: '', value: 0, color: ''},
  {name: 'approved', icon: 'check', value: 1, color: 'purple'},
  {name: 'declined', icon: 'warning', value: -1, color: 'red'},
  {name: 'warning', icon: 'refresh', value: 2, color: 'orange'},
]

Properties

InputTypeDefautDescription
nameSTRINGNULLtext to appear on left of state icon
iconSTRINGNULLmat icon anme
valueSTRINGNULLvalue that corresponds to the state value of data
colorSTRINGNULLcolor for icon and text

Sample Configurations

Here is a basic setup:

<wav-panel-navigator
    [title]="title"
    [description]="description"
    [data]="dataObservable"
></wav-panel-navigator>

Here is max setup

<wav-panel-navigator
    [navigation]="true"
    [navigationRedirect]="'default'"
    [title]="title"
    [description]="description"
    [data]="dataObservable"
    [bindSelectionToTitle]="true"
    [stateTypes]="stateTypes"
    [displayIcons]="false"
    [displayStates]="true"
></wav-panel-navigator>

Scrolling (Comming Soon)

There is a scrollTo binding thats being implemented - comming soon