2023-06-28 19:05:46 +02:00
|
|
|
<script setup lang="ts">
|
|
|
|
import { updateSearch } from '@/stores';
|
|
|
|
import { onUpdated, ref } from 'vue';
|
|
|
|
|
|
|
|
let searchValue = ref('')
|
|
|
|
let searchType = ref('')
|
2023-06-29 10:29:26 +02:00
|
|
|
|
2023-06-28 19:05:46 +02:00
|
|
|
function submit(type: string) { searchType = ref(type) }
|
|
|
|
onUpdated(() => updateSearch(searchValue, searchType))
|
2023-06-07 17:31:37 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2023-06-16 15:27:12 +02:00
|
|
|
<form class="sticky top-0 flex flex-row place-content-center">
|
2023-06-29 10:55:32 +02:00
|
|
|
<label class="hidden" for="searchBar">Suche</label>
|
2023-06-14 18:12:42 +02:00
|
|
|
<div class="flex flex-row w-full max-w-5xl">
|
|
|
|
<input
|
2023-06-29 10:55:32 +02:00
|
|
|
id="searchBar"
|
2023-06-16 21:09:51 +02:00
|
|
|
class="p-6 grow bg-transparent placeholder:text-text-300 dark:placeholder:text-text-700 text-2xl text-center focus-visible:outline focus-visible:outline-current"
|
2023-06-14 18:12:42 +02:00
|
|
|
type="search"
|
2023-06-16 21:08:16 +02:00
|
|
|
placeholder="z. B. Thema, Name, VII-EF-08640, …"
|
2023-06-28 19:05:46 +02:00
|
|
|
v-model="searchValue"
|
2023-06-14 18:12:42 +02:00
|
|
|
@keyup.alt.enter.exact="submit('assist')"
|
|
|
|
@keyup.enter.exact="submit('filter')"
|
|
|
|
/>
|
|
|
|
<div class="flex flex-row p-4 place-content-center">
|
|
|
|
<button
|
2023-06-16 15:27:12 +02:00
|
|
|
class="py-2 px-4 bg-primary-button-500 hover:bg-primary-button-600 rounded-l-lg text-white"
|
2023-06-14 18:12:42 +02:00
|
|
|
@click.prevent="submit('filter')"
|
|
|
|
aria-keyshortcuts="Enter"
|
2023-06-16 15:25:01 +02:00
|
|
|
>Suchen
|
2023-06-14 18:12:42 +02:00
|
|
|
</button>
|
|
|
|
<button
|
2023-06-16 15:27:12 +02:00
|
|
|
class="py-2 px-4 bg-secondary-button-500 hover:bg-secondary-button-600 rounded-r-lg text-white"
|
2023-06-14 18:12:42 +02:00
|
|
|
@click.prevent="submit('assist')"
|
|
|
|
aria-keyshortcuts="Alt+Enter"
|
|
|
|
title="Tastenkürzel: Alt + Enter"
|
2023-06-16 15:25:01 +02:00
|
|
|
>Fragen
|
2023-06-14 18:12:42 +02:00
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-06-11 16:50:44 +02:00
|
|
|
</form>
|
2023-06-07 17:31:37 +02:00
|
|
|
</template>
|