Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
dc27730
refactor: extract search dropdown into separate component
goldenmaya Oct 30, 2025
08e0a15
fix: update BEM class names in search dropdown component
goldenmaya Oct 30, 2025
7461e66
feat: update layout
goldenmaya Oct 31, 2025
c1c4aef
Merge branch 'dev' into feat/VCST-3361-search-dropdown
goldenmaya Nov 5, 2025
344b5ad
refactor: reorganize search components and encapsulate logic in Searc…
goldenmaya Nov 5, 2025
26b86d5
Merge branch 'dev' into feat/VCST-3361-search-dropdown
goldenmaya Nov 18, 2025
922da3e
refactor: styles
goldenmaya Nov 19, 2025
2a4682f
Merge branch 'dev' into feat/VCST-3361-search-dropdown
goldenmaya Nov 19, 2025
9f3fb44
feat: bring the mobile search bar to a separate component
goldenmaya Nov 19, 2025
35970be
feat: update colors
goldenmaya Nov 19, 2025
623537b
refactor: components
goldenmaya Nov 19, 2025
b21c8d6
fix: icon
goldenmaya Nov 19, 2025
e8bc67d
feat: update item
goldenmaya Nov 19, 2025
666a1a6
refactor: items
goldenmaya Nov 19, 2025
f42118b
fix: some fixes
goldenmaya Nov 19, 2025
9984ce1
fix: mobile grid
goldenmaya Nov 19, 2025
04b7d92
fix: styles
goldenmaya Nov 19, 2025
25e463f
Merge branch 'dev' into feat/VCST-3361-search-dropdown
goldenmaya Nov 19, 2025
f2e7ad7
Merge branch 'dev' into feat/VCST-3361-search-dropdown
goldenmaya Nov 19, 2025
4238069
Merge branch 'dev' into feat/VCST-3361-search-dropdown
goldenmaya Nov 20, 2025
b37a222
feat: mobile styles & animation
goldenmaya Nov 20, 2025
0e24d4d
refactor: refactor
goldenmaya Nov 20, 2025
b5532cc
refactor: logic
goldenmaya Nov 20, 2025
4d1b67c
refactor: and fixes
goldenmaya Nov 21, 2025
1585d42
feat: update locales
goldenmaya Nov 21, 2025
349d36d
feat: update color presets
goldenmaya Nov 21, 2025
92b7a20
fix: sonar issues
goldenmaya Nov 21, 2025
184aa1a
fix: sonar issues
goldenmaya Nov 21, 2025
b2ea1fd
feat: implement scrollbars
goldenmaya Nov 21, 2025
1cfed2f
fix: minor fixes
goldenmaya Nov 21, 2025
824f8af
feat: add transition
goldenmaya Nov 21, 2025
599bff7
fix: minor changes
goldenmaya Nov 21, 2025
9b784c8
refactor: minor refactoring
goldenmaya Nov 24, 2025
af09831
Merge branch 'dev' into feat/VCST-3361-search-dropdown
Aleksandra-Mitricheva Nov 25, 2025
485f3d8
Merge branch 'dev' into feat/VCST-3361-search-dropdown
goldenmaya Nov 28, 2025
cb83291
refactor: conditions
goldenmaya Nov 28, 2025
66830d2
feat: update inStock filters
goldenmaya Nov 28, 2025
e2489df
refactor: move search-bar to internal folder
goldenmaya Nov 28, 2025
e2e37b3
fix: clear search result on mobile view
goldenmaya Nov 28, 2025
a04498b
fix: trimmed search phrase
goldenmaya Nov 28, 2025
a8e2769
feat: add note
goldenmaya Nov 28, 2025
507089e
fix: mobile issue
goldenmaya Nov 28, 2025
ac3987f
refactor: centralize maxSearchLength constant
goldenmaya Nov 28, 2025
ce589bb
fix: keep SearchDropdown mounted to preserve ref access
goldenmaya Nov 28, 2025
af32320
Merge branch 'dev' into feat/VCST-3361-search-dropdown
goldenmaya Nov 28, 2025
d00c07b
Merge branch 'dev' into feat/VCST-3361-search-dropdown
goldenmaya Nov 28, 2025
327a897
fix: barcode scan
goldenmaya Nov 28, 2025
166bc8a
fix: do not clear search input on close
goldenmaya Nov 28, 2025
757ede7
Merge branch 'dev' into feat/VCST-3361-search-dropdown
goldenmaya Dec 1, 2025
5dd4dce
feat: update locales
goldenmaya Dec 1, 2025
aafd11c
fix: mobile hide search dropdown
goldenmaya Dec 1, 2025
5b81b8f
fix: mobile & desktop
goldenmaya Dec 1, 2025
c15c1cb
Merge branch 'dev' into feat/VCST-3361-search-dropdown
goldenmaya Dec 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions client-app/assets/presets/black-gold.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@
"color_mobile_menu_navigation": "#e0c287",
"color_mobile_menu_control": "#ad863f",

