Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Menubar is a component wherein it dictates the title, information, functionality or actions that can be used in a specific widget or page.

The package can be installed via npm:

npm install empower-container --save

Configuration

import { MenuBar } from 'empower-container';

..............

  let [contentMenuBar, setContentMenuBar] = useState({
        config: {
            show: true,
            icon: SVG_USER,
            iconType: ['standard'],
            showInfo: false,
            title: 'Displays',
        },
    })
    
    /**
     * 
     * getActions - method that gets the value and data of the component
     */

    const getActions = (value, data) => {
        console.log('VALUE', value, data)
    }
    
..............

  return (
    <>
      <MenuBar { ...contentMenuBar } getActions={(action, data) => getContentMenuBarActions(action, data)}>
          .......Children here
      </MenuBar>
    </>
  )

Configuration

import { MenuBar } from 'empower-container';

..............

  let [contentMenuBar, setContentMenuBar] = useState({
        config: {
            show: true,
            iconType: ['back'],
            showInfo: false,
            title: 'Displays',
        },
    })
    
    /**
     * 
     * getActions - method that gets the value and data of the component
     */

    const getActions = (value, data) => {
        console.log('VALUE', value, data)
    }
    
..............

  return (
    <>
      <MenuBar { ...contentMenuBar } getActions={(action, data) => getContentMenuBarActions(action, data)}>
          .......Children here
      </MenuBar>
    </>
  )

Configuration

import { MenuBar } from 'empower-container';

..............

  let [contentMenuBar, setContentMenuBar] = useState({
        config: {
            show: true,
            iconType: ['check'],
            showInfo: false,
            title: 'Displays',
        },
        check: {
            disabled: false,
            selected: 0,
            total: 5
        }
    })
    
    /**
     * 
     * getActions - method that gets the value and data of the component
     */

    const getActions = (value, data) => {
        console.log('VALUE', value, data)
    }
    
..............

  return (
    <>
      <MenuBar { ...contentMenuBar } getActions={(action, data) => getContentMenuBarActions(action, data)}>
          .......Children here
      </MenuBar>
    </>
  )

Configuration

import { MenuBar } from 'empower-container';

..............

  let [contentMenuBar, setContentMenuBar] = useState({
        config: {
            show: true,
            iconType: ['check'],
            showInfo: true,
            title: 'Displays',
        },
        check: {
            disabled: false,
            selected: 2,
            total: 5
        }
    })
    
    /**
     * 
     * getActions - method that gets the value and data of the component
     */

    const getActions = (value, data) => {
        console.log('VALUE', value, data)
    }
    
..............

  return (
    <>
      <MenuBar { ...contentMenuBar } getActions={(action, data) => getContentMenuBarActions(action, data)}>
          .......Children here
      </MenuBar>
    </>
  )

Configuration

import { MenuBar } from 'empower-container';

..............

  let [contentMenuBar, setContentMenuBar] = useState({
        config: {
            show: true,
            iconType: ['check'],
            showInfo: true,
            title: 'Displays',
        },
        check: {
            disabled: false,
            selected: 5,
            total: 5
        }
    })
    
    /**
     * 
     * getActions - method that gets the value and data of the component
     */

    const getActions = (value, data) => {
        console.log('VALUE', value, data)
    }
    
..............

  return (
    <>
      <MenuBar { ...contentMenuBar } getActions={(action, data) => getContentMenuBarActions(action, data)}>
          .......Children here
      </MenuBar>
    </>
  )

Configuration

import { MenuBar } from 'empower-container';

..............

  let [contentMenuBar, setContentMenuBar] = useState({
        config: {
            show: true,
            icon: SVG_USER,
            iconType: ['standard'],
            showInfo: true,
            title: 'Displays',
        },
        info: "Sample information here..."
    })
    
    /**
     * 
     * getActions - method that gets the value and data of the component
     */

    const getActions = (value, data) => {
        console.log('VALUE', value, data)
    }
    
..............

  return (
    <>
      <MenuBar { ...contentMenuBar } getActions={(action, data) => getContentMenuBarActions(action, data)}>
          .......Children here
      </MenuBar>
    </>
  )

Configuration

import { MenuBar } from 'empower-container';

