Add hoveredId to all catalog pages for map point highlighting
All checks were successful
Build Docker Image / build (push) Successful in 3m46s

When hovering over a card on the left, the corresponding point
on the map now shows a blue highlight.
This commit is contained in:
Ruslan Bakiev
2026-01-19 13:01:57 +07:00
parent 825128e349
commit d8befc8b9f
7 changed files with 27 additions and 0 deletions

View File

@@ -7,6 +7,8 @@
with-map with-map
map-id="hub-products-map" map-id="hub-products-map"
point-color="#10b981" point-color="#10b981"
:hovered-id="hoveredId"
@update:hovered-id="hoveredId = $event"
> >
<template #searchBar="{ displayedCount, totalCount }"> <template #searchBar="{ displayedCount, totalCount }">
<CatalogSearchBar <CatalogSearchBar
@@ -52,6 +54,7 @@ const localePath = useLocalePath()
const { t } = useI18n() const { t } = useI18n()
const isLoading = ref(true) const isLoading = ref(true)
const hoveredId = ref<string>()
const hub = ref<any>(null) const hub = ref<any>(null)
const products = ref<Array<{ uuid: string; name: string }>>([]) const products = ref<Array<{ uuid: string; name: string }>>([])

View File

@@ -8,7 +8,9 @@
map-id="hubs-map" map-id="hubs-map"
point-color="#10b981" point-color="#10b981"
:total-count="total" :total-count="total"
:hovered-id="hoveredId"
@select="onSelectHub" @select="onSelectHub"
@update:hovered-id="hoveredId = $event"
> >
<template #searchBar="{ displayedCount, totalCount }"> <template #searchBar="{ displayedCount, totalCount }">
<CatalogSearchBar <CatalogSearchBar
@@ -102,6 +104,9 @@ const {
init init
} = useCatalogHubs() } = useCatalogHubs()
// Hover state
const hoveredId = ref<string>()
// Search bar // Search bar
const searchQuery = ref('') const searchQuery = ref('')

View File

@@ -8,7 +8,9 @@
cluster-node-type="logistics" cluster-node-type="logistics"
map-id="offers-product-hubs-map" map-id="offers-product-hubs-map"
point-color="#10b981" point-color="#10b981"
:hovered-id="hoveredId"
@select="onSelectHub" @select="onSelectHub"
@update:hovered-id="hoveredId = $event"
> >
<template #searchBar="{ displayedCount, totalCount }"> <template #searchBar="{ displayedCount, totalCount }">
<CatalogSearchBar <CatalogSearchBar
@@ -53,6 +55,7 @@ const localePath = useLocalePath()
const { t } = useI18n() const { t } = useI18n()
const isLoading = ref(true) const isLoading = ref(true)
const hoveredId = ref<string>()
const product = ref<{ uuid: string; name: string } | null>(null) const product = ref<{ uuid: string; name: string } | null>(null)
const hubs = ref<Array<{ uuid: string; name: string; latitude?: number; longitude?: number; country?: string; countryCode?: string }>>([]) const hubs = ref<Array<{ uuid: string; name: string; latitude?: number; longitude?: number; country?: string; countryCode?: string }>>([])

View File

@@ -8,6 +8,8 @@
cluster-node-type="offer" cluster-node-type="offer"
map-id="offers-products-map" map-id="offers-products-map"
point-color="#22c55e" point-color="#22c55e"
:hovered-id="hoveredId"
@update:hovered-id="hoveredId = $event"
> >
<template #searchBar> <template #searchBar>
<CatalogSearchBar <CatalogSearchBar
@@ -44,6 +46,9 @@ const { t } = useI18n()
const { items: products, isLoading, init } = useCatalogProducts() const { items: products, isLoading, init } = useCatalogProducts()
// Hover state
const hoveredId = ref<string>()
// Search // Search
const searchQuery = ref('') const searchQuery = ref('')

View File

@@ -6,7 +6,9 @@
with-map with-map
map-id="supplier-product-hubs-map" map-id="supplier-product-hubs-map"
point-color="#10b981" point-color="#10b981"
:hovered-id="hoveredId"
@select="onSelectHub" @select="onSelectHub"
@update:hovered-id="hoveredId = $event"
> >
<template #searchBar="{ displayedCount, totalCount }"> <template #searchBar="{ displayedCount, totalCount }">
<CatalogSearchBar <CatalogSearchBar
@@ -68,6 +70,7 @@ const localePath = useLocalePath()
const { t } = useI18n() const { t } = useI18n()
const isLoading = ref(true) const isLoading = ref(true)
const hoveredId = ref<string>()
const supplier = ref<any>(null) const supplier = ref<any>(null)
const product = ref<{ uuid: string; name: string } | null>(null) const product = ref<{ uuid: string; name: string } | null>(null)
const sourceLocation = ref<{ uuid: string; name: string } | null>(null) const sourceLocation = ref<{ uuid: string; name: string } | null>(null)

View File

@@ -7,6 +7,8 @@
with-map with-map
map-id="supplier-products-map" map-id="supplier-products-map"
point-color="#3b82f6" point-color="#3b82f6"
:hovered-id="hoveredId"
@update:hovered-id="hoveredId = $event"
> >
<template #searchBar="{ displayedCount, totalCount }"> <template #searchBar="{ displayedCount, totalCount }">
<CatalogSearchBar <CatalogSearchBar
@@ -57,6 +59,7 @@ const localePath = useLocalePath()
const { t } = useI18n() const { t } = useI18n()
const isLoading = ref(true) const isLoading = ref(true)
const hoveredId = ref<string>()
const supplier = ref<any>(null) const supplier = ref<any>(null)
const offers = ref<any[]>([]) const offers = ref<any[]>([])

View File

@@ -7,7 +7,9 @@
map-id="suppliers-map" map-id="suppliers-map"
point-color="#3b82f6" point-color="#3b82f6"
:total-count="total" :total-count="total"
:hovered-id="hoveredId"
@select="onSelectSupplier" @select="onSelectSupplier"
@update:hovered-id="hoveredId = $event"
> >
<template #searchBar="{ displayedCount, totalCount }"> <template #searchBar="{ displayedCount, totalCount }">
<CatalogSearchBar <CatalogSearchBar
@@ -66,6 +68,9 @@ const {
init init
} = useCatalogSuppliers() } = useCatalogSuppliers()
// Hover state
const hoveredId = ref<string>()
// Search bar // Search bar
const searchQuery = ref('') const searchQuery = ref('')