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

@aliasghar.ahmed/wc-share-lib

v0.0.1

Published

This web component was generated with [Angular CLI](https://github.com/angular/angular-cli) version 11.0.5.\ wc-share-lib is a wrapper around share library to host it in a non-angular application.

Downloads

34

Readme

wc-share-lib

This web component was generated with Angular CLI version 11.0.5.
wc-share-lib is a wrapper around share library to host it in a non-angular application.

To install share library web component on your local system, you need the following:

  • Node.js
  • npm package manager

Installation

npm install @aliasghar.ahmed/wc-share-lib . If there is conflict in peer dependencies please use --force while installation npm install @aliasghar.ahmed/wc-share-lib --force

Dependencies

This web component has the following dev dependencies. These will be installed along with wc-share-lib package and need not be installed explicitly.

  • "@aliasghar.ahmed/share-lib": "^1.0.0",
  • "@angular/cdk": "^11.0.0",
  • "@angular/common": "~11.0.2",
  • "@angular/core": "^11.0.2",
  • "@angular/elements": "^11.0.5",
  • "@angular/router": "~11.0.2",
  • "@angular/forms": "~11.0.2"

Example usage

To enable the share-lib web component import "wc-share-lib.js" in your index.html.

<script type="module" src="/node_modules/@aliasghar.ahmed/wc-share-lib/wc-share-lib.js"></script>

Load web component element using the following code and assign an ID e.g. "share-wrapper". This ID will be used to pass the input data to share library

<lib-share-dialog id="share-wrapper"> </lib-share-dialog> 

Configure the share-lib using "shareOptions" input and get the response using "onShareComplete" eventlistner. Refer to the Input/output table below for more details.

    const element = document.getElementById('share-wrapper');
    element.shareOptions = shareOptions;// Refer the Json structure below, for shareOptions definition.
    element.addEventListener('onShareComplete', (e) => 
    {console.log(e.detail)}); // Refer the output table below, for more detials
    element.addEventListener('onShareClose', (e) => 
    {console.log(e.detail)}); 

Input Json structure for share library.

const shareOptions = {
      objectId: '', // Can be empty now. For future customizations component can use this property
      objectType: '',  // Can be empty now. For future customizations component can use this property
      shareData: {
        hideEditOption: false, // boolean to hide edit checkbox
        disableUserSelection: false, // boolean to disable user selection
        parentClass: 'web-share-dialog', // custom class to handle css by hosting app
        readGroups: [1024], // Existing share details of the object, list of groups with only Read access
        editGroups: [], // Existing share details of the object, list of groups with write access, leave it empty if not applicable
        readUsers: ['zp8k4'], // Existing share details of the object, list of users with only Read access
        editUsers: [], // Existing share details of the object, list of users with write access, leave it empty if not applicable
        readUsersDetails: [{"userId":"zp8k4","mobileNumber":"0015999","avatar":"zp8k4_1644232363000.png","emailId":"[email protected]","groups":[1221],"clientId":0,"allowChangePassword":true,"fName":"Abhishek","lName":"Singh","passwordExpiryDt":0}], // Existing share details of the object, details of the  list of users with read access
        editUsersDetails: [], // Existing share details of the object, details of the  list of users with write access
        showTeams: true, // boolean to show teams
        serviceUrl: LD_SERVICE_URL // LD Service URL (https://advantageqa2.iriworldwide.com/ld_engg)
      }
    }

Inputs

| Name | Description | ----------------------- | ---------------------------------------------------------------------------------------|
| shareOptions | This is a JSON provided to the share library.All the JSON properties are explained above.

Outputs

| Name | Function Name | Description | ------------------------------------ | ----------------- | -------------------------------------------------------------------------| | onShareComplete | onShare | This function will emit json object(shared data) when user clicks on share button in the popup | onShareClose | onClose | This function will emit the closure event of popup basically when user clicks on 'X' or 'Cancel' in the popup.