Replace breadcrumbs with key-value badges in search bar
All checks were successful
Build Docker Image / build (push) Successful in 4m0s

- Add key property to FilterOption interface in CatalogSearchBar
- Display badges in "Key: Value" format (e.g., "Поставщик: Name")
- Remove SuppliersBreadcrumbs from supplier catalog pages
- Add navigationFilters computed with supplier/product/hub badges
- Add handleRemoveFilter to navigate back when badge is clicked
This commit is contained in:
Ruslan Bakiev
2026-01-19 11:09:58 +07:00
parent bfbab9cef4
commit 0a79b90d1c
4 changed files with 116 additions and 22 deletions

View File

@@ -11,8 +11,10 @@
<template #searchBar="{ displayedCount, totalCount }">
<CatalogSearchBar
v-model:search-query="searchQuery"
:active-filters="navigationFilters"
:displayed-count="displayedCount"
:total-count="totalCount"
@remove-filter="handleRemoveFilter"
/>
</template>
@@ -33,9 +35,6 @@
<!-- Content Header -->
<Stack v-else gap="4">
<!-- Breadcrumbs -->
<SuppliersBreadcrumbs :supplier-id="supplierId" :supplier-name="supplier?.name" />
<!-- Header with supplier info -->
<div class="flex items-start gap-4">
<!-- Logo -->
@@ -100,6 +99,28 @@ const offers = ref<any[]>([])
const supplierId = computed(() => route.params.supplierId as string)
// Navigation filters for search bar badges
const navigationFilters = computed(() => {
const filters: Array<{ id: string; label: string; key: string }> = []
if (supplier.value?.name) {
filters.push({
id: 'supplier',
key: 'Поставщик',
label: supplier.value.name
})
}
return filters
})
// Handle removing navigation filter (navigate back)
const handleRemoveFilter = (filterId: string) => {
if (filterId === 'supplier') {
navigateTo(localePath('/catalog/suppliers'))
}
}
// Search
const searchQuery = ref('')