Package Exports
- @ppci/source-autocomplete
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@ppci/source-autocomplete) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Source Search Autocomplete
Table of contents
Installation
NPM
npm i @ppci/source-autocompleteUsage
Javascript
import '@ppci/source-autocomplete'Browser
<script type="module" src="https://cdn.jsdelivr.net/npm/@ppci/source-autocomplete/builds/index.min.js" />
<source-autocomplete
.suggestions=${Array}
@suggestion-click=${Function}
@search-change=${Function}>
</source-autocomplete>Theme | Styling.
source-autocomplete {
/* Searchbox */
--input-padding: 8px 16px;
--input-border: 1px solid #eeee;
--input-border-radius: 8px;
--input-color: gray;
--input-background: white;
--input-placeholder-color: gray;
--input-focus-border: 1px solid blue;
}Properties
| Property | Type | Description | Possible Values |
| *searchPlaceHolder* | String | Searchbox placeholder text | |
| suggestions | Array | Array of source suggestions | ```javascript [ { id: "ed34e97a-c29b-52bd-3fb0-040260ac16d6", name: "Ibiza plaza", city: "Naaldwijk", image: "imageurl.nl/image.jpg" }, { id: "a5b0fe5c-990d-0c86-c03c-7655de478f74", name: "solaradam", city: "Amsterdam", image: "imageurl.nl/image.jpg" } ] ``` |
Events
| Name | Description | Payload |
| @suggestion-click | Suggestion item clicked | ```javascript { detail: { id: "a5b0fe5c-990d-0c86-c03c-7655de478f74", name: "solaradam", city: "Amsterdam", image: "imageurl.nl/image.jpg" } } ``` |
| @search-change | Search value has changed | ```javascript { detail: { value: 'p' } } ``` |
Changelog
1.4.0
- Loading state added
1.3.0
- Error handling
1.2.4
- Pipeline fix
1.2.2 | 1.2.3
- Bundle and minify related fixes
1.2.1
- Don't show no suggestions message if the search value is empty
1.2.0
- Show message when there are no suggestions found
- Show error when an error has occurred
1.1.0
- Hide suggestion box when there are no suggestions found.
- On suggestion click propagation problem
- Added css variables
1.0.2
- Missing custom input import bug fix
1.0.1
- Minor bug fixes
1.0.0
- Initial version of the source search autocomplete.