"color_mobile_search_bar_bg": "#78591f",

"color_header_top_bg": "#ffffff",
"color_header_top_text": "#141517",
"color_header_top_link": "#867d7a",
Expand Down
2 changes: 0 additions & 2 deletions client-app/assets/presets/coffee.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@
"color_mobile_menu_navigation": "#b08878",
"color_mobile_menu_control": "#996c5a",

"color_mobile_search_bar_bg": "#283034",

"color_header_top_bg": "#3d2b24",
"color_header_top_text": "#ffffff",
"color_header_top_link": "#c4a79b",
Expand Down
2 changes: 0 additions & 2 deletions client-app/assets/presets/purple-pink.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@
"color_mobile_menu_navigation": "#d84786",
"color_mobile_active_control": "#d84786",

"color_mobile_search_bar_bg": "#322252",

"color_header_top_bg": "#ffffff",
"color_header_top_text": "#322252",
"color_header_top_link": "#306ac2",
Expand Down
2 changes: 0 additions & 2 deletions client-app/assets/presets/watermelon.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@
"color_mobile_menu_navigation": "#aeb85f",
"color_mobile_menu_control": "#aeb85f",

"color_mobile_search_bar_bg": "#484d22",

"color_header_top_bg": "#332829",
"color_header_top_text": "#ffffff",
"color_header_top_link": "#d4c9c9",
Expand Down
2 changes: 1 addition & 1 deletion client-app/assets/styles/_colors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
--footer-bottom-link-hover-color: var(--color-footer-bottom-link-hover, var(--color-additional-50));
--footer-bottom-link-active-color: var(--color-footer-bottom-link-active, var(--color-additional-50));

--mobile-search-bar-bg: var(--color-mobile-search-bar-bg, var(--color-secondary-800));
--mobile-search-bar-bg: var(--color-mobile-search-bar-bg, var(--color-additional-50));

