1.12.3 • Published 2 years ago

@patternfly/pfe-autocomplete v1.12.3

Weekly downloads
71
License
MIT
Repository
github
Last release
2 years ago

PatternFly Elements Autocomplete

<pfe-autocomplete> is a Web Component that provides options in a dropdown list as user types in an input box by showing result from an api call.

Read more about Autocomplete in the PatternFly Elements Autocomplete documentation

Installation

Load <pfe-autocomplete> via CDN:

<script src="https://unpkg.com/@patternfly/pfe-autocomplete?module"></script>

Or, if you are using NPM, install it

npm install @patternfly/pfe-autocomplete

Then once installed, import it to your application:

import '@patternfly/pfe-autocomplete';

Usage

<pfe-autocomplete debounce="500" init-value="uni">
  <input placeholder="Enter Your Search Term" />
</pfe-autocomplete>
const autocomplete = document.querySelector('autocomplete');
autocomplete.autocompleteRequest = function (params, callback) {
  autocomplete.loading = true;
  const url = new URL('http://openlibrary.org/search.json');
        url.searchParams.append('title', params.query);
  fetch(url.toString())
    .then(x => x.json())
    .then(({ docs }) => docs.map(x => x.title))
    .then(callback)
    .then(() => autocomplete.loading = false);
};
2.0.0-next.4

2 years ago

2.0.0-next.3

2 years ago

2.0.0-next.2

2 years ago

2.0.0-next.1

2 years ago

1.12.3

2 years ago

2.0.0-next.0

2 years ago

1.12.2

2 years ago

1.12.1

2 years ago

1.12.0

3 years ago

1.11.2

3 years ago

1.11.1

3 years ago

1.11.0

3 years ago

1.10.1

3 years ago

1.10.0

3 years ago

1.9.3

3 years ago

1.9.2

3 years ago

1.9.1

3 years ago

1.9.0

3 years ago

1.8.0

3 years ago

1.6.0

3 years ago

1.7.0

3 years ago

1.5.1

3 years ago

1.5.0

3 years ago

1.4.0

3 years ago

1.3.4

3 years ago

1.3.3

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago

0.0.0-test.1

5 years ago

0.0.0-test.0

5 years ago