atom-nuxt 1.0.151 → 1.0.152
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json
CHANGED
|
@@ -3,6 +3,25 @@ import { ref, watch } from "vue";
|
|
|
3
3
|
import { useRuntimeConfig } from "nuxt/app";
|
|
4
4
|
import { useDebounceFn } from "@vueuse/core";
|
|
5
5
|
const atomNuxtConfig = useRuntimeConfig().public.atomNuxt;
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
hint: {
|
|
8
|
+
type: String,
|
|
9
|
+
default: "Search by postcode, city or country. You must select an option from the list."
|
|
10
|
+
},
|
|
11
|
+
label: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: "Address search"
|
|
14
|
+
},
|
|
15
|
+
placeholder: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: "Start typing address"
|
|
18
|
+
},
|
|
19
|
+
countries: {
|
|
20
|
+
type: Array,
|
|
21
|
+
default: () => []
|
|
22
|
+
// Example: ['gb', 'fr', 'us']
|
|
23
|
+
}
|
|
24
|
+
});
|
|
6
25
|
const searchText = ref("");
|
|
7
26
|
const addressSearchResults = ref([]);
|
|
8
27
|
const loading = ref(false);
|
|
@@ -18,7 +37,8 @@ const fetchAutocompleteSuggestions = async (query) => {
|
|
|
18
37
|
{
|
|
19
38
|
params: {
|
|
20
39
|
input: query,
|
|
21
|
-
key: atomNuxtConfig.googleMapsApiKey
|
|
40
|
+
key: atomNuxtConfig.googleMapsApiKey,
|
|
41
|
+
components: props.countries.length ? props.countries.map((c) => `country:${c}`).join("|") : void 0
|
|
22
42
|
},
|
|
23
43
|
method: "GET"
|
|
24
44
|
}
|
|
@@ -80,13 +100,13 @@ watch(selectedPlaceId, (newPlaceId) => {
|
|
|
80
100
|
v-model:search="searchText"
|
|
81
101
|
:items="addressSearchResults"
|
|
82
102
|
v-model="selectedPlaceId"
|
|
83
|
-
label="
|
|
103
|
+
:label="label"
|
|
84
104
|
item-title="text"
|
|
85
105
|
item-value="place_id"
|
|
86
|
-
hint="
|
|
106
|
+
:hint="hint"
|
|
87
107
|
:persistent-hint="true"
|
|
88
108
|
:clearable="true"
|
|
89
|
-
placeholder="
|
|
109
|
+
:placeholder="placeholder"
|
|
90
110
|
>
|
|
91
111
|
<template #no-data>
|
|
92
112
|
<v-list-item v-if="loading">
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
|
+
hint: string;
|
|
3
|
+
label: string;
|
|
4
|
+
placeholder: string;
|
|
5
|
+
countries: unknown[];
|
|
6
|
+
$props: any;
|
|
7
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
8
|
export default _default;
|