<template>
<input
type="text"
- class="w-full rounded border border-theme-border px-3 py-2 focus:outline-none focus:ring-1 dark:bg-theme-background-elevated"
- placeholder="Search"
+ class="w-full rounded-md border border-theme-border px-3 py-2 focus:outline-none dark:bg-theme-background-elevated"
v-model="model"
ref="input"
/>
const model = defineModel();
const input = ref();
-
-function focus() {
- input.value.focus();
-}
-
-defineExpose({ focus });
</script>
<template>
- <form class="flex w-full" @submit.prevent="search">
- <TextInput
+ <form
+ class="flex w-full rounded-md border border-theme-border bg-theme-background px-3 py-2 dark:bg-theme-background-elevated"
+ @submit.prevent="search"
+ >
+ <IconLabel :iconPath="mdilMagnify" class="mr-2" />
+ <input
+ type="text"
v-model="searchTerm"
v-focus
- :placeholder="props.hidePlaceholder ? '' : 'Search'"
- class="rounded-r-none"
- />
- <CustomButton
- :iconPath="mdilMagnify"
- iconSize="1.75em"
- class="rounded-l-none border border-l-0 border-theme-border focus:outline-none focus:ring-1"
+ class="w-full focus:outline-none"
+ placeholder="Search"
/>
</form>
</template>
import { useRouter } from "vue-router";
import * as constants from "../constants";
-import CustomButton from "../components/CustomButton.vue";
-import TextInput from "../components/TextInput.vue";
+import IconLabel from "../components/IconLabel.vue";
import { getToastOptions } from "../helpers.js";
const props = defineProps({
initialSearchTerm: String,
- hidePlaceholder: Boolean,
});
const emit = defineEmits(["search"]);
<template>
- <Modal v-model="isVisible" title="Search">
+ <Modal v-model="isVisible" class="px-0 py-0 border-none">
<SearchInput
+ class="px-5 py-4"
@search="toggleHandler"
@keyup.esc="toggleHandler"
- class="mb-4"
- hidePlaceholder
/>
- <div class="flex justify-end">
- <CustomButton label="Close" @click="toggleHandler" />
- </div>
</Modal>
</template>
<script setup>
-import CustomButton from "../components/CustomButton.vue";
import Modal from "../components/Modal.vue";
import SearchInput from "./SearchInput.vue";