|
1 | 1 | <template> |
2 | | - <v-sheet class="searchContainer"> |
3 | | - <v-autocomplete |
4 | | - v-model="model" |
5 | | - v-model:search="search" |
6 | | - auto-select-first |
7 | | - class="rounded" |
8 | | - clearable |
9 | | - :custom-filter="filter" |
10 | | - density="compact" |
11 | | - hide-details |
12 | | - hide-no-data |
13 | | - item-title="properties.name" |
14 | | - :items="items" |
15 | | - label="Ort, Adresse, Flurname,..." |
16 | | - :loading="!!abortController" |
17 | | - :prepend-inner-icon="mdiMagnify" |
18 | | - return-object |
19 | | - single-line |
20 | | - variant="outlined" |
21 | | - @blur="handleInfoVisibility(false)" |
22 | | - @click:clear="clear" |
23 | | - @focus="handleInfoVisibility(true)" |
24 | | - > |
25 | | - <template #item="{ props, item }"> |
26 | | - <v-list-item |
27 | | - v-bind="props" |
28 | | - :subtitle="item.raw.type" |
29 | | - :title="item.raw.properties.name" |
30 | | - ></v-list-item> |
31 | | - </template> |
32 | | - </v-autocomplete> |
33 | | - <v-expand-transition> |
34 | | - <v-card v-show="showInfo"> |
35 | | - <v-card-title> |
36 | | - <v-icon :icon="mdiInformationOutline" size="small" /> |
37 | | - Ortssuche |
38 | | - </v-card-title> |
39 | | - <v-card-subtitle> |
40 | | - Die Suche des |
41 | | - <a href="https://kataster.bev.gv.at" target="_blank" |
42 | | - >Österreichischen Katasters</a |
43 | | - ><br /> |
44 | | - Suche nach Orten, Adressen, und mehr |
45 | | - </v-card-subtitle> |
46 | | - <v-card-text> |
47 | | - <v-timeline align="start" density="compact" line-thickness="0"> |
48 | | - <v-timeline-item |
49 | | - v-for="(helpItem, key) in helpItems" |
50 | | - :key="key" |
51 | | - density="compact" |
52 | | - dot-color="success" |
53 | | - :icon="mdiTextSearchVariant" |
54 | | - > |
55 | | - <div> |
56 | | - <div class="font-weight-normal"> |
57 | | - <strong> {{ helpItem.name }}</strong> |
58 | | - </div> |
59 | | - {{ helpItem.example }} |
| 2 | + <v-autocomplete |
| 3 | + ref="autocompleteRef" |
| 4 | + v-model="model" |
| 5 | + v-model:search="search" |
| 6 | + auto-select-first |
| 7 | + class="rounded" |
| 8 | + clearable |
| 9 | + :custom-filter="filter" |
| 10 | + density="compact" |
| 11 | + hide-details |
| 12 | + hide-no-data |
| 13 | + item-title="properties.name" |
| 14 | + :items="items" |
| 15 | + label="Ort, Adresse, Flurname,..." |
| 16 | + :loading="!!abortController" |
| 17 | + min-width="280" |
| 18 | + :prepend-inner-icon="mdiMagnify" |
| 19 | + return-object |
| 20 | + single-line |
| 21 | + variant="outlined" |
| 22 | + @click:clear="clear" |
| 23 | + @focus="handleInfoVisibility(true)" |
| 24 | + > |
| 25 | + <template #item="{ props, item }"> |
| 26 | + <v-list-item |
| 27 | + v-bind="props" |
| 28 | + :id="item.raw.id" |
| 29 | + :key="item.raw.id" |
| 30 | + :subtitle="item.raw.type" |
| 31 | + :title="item.raw.properties.name" |
| 32 | + :value="item.raw.id" |
| 33 | + ></v-list-item> |
| 34 | + </template> |
| 35 | + </v-autocomplete> |
| 36 | + |
| 37 | + <v-menu v-model="showInfo" :target="autocompleteRef"> |
| 38 | + <v-card> |
| 39 | + <v-card-title> |
| 40 | + <v-icon :icon="mdiInformationOutline" size="small" /> |
| 41 | + Ortssuche |
| 42 | + </v-card-title> |
| 43 | + <v-card-subtitle> |
| 44 | + Die Suche des |
| 45 | + <a href="https://kataster.bev.gv.at" target="_blank" |
| 46 | + >Österreichischen Katasters</a |
| 47 | + ><br /> |
| 48 | + Suche nach Orten, Adressen, und mehr |
| 49 | + </v-card-subtitle> |
| 50 | + <v-card-text> |
| 51 | + <v-timeline align="start" density="compact" line-thickness="0"> |
| 52 | + <v-timeline-item |
| 53 | + v-for="(helpItem, key) in helpItems" |
| 54 | + :key="key" |
| 55 | + density="compact" |
| 56 | + dot-color="success" |
| 57 | + :icon="mdiTextSearchVariant" |
| 58 | + > |
| 59 | + <div> |
| 60 | + <div class="font-weight-normal"> |
| 61 | + <strong> {{ helpItem.name }}</strong> |
60 | 62 | </div> |
61 | | - </v-timeline-item> |
62 | | - </v-timeline> |
63 | | - </v-card-text> |
64 | | - </v-card> |
65 | | - </v-expand-transition> |
66 | | - </v-sheet> |
| 63 | + {{ helpItem.example }} |
| 64 | + </div> |
| 65 | + </v-timeline-item> |
| 66 | + </v-timeline> |
| 67 | + </v-card-text> |
| 68 | + </v-card> |
| 69 | + </v-menu> |
67 | 70 | </template> |
68 | 71 |
|
69 | 72 | <script setup> |
@@ -94,6 +97,7 @@ import { |
94 | 97 | * @property {string} id |
95 | 98 | */ |
96 | 99 |
|
| 100 | +const autocompleteRef = ref(null); |
97 | 101 | const { result } = usePlaceSearch(); |
98 | 102 | const emit = defineEmits(['result']); |
99 | 103 |
|
@@ -215,9 +219,3 @@ function handleInfoVisibility(visible) { |
215 | 219 | } |
216 | 220 | } |
217 | 221 | </script> |
218 | | -
|
219 | | -<style scoped> |
220 | | -.searchContainer { |
221 | | - position: relative; |
222 | | -} |
223 | | -</style> |
0 commit comments