New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

fetched-list

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fetched-list

Dependency-free component that implements live-search (value suggestion) to any element via <datalist>

  • 0.0.10
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

< fetched-list >

Dependency-free component that implements live-search (value suggestion) to any <input> element via <datalist>

Demo

How to use

1. Load module

<!-- From CDN -->
<script src="https://esm.run/fetched-list" type="module"></script>

2. Connect <input> element

<!-- Just wrap any input -->
<fetched-list>
    <input>
</fetched-list>

<!-- Or refer to it by ID -->
<input id="inputId">
<!-- ... -->
<fetched-list value-from="inputId"></fetched-list>

3. Configure

<!-- From demo/index.html -->
<fetched-list
        url="http://geodb-free-service.wirefreethought.com/v1/geo/countries?limit=10"
        param="namePrefix" check="metadata.totalCount" list-path="data" value-path="name"
        label-path="code" title-case="true" initial-fetch="true" auto-select="true">
    <input autocapitalize="words" placeholder="Type any Country" type="search">
</fetched-list>

Properties

PropertyAttributeDescription
urlurlAPI endpoint for fetching options
paramparamName of query parameter where to put text from input
checkcheckAbsolute JSON path to property that indicate successful response
listPathlist-pathAbsolute JSON path to property that contains array with options
valuePathvalue-pathRelative JSON path to property that contains value of each option
labelPathlabel-pathRelative JSON path to property that contains label of each option
titleCasetitle-caseAutomatically capitalize first letter when typing
valueFromvalue-fromID of outer input element to be used instead of inner input
autoSelectauto-selectAutomatically select most relevant variant from list
initialFetchinitial-fetchPrefetch an options before input
removeOptionsremove-optionsClear list of options before populating

Keywords

FAQs

Package last updated on 24 Nov 2022

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc