npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@pdm_dt/menu-for-all-applications

v1.4.7

Published

This library aims to create a dropdown menu with redirection to multiple applications that the user can access. Application provisioning, authentication and all data is provided by your api Responsive is available for screen width less 800px

Downloads

3

Readme

MENU FOR ALL APPLICATIONS

This library aims to create a dropdown menu with redirection to multiple applications that the user can access. Application provisioning, authentication and all data is provided by your api Responsive is available for screen width less 800px

alt text

resposive

alt text

Installation

run the command

npm i menu-for-all-applications

Configuration

After the installation process you must import the library:


import MenuForAllApplications from 'menu-for-all-applications'

In your App.vue or in your main page you must have a main div with the id:"q-app". This id is very important because the menu will hang on it

Now in your code run the library You must pass 3 parameters in the constructor:

  • auth token ( sanctum, jwt, etc..) of the api that will provide the applications that the user has access to.
  • User email so that the search can be done in the destination api
  • Endpoint of your api ( POST )
 const menuForAll = new MenuForAllApplications(token, userMail, apiUrl);
 menuForAll.initMenu();

Return from your API

Your api's return should be an array of objects. This object must have the following format

  • title: string
  • link: string

 [
    {
        title:"Name displayed in menu",
        link: "Url to destination application"
    }
 ]

STAND ALONE

If you don't see the need to build your menu on the backend, just pass the same array of objects to the standAlone method and it will provide a menu

  menuForAll.standAlone([
        {
          title: "Google",
          link: "www.google.com",
        },
        {
          title: "Facebook",
          link: "www.facebook.com",
        },
        {
          title: "Instagram",
          link: "www.instagram.com",
        },
      ]);

STYLE YOUR MENU

If you want to change the color of the menu, its position from the top and the centering of the text just call the methods

      //color, position-top, justify-content
      menuForAll.setMenuStyle('#38761d', 0, 'left')
      //color for mouse-houver
      menuForAll.setMouseOnHover('#fff')
      //color and position for menu mobile
      menuForAll.setMobileMenu('#38761d', 0)

alt text

CDN file or import script tag

If you don't want to use npm to install the package and call it directly in your html. Download the js file to your preferred directory.The file is located in

    .src/cdn/cdnmenu.js

In you HTML add

  • auth token ( sanctum, jwt, etc..) of the api that will provide the applications that the user has access to.
  • User email so that the search can be done in the destination api
  • Endpoint of your api ( POST )
  <script src="./cdnmenu.js" type="text/javascript"></script>    
  <script>
        initMenu(token, email, endpointApplication)
  </script>

Obs: Stylemenu and standAlone not allowed in CDN file

ERROR

Once done, an icon will be created at the bottom of the page where, when clicked, the drop-down menu with the data returned from your api will be shown. If an error occurs, an offline display will be given alt text