This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@cagov/lookup

1.0.3 • Public • Published

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>

Readme

Keywords

none

Package Sidebar

Install

npm i @cagov/lookup

Weekly Downloads

19

Version

1.0.3

License

ISC

Unpacked Size

95.1 kB

Total Files

8

Last publish

Collaborators

  • jbum
  • zakiyak
  • timothyshambra
  • xjensen
  • aaronhans
  • chacha-california
  • kkoryaka