--mobile-menu-bg-color: var(--color-mobile-menu-bg, var(--color-secondary-900));
--mobile-menu-text-color: var(--color-mobile-menu-text, var(--color-additional-50));
Expand Down
11 changes: 8 additions & 3 deletions client-app/shared/catalog/components/category.vue
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,10 @@ function isRouteLocationRaw(value: unknown): value is RouteLocationRaw {
whenever(() => !isMobile.value, hideFiltersSidebar);
const { addScopeItem, removeScopeItemByType, setQueryScope, preparingScope } = useSearchScore();

const { clearSearchResults } = useSearchBar();

const isMobileLg = breakpoints.smaller("lg");

watch(
() => props.categoryId,
async (categoryId) => {
Expand Down Expand Up @@ -665,8 +669,6 @@ watchDebounced(
},
);

const { clearSearchResults } = useSearchBar();

function changeSearchBarScope(categoryId: string, label?: string) {
clearCategoryScope();

Expand All @@ -689,7 +691,10 @@ onBeforeUnmount(() => {

function clearCategoryScope() {
removeScopeItemByType("category");
clearSearchResults();

if (!isMobileLg.value) {
clearSearchResults();
}
}

onMounted(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ import { computed, nextTick, ref, shallowRef, watch } from "vue";
import { useRoute, useRouter } from "vue-router";
import { useNavigations, useWhiteLabeling } from "@/core/composables";
import { useUser } from "@/shared/account/composables/useUser";
import { SearchBar } from "@/shared/layout";
import CatalogMenu from "./catalog-menu.vue";
import SearchBar from "./search-bar/search-bar.vue";
import type { StyleValue } from "vue";
import LinkDefault from "@/shared/layout/components/header/_internal/link-components/link-default.vue";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@
<ShipToSelector />
</div>

<div class="relative z-[1] bg-[--header-bottom-bg-color]">
<div class="relative z-[1]">
<!-- region Default slot -->
<transition :name="isAnimated ? 'slide-fade-top' : ''" mode="out-in">
<div v-if="customSlots.default">
<div v-if="customSlots.default" class="relative z-20 bg-[--header-bottom-bg-color]">
<component :is="customSlots.default" />
</div>

<div v-else class="relative z-10 flex h-14 w-full items-center justify-between gap-x-2 sm:gap-x-6">
<div
v-else
class="relative z-20 flex h-14 w-full items-center justify-between gap-x-2 border-b bg-[--header-bottom-bg-color] sm:gap-x-6"
>
<!-- region Left slot -->
<component :is="customSlots.left" v-if="customSlots.left" />

Expand Down Expand Up @@ -91,29 +94,8 @@
<!-- endregion Default slot -->

<!-- region Mobile Search Bar -->
<div v-show="searchBarVisible" class="flex select-none items-center bg-[--mobile-search-bar-bg] p-4">
<VcInput
v-model="searchPhrase"
type="search"
maxlength="64"
:placeholder="$t('shared.layout.header.mobile.search_bar.input_placeholder')"
class="mr-4 grow"
:clearable="!!searchPhrase"
no-border
@clear="reset"
@keydown.enter="handleSearch"
>
<template #append>
<BarcodeScanner v-if="!searchPhrase" @scanned-code="onBarcodeScanned" />
</template>
</VcInput>

<VcButton :to="searchPhrase && searchPageLink" icon="search" />

<button type="button" class="-mr-2 ml-2 h-11 appearance-none px-3" @click="hideSearchBar">
<VcIcon name="delete-thin" class="fill-additional-50" />
</button>
</div>
<MobileSearchBar :visible="searchBarVisible" />
<!-- endregion Mobile Search Bar -->
</div>
</header>

Expand All @@ -137,84 +119,39 @@
</template>

<script setup lang="ts">
import { syncRefs, useElementSize, useScrollLock, whenever } from "@vueuse/core";
import { syncRefs, useElementSize, useScrollLock } from "@vueuse/core";
import { computed, ref } from "vue";
import { useRouter } from "vue-router";
import { useRouteQueryParam, useWhiteLabeling } from "@/core/composables";
import { useHistoricalEvents } from "@/core/composables/useHistoricalEvents";
import { useWhiteLabeling } from "@/core/composables";
import { useModuleSettings } from "@/core/composables/useModuleSettings";
import { MODULE_XAPI_KEYS } from "@/core/constants/modules";
import { QueryParamName } from "@/core/enums";
import { ROUTES } from "@/router/routes/constants";
import { useShortCart } from "@/shared/cart";
import { useNestedMobileHeader } from "@/shared/layout";
import { useSearchBar } from "@/shared/layout/composables/useSearchBar";
import { useSearchScore } from "@/shared/layout/composables/useSearchScore";
import { ShipToSelector } from "@/shared/ship-to-location";
import MobileMenu from "./mobile-menu/mobile-menu.vue";
import MobileSearchBar from "./mobile-search-bar.vue";
import type { StyleValue } from "vue";
import type { RouteLocationRaw } from "vue-router";
import BarcodeScanner from "@/shared/layout/components/search-bar/barcode-scanner.vue";

const router = useRouter();

const searchPhrase = ref("");
const searchPhraseInUrl = useRouteQueryParam<string>(QueryParamName.SearchPhrase);
const mobileMenuVisible = ref(false);
const headerElement = ref(null);

const { getSettingValue } = useModuleSettings(MODULE_XAPI_KEYS.MODULE_ID);
const support_phone_number = getSettingValue(MODULE_XAPI_KEYS.SUPPORT_PHONE_NUMBER);

const { customSlots, isAnimated } = useNestedMobileHeader();
const { searchBarVisible, toggleSearchBar, hideSearchBar } = useSearchBar();
const { searchBarVisible, toggleSearchBar } = useSearchBar();

const { height } = useElementSize(headerElement);
const { cart } = useShortCart();
const { logoUrl } = useWhiteLabeling();
const { saveSearchQuery } = useHistoricalEvents();
const { isCategoryScope } = useSearchScore();

const placeholderStyle = computed<StyleValue | undefined>(() =>
height.value ? { height: height.value + "px" } : undefined,
);

const searchPageLink = computed<RouteLocationRaw>(() => {
if (isCategoryScope.value) {
return {
path: router.currentRoute.value.path,
query: {
[QueryParamName.SearchPhrase]: searchPhrase.value.trim(),
},
};
} else {
return {
name: ROUTES.SEARCH.NAME,
query: {
[QueryParamName.SearchPhrase]: searchPhrase.value.trim(),
},
};
}
});

function reset() {
searchPhrase.value = "";
}

function onBarcodeScanned(value: string) {
if (value) {
searchPhrase.value = value;
void router.push(searchPageLink.value);
}
}

function handleSearch() {
if (searchPhrase.value) {
void saveSearchQuery(searchPhrase.value);

void router.replace(searchPageLink.value);
}
}

syncRefs(mobileMenuVisible, useScrollLock(document.body));

whenever(searchBarVisible, () => (searchPhrase.value = searchPhraseInUrl.value ?? ""), { immediate: true });
const isScrollLocked = computed(() => mobileMenuVisible.value || searchBarVisible.value);
const scrollLock = useScrollLock(document.body);

syncRefs(isScrollLocked, scrollLock);
</script>
Loading