feat: add search bar to inventory page (#66)
This commit is contained in:
@@ -33,9 +33,36 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Tag Filters -->
|
<!-- Search & Filters -->
|
||||||
<UCard v-if="showFilters" class="mb-6">
|
<UCard v-if="showFilters" class="mb-6 space-y-4">
|
||||||
<TagsTagFilter v-model="selectedTagFilters" />
|
<!-- Search Bar -->
|
||||||
|
<div>
|
||||||
|
<UFormGroup label="Search Items">
|
||||||
|
<UInput
|
||||||
|
v-model="searchQuery"
|
||||||
|
placeholder="Search by item name..."
|
||||||
|
icon="i-heroicons-magnifying-glass"
|
||||||
|
size="lg"
|
||||||
|
:ui="{ icon: { trailing: { pointer: '' } } }"
|
||||||
|
>
|
||||||
|
<template #trailing>
|
||||||
|
<UButton
|
||||||
|
v-if="searchQuery"
|
||||||
|
color="gray"
|
||||||
|
variant="link"
|
||||||
|
icon="i-heroicons-x-mark"
|
||||||
|
:padded="false"
|
||||||
|
@click="searchQuery = ''"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</UInput>
|
||||||
|
</UFormGroup>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Tag Filters -->
|
||||||
|
<div>
|
||||||
|
<TagsTagFilter v-model="selectedTagFilters" />
|
||||||
|
</div>
|
||||||
</UCard>
|
</UCard>
|
||||||
|
|
||||||
<!-- Add Item Form (Overlay) -->
|
<!-- Add Item Form (Overlay) -->
|
||||||
@@ -61,6 +88,7 @@
|
|||||||
ref="inventoryListRef"
|
ref="inventoryListRef"
|
||||||
:refresh="refreshKey"
|
:refresh="refreshKey"
|
||||||
:tag-filters="selectedTagFilters"
|
:tag-filters="selectedTagFilters"
|
||||||
|
:search-query="searchQuery"
|
||||||
@add-item="showAddForm = true"
|
@add-item="showAddForm = true"
|
||||||
@edit-item="editingItem = $event"
|
@edit-item="editingItem = $event"
|
||||||
/>
|
/>
|
||||||
@@ -82,6 +110,7 @@ const refreshKey = ref(0)
|
|||||||
const inventoryListRef = ref()
|
const inventoryListRef = ref()
|
||||||
const prefilledData = ref<any>(null)
|
const prefilledData = ref<any>(null)
|
||||||
const selectedTagFilters = ref<string[]>([])
|
const selectedTagFilters = ref<string[]>([])
|
||||||
|
const searchQuery = ref('')
|
||||||
|
|
||||||
// Handle scan-to-add flow (Issue #25)
|
// Handle scan-to-add flow (Issue #25)
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user