..............

  let [contentMenuBar, setContentMenuBar] = useState({
        config: {
            show: true,
            icon: SVG_USER,
            iconType: ['standard'],
            showInfo: true,
            title: 'Displays',
        },
        info: "Sample information here....",
        button: {
            show: true,
            actions: [{
                class: 'button',
                label: "Submit",
                action: "readytosubmit",       // string optional
                icon: SVG_SUBMIT
            }]
        }
    })
    
    /**
     * 
     * getActions - method that gets the value and data of the component
     */

    const getActions = (value, data) => {
        console.log('VALUE', value, data)
    }
    
..............

  return (
    <>
      <MenuBar { ...contentMenuBar } getActions={(action, data) => getContentMenuBarActions(action, data)}>
          .......Children here
      </MenuBar>
    </>
  )

Configuration

import { MenuBar } from 'empower-container';

..............

  let [contentMenuBar, setContentMenuBar] = useState({
        config: {
            show: true,
            icon: SVG_USER,
            iconType: ['standard'],
            showInfo: true,
            title: 'Displays',
        },
        info: "Sample information here....",
        buttonFooter: { 
            show: true,
            actions: [{
                    class: 'button',
                    label: "Submit",
                    action: "footer-submit",       // string optional
                    icon: SVG_SUBMIT,
                    show: true
            }]
        }
    })
    
    /**
     * 
     * getActions - method that gets the value and data of the component
     */

    const getActions = (value, data) => {
        console.log('VALUE', value, data)
    }
    
..............

  return (
    <>
      <MenuBar { ...contentMenuBar } getActions={(action, data) => getContentMenuBarActions(action, data)}>
          .......Children here
      </MenuBar>
    </>
  )

Configuration

import { MenuBar } from 'empower-container';

..............

  let [contentMenuBar, setContentMenuBar] = useState({
        config: {
            show: true,
            icon: SVG_USER,
            iconType: ['standard'],
            showInfo: true,
            title: 'Displays',
        },
        info: "Sample information here....",
        dropdown: {
            show: true,
            title: 'File Test',
            type: 'date-picker-monthly',
            selection: {
                startDate: "Feb 2021",
                endDate: "Feb 2021",
            },
        }
    })
    
    /**
     * 
     * getActions - method that gets the value and data of the component
     */

    const getActions = (value, data) => {
        console.log('VALUE', value, data)
    }
    
..............

  return (
    <>
      <MenuBar { ...contentMenuBar } getActions={(action, data) => getContentMenuBarActions(action, data)}>
          .......Children here
      </MenuBar>
    </>
  )

Configuration

import { NavTab } from 'empower-display';

..............

  let [contentMenuBar, setContentMenuBar] = useState({
        config: {
            show: true,
            icon: SVG_USER,
            iconType: ['standard'],
            showInfo: true,
            title: 'Displays',
        },
        info: "Sample information here....",
        pagination: {
            show: true,
            hideSummary: false,
            counter: 10,
            perPage: 10,
            page: 1,
            total: 35,
        }
    })
    
    /**
     * 
     * getActions - method that gets the value and data of the component
     */

    const getActions = (value, data) => {
        console.log('VALUE', value, data)
    }
    
..............

  return (
    <>
      <MenuBar { ...contentMenuBar } getActions={(action, data) => getContentMenuBarActions(action, data)}>
          .......Children here
      </MenuBar>
    </>
  )

Parameter

Data Type

Constraint

Description

config

Object

Required

Display the basic config including icon, title and info.
show = Boolean
icon = SVG
iconType = Array (standard, check, back and close)
showInfo = Boolean
title = String

info

String

Optional

Display value of the popup information.

pagination

Object

Optional

Display the pagination feature in the right side of the menubar.
show = Boolean
hideSummary = Boolean
counter = Number
perPage = Number
page = Number
total = Number

buttonFooter

Object

Optional

Display set of buttons to the bottom of the menubar.
show = Boolean
actions = Array

class = String label = String action = String icon = SVG show = Boolean

Repository Link: https://gitlab.com/empowerteams/empower-display.git

NPM Package: https://www.npmjs.com/package/empower-display

Demo Repo: git@bitbucket.org:empowerteams/mfe-sub-application-template.git

  • No labels