atom-nuxt 1.0.150 → 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 +1 -1
- package/dist/runtime/components/CrudAddressSearchField.vue +26 -4
- package/dist/runtime/components/CrudAddressSearchField.vue.d.ts +7 -1
- package/dist/runtime/components/CrudListLoader.vue +5 -1
- package/dist/runtime/components/CrudListLoader.vue.d.ts +1 -0
- package/dist/runtime/components/CrudUploadField.vue +1 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -3,11 +3,31 @@ 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);
|
|
9
28
|
const selectedPlaceId = ref(null);
|
|
10
29
|
const model = defineModel();
|
|
30
|
+
const placeModel = defineModel("place");
|
|
11
31
|
const fetchAutocompleteSuggestions = async (query) => {
|
|
12
32
|
if (!query || loading.value) return;
|
|
13
33
|
loading.value = true;
|
|
@@ -17,7 +37,8 @@ const fetchAutocompleteSuggestions = async (query) => {
|
|
|
17
37
|
{
|
|
18
38
|
params: {
|
|
19
39
|
input: query,
|
|
20
|
-
key: atomNuxtConfig.googleMapsApiKey
|
|
40
|
+
key: atomNuxtConfig.googleMapsApiKey,
|
|
41
|
+
components: props.countries.length ? props.countries.map((c) => `country:${c}`).join("|") : void 0
|
|
21
42
|
},
|
|
22
43
|
method: "GET"
|
|
23
44
|
}
|
|
@@ -54,6 +75,7 @@ const fetchPlaceId = async (placeId) => {
|
|
|
54
75
|
}
|
|
55
76
|
);
|
|
56
77
|
if (result.status === "OK") {
|
|
78
|
+
placeModel.value = result.result;
|
|
57
79
|
model.value = `${result.result.geometry.location.lat},${result.result.geometry.location.lng}`;
|
|
58
80
|
} else {
|
|
59
81
|
console.error("Error fetching place details:", result.status);
|
|
@@ -78,13 +100,13 @@ watch(selectedPlaceId, (newPlaceId) => {
|
|
|
78
100
|
v-model:search="searchText"
|
|
79
101
|
:items="addressSearchResults"
|
|
80
102
|
v-model="selectedPlaceId"
|
|
81
|
-
label="
|
|
103
|
+
:label="label"
|
|
82
104
|
item-title="text"
|
|
83
105
|
item-value="place_id"
|
|
84
|
-
hint="
|
|
106
|
+
:hint="hint"
|
|
85
107
|
:persistent-hint="true"
|
|
86
108
|
:clearable="true"
|
|
87
|
-
placeholder="
|
|
109
|
+
:placeholder="placeholder"
|
|
88
110
|
>
|
|
89
111
|
<template #no-data>
|
|
90
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;
|
|
@@ -9,6 +9,10 @@ const props = defineProps({
|
|
|
9
9
|
type: Boolean,
|
|
10
10
|
default: false
|
|
11
11
|
},
|
|
12
|
+
disableNoResults: {
|
|
13
|
+
type: Boolean,
|
|
14
|
+
default: false
|
|
15
|
+
},
|
|
12
16
|
path: {
|
|
13
17
|
type: String,
|
|
14
18
|
required: true
|
|
@@ -104,7 +108,7 @@ onBeforeUnmount(() => {
|
|
|
104
108
|
<slot v-if="hasListErrors" name="errors">
|
|
105
109
|
<crud-error-display :errors="listErrors"/>
|
|
106
110
|
</slot>
|
|
107
|
-
<slot v-if="!listPending && totalItems === 0" name="empty">
|
|
111
|
+
<slot v-if="!listPending && totalItems === 0 && !disableNoResults" name="empty">
|
|
108
112
|
<v-alert icon="mdi-playlist-remove" type="info" >
|
|
109
113
|
{{ noResultsText }}
|
|
110
114
|
</v-alert>
|
|
@@ -151,7 +151,7 @@ watch(() => fileToUpload.value, () => {
|
|
|
151
151
|
<div>
|
|
152
152
|
<div v-if="title" style="font-size: 12px;" class="text-grey-darken-2 mb-1">{{ title }}</div>
|
|
153
153
|
|
|
154
|
-
<div
|
|
154
|
+
<div class="mb-3">
|
|
155
155
|
<v-btn :disabled="disabled" @click="dialog = true" size="small" color="success">
|
|
156
156
|
Select Media
|
|
157
157
|
</v-btn>
|