Socket
Socket
Sign inDemoInstall

@cagov/lookup

Package Overview
Dependencies
1
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @cagov/lookup

This custom element renders a search form with autocomplete (using awesomplete) which calls the api endpoint defined in the element attribute. The example markup below calls the api.alpha.ca.gov endpoint to autocomplete California counties or zip codes.


Version published
Weekly downloads
18
increased by260%
Maintainers
2
Install size
236 kB
Created
Weekly downloads
 

Readme

Source

Lookup: search form + autocomplete

This custom element renders a search form with autocomplete (using awesomplete) which calls the api endpoint defined in the element attribute. The example markup below calls the api.alpha.ca.gov endpoint to autocomplete California counties or zip codes.

Choosing an autocomplete option or submitting the form dispatches a custom event on the cwds-lookup custom element with the chosen value.

This is used in conjunction with scripts that listen for the event and act on the chosen result. An example use on telehealth listens for the search field event, then uses the value to display the set of telehealth providers in that county.

Sample markup

<cwds-lookup 
  data-search-api="https://api.alpha.ca.gov/CaZipCityCountyTypeAhead?citymode=false&countymode=true&q=" 
  data-label="Please enter city or zip code"
  data-button-label="Find health plan"
  data-list-label="Result list"
>
</cwds-lookup>

FAQs

Last updated on 10 Mar 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc