diff --git a/app/components/catalog/CatalogSearchBar.vue b/app/components/catalog/CatalogSearchBar.vue new file mode 100644 index 0000000..9ebcc40 --- /dev/null +++ b/app/components/catalog/CatalogSearchBar.vue @@ -0,0 +1,159 @@ + + + + + + + + + + + + + {{ filter.label }} + + + + + + + + + + + + + + + + + + + + {{ computedFilterButtonLabel }} + + + + + + + + + {{ filter.label }} + + + + + + + + + {{ displayedCount }} + / {{ totalCount }} + + + + + + + + + {{ currentSortLabel }} + + + + + + + + {{ option.label }} + + + + + + + + diff --git a/app/components/page/CatalogPage.vue b/app/components/page/CatalogPage.vue index 31c2383..f72358d 100644 --- a/app/components/page/CatalogPage.vue +++ b/app/components/page/CatalogPage.vue @@ -12,6 +12,11 @@ + + + + + @@ -197,13 +202,15 @@ const props = withDefaults(defineProps<{ selectedId?: string hoveredId?: string hasSubNav?: boolean + totalCount?: number // Total count for search bar counter (can differ from items.length with pagination) }>(), { loading: false, withMap: true, useServerClustering: false, mapId: 'catalog-map', pointColor: '#3b82f6', - hasSubNav: true + hasSubNav: true, + totalCount: 0 }) // Map positioning - unified height for all pages with map diff --git a/app/pages/catalog/hubs/index.vue b/app/pages/catalog/hubs/index.vue index 2f7ad3d..d41e8cc 100644 --- a/app/pages/catalog/hubs/index.vue +++ b/app/pages/catalog/hubs/index.vue @@ -2,6 +2,7 @@ - - - - - + + + + + + {{ t('catalogHubsSection.filters.transport') }} + + + + {{ filter.label }} + + + + + + + {{ t('catalogHubsSection.filters.country') }} + + + + {{ filter.label }} + + + + + + + @@ -65,6 +102,37 @@ const { const selectedHubId = ref() const hoveredHubId = ref() +// Search bar +const searchQuery = ref('') + +// Active filter badges (non-default filters shown as badges) +const activeFilterBadges = computed(() => { + const badges: { id: string; label: string }[] = [] + if (selectedFilter.value !== 'all') { + const filter = filters.value.find(f => f.id === selectedFilter.value) + if (filter) badges.push({ id: `transport:${filter.id}`, label: filter.label }) + } + if (selectedCountry.value !== 'all') { + const filter = countryFilters.value.find(f => f.id === selectedCountry.value) + if (filter) badges.push({ id: `country:${filter.id}`, label: filter.label }) + } + return badges +}) + +// Remove filter badge +const onRemoveFilter = (id: string) => { + if (id.startsWith('transport:')) { + selectedFilter.value = 'all' + } else if (id.startsWith('country:')) { + selectedCountry.value = 'all' + } +} + +// Search handler (for future use) +const onSearch = () => { + // TODO: Implement search by hub name +} + const onSelectHub = (hub: any) => { selectedHubId.value = hub.uuid } diff --git a/i18n/locales/en/catalogHubsSection.json b/i18n/locales/en/catalogHubsSection.json index 2ba686d..953a2d7 100644 --- a/i18n/locales/en/catalogHubsSection.json +++ b/i18n/locales/en/catalogHubsSection.json @@ -15,7 +15,9 @@ "auto": "Auto", "rail": "Rail", "sea": "Sea", - "air": "Air" + "air": "Air", + "transport": "Transport type", + "country": "Country" } } } diff --git a/i18n/locales/en/common.json b/i18n/locales/en/common.json index ba71cee..1ac30e6 100644 --- a/i18n/locales/en/common.json +++ b/i18n/locales/en/common.json @@ -25,6 +25,11 @@ "theme_light": "Light mode", "values": { "not_available": "Not available" + }, + "searchBar": { + "placeholder": "Search...", + "filters": "Filters", + "sort": "Sort" } }, "units": { diff --git a/i18n/locales/ru/catalogHubsSection.json b/i18n/locales/ru/catalogHubsSection.json index 0078eff..ced1cae 100644 --- a/i18n/locales/ru/catalogHubsSection.json +++ b/i18n/locales/ru/catalogHubsSection.json @@ -15,7 +15,9 @@ "auto": "Авто", "rail": "Ж/д", "sea": "Море", - "air": "Авиа" + "air": "Авиа", + "transport": "Тип транспорта", + "country": "Страна" } } } diff --git a/i18n/locales/ru/common.json b/i18n/locales/ru/common.json index 7423976..1cf0cb1 100644 --- a/i18n/locales/ru/common.json +++ b/i18n/locales/ru/common.json @@ -25,6 +25,11 @@ "theme_light": "Светлая тема", "values": { "not_available": "Нет данных" + }, + "searchBar": { + "placeholder": "Поиск...", + "filters": "Фильтры", + "sort": "Сортировка" } }, "units": {