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

ng-generic-autocomplete

v1.2.6

Published

Generic autocomplete module for Angular

Downloads

34

Readme

Generic Autocomplete Module with ng-bootstrap for Angular

Using

  • Import GenericAutocompleteComponent from the ng-generic-autocomplete package into your module
  • Add HTML tags <generic-autocomplete [itemList]="list" propertyName="property" [outputProperties]="myOutputPropertiesArray" title="title" [showTitle]="true" helpText="helpText" [showHelpText]="true" placeholder="placeholder" failedText="failedText" fetchDataText="fetchDataText" (onItemSelect)="itemSelected($event)" (onFetchData)="fetchData()" [showItems]="true" [showTableText]="true" [tableActive]="false" tableText="tableText" [pageSize]="5" [maxSize]="5" [clearInput]="false">

Available properties

  • REQUIRED*: itemList: any[] - List of objects to filter
  • REQUIRED*: remoteSearch: boolean - Whether to use a remote api for searching or not
  • REQUIRED**: remoteConfig: {api: string, endpoint: string} - Base api url and endpoint name. No trailing slashes
  • REQUIRED: propertyName: string - Property to filter by
  • outputProperties: string[] - List of properties to display output as (default: [])
  • outputDelimiter: string - Delimiter to separate display properties with (default: ' ')
  • title: string - Title above text input (default: 'Search')
  • showTitle: boolean - Boolean to display title over input (default: true)
  • helpText: string - Helper text under input (default: 'Begin typing and search suggestions will appear')
  • showHelpText: boolean - Boolean to display help text under input (default: true)
  • placeholder: string - Placeholder text in input (default: 'Search..')
  • failedText: string - Text to display when search failed (default: 'No items matched your search')
  • fetchDataText: string - Text to display when data not yet fetched (default: 'Click to fetch data')
  • clearInput: boolean - Whether to clear input after item selected or not (default: true)
  • showItems: boolean - Whether to show a table containing all items in itemList or not (default: false)
  • showTableText: boolean - Display text above item table (default: true)
  • tableActive: boolean - Have table expanded by default or not (default: true)
  • tableText: string - Text shown over item table (default: 'Or choose from all items..')
  • pageSize: number - Number of items to display for each page in table (default: 5)
  • maxSize: number - Max number of pages shown in pagination before wrapping (default: 5)

(* One of these are required, and can't be used in conjuction with one another) (** Only required if remoteSearch=true)

Outputs

  • onItemSelect: Returns a single item of the type in your itemList array of objects
  • onFetchData: Emitted when user clicks the component and data is not yet fetched