diff --git a/README.md b/README.md
index 9401a07..1cdc3a6 100644
--- a/README.md
+++ b/README.md
@@ -6,16 +6,21 @@
## Installation
-You need [Vue.js](https://vuejs.org/) **version 2.0+** and an [Google PLACE API](https://developers.google.com/places/web-service/get-api-key) key. This plugin comes without any css, the main goal is to use it with differents framework. To do this, you can pass multiple classes in options and custom the results template (See examples section).
+You need [Vue.js](https://vuejs.org/) **version 2.0+** and an [Google PLACE API](https://developers.google.com/places/web-service/get-api-key) key. This plugin is a renderless component. It comes without any css as the main goal is to use it with differents frameworks.
-### 1 Install via npm
+If you looking for framework oriented components, you can import them separately (see ***pre-configured*** section)
+PR are welcome for other components
+
+### Install via npm
```bash
npm install vue-custom-google-autocomplete
yarn add vue-custom-google-autocomplete
```
-### 2 Import and use
+### Import and use
+
+Note: if you want a specific preconfigured component, skit this step and import it as a simple component (see ***pre-configured*** section)
```javascript
import Vue from 'vue'
@@ -26,12 +31,36 @@ import CustomGoogleAutocomplete from 'vue-custom-google-autocomplete'
Vue.use(CustomGoogleAutocomplete)
```
+```vue
+
+
+
+
+ {{ prediction.description }}
+
+
+
+
+
+
+```
+
+
+
## Props
| Name | Type | Default | Description |
|---------------|---------|-------------------------------------------------|--------------------------------------------------------|
| `options` | Object | see options section | Plugin options (see options section) |
-| `value` | String | null | Input value (can be use with v-model) |
You can also pass all props available on an input (placeholder, name..)
@@ -43,9 +72,6 @@ options = {
deepSearch: true,
cors: false,
params: {},
- inputClass: '',
- inputWrapperClass: '',
- mainWrapperClass: '',
focus: false
}
```
@@ -53,16 +79,14 @@ options = {
| Name | Type | Default | Description |
|----------------------|---------|------------------------------|------------------------------------------------------------------------|
| `apiKey` | String | null | Your Google PLACE Api key (REQUIRED) |
-| `deepSearch` | Boolean | true | Get more informations about selected place (geometry etc..) |
+| `deepSearch` | Boolean | false | Get more informations about selected place (geometry etc..) |
| `cors` | Boolean | false | Set to true when project is running locally |
| `params` | Object | {} | Google Autocomplete optional parameters |
-| `inputClass`. | String | '' | Input class to match with |
-| `inputWrapperClass` | String | '' | Input Wrapper class. |
-| `mainWrapperClass` | String | '' | Input Wrapper class |
| `focus` | Boolean | false | Focus input |
| `debounceTime` | Number | 400 | Time in ms before trigger a new Google api call |
Params object is useful to refine predictions, for example if you want to get first predictions near to a location within a radius distance in a certain language you can set params like this :
+
```javascript
params = {
location: `${lat},${lng}`,
@@ -74,32 +98,25 @@ See [Optional parameters](https://developers.google.com/places/web-service/autoc
## Events
-The input part emits three events @blur @focus and @key:value
-All three send the Input Element reference
-@key values are :escape :tab :enter :up :down
+@select event is triggered when a prediction is selected. It send an object with datas about the location
-The results part emits two events @loading and @select
-@loading is triggered when Google API is requested.
-@select is triggered when a prediction is selected it send an object with datas about the location
+## Template and slot-scope
-## Template and slot
-
-In order to be more flexbile, you are able to make your own results template with `slot-scope`
-This template is accessible via the `results` slot
+In order to be more flexbile, you are able to make your own results template with `slot-scope`.
```javascript
props = {
- firstFetch: Boolean,
+ inputAttrs: Object,
+ inputEvents: Object,
query: String,
results: Array,
loading: Boolean,
- selectPrediction: Function
+ selectPrediction: Function,
+ hasResults: Boolean
}
```
-Also two slots are available before and after the input `beforeInput` `afterInput`
-
-## Examples
+## Pre-configured Components
### Bulma dropdown markup.
@@ -108,52 +125,24 @@ Also two slots are available before and after the input `beforeInput` `afterInpu
```vue
-
-
-
-
-
+
```
+To customize loading text and no results text, two slots are availables : `loading` and `empty`.
+Input is binded with `$attrs`
+
-### Bootstrap dropdown markup.
+### Bootstrap dropdown.
```vue
-
-
-
-
-
- No results found for "{{props.query}}"
-
-
-
-
- {{ props.results.length }} results found for "{{props.query}}"
-
-