{% sw_extends '@Storefront/storefront/layout/navigation/navigation.html.twig' %}
{% block layout_main_navigation_menu_home %}
{% if page.header.extensions.productsCategory %}
<a class="nav-link main-navigation-link"
href="{{ page.header.extensions.productsCategory.url }}"
itemprop="url"
data-flyout-menu-trigger="{{ page.header.extensions.productsCategory.id }}"
title="{{ page.header.extensions.productsCategory.name|striptags }}">
<div class="main-navigation-link-text">
<span itemprop="name">{{ page.header.extensions.productsCategory.name|sw_sanitize }}</span>
</div>
</a>
{% endif %}
{% endblock %}
{% block layout_main_navigation_menu_flyouts %}
{% if page.header.extensions.productsCategory %}
<div class="navigation-flyout cam-flyout"
data-flyout-menu-id="{{ page.header.extensions.productsCategory.id }}">
<div class="container">
<div class="row navigation-flyout-bar">
{% set productsCategorySettings = { 'url': path('frontend.mojebambino.productTree') } %}
<div class="col" data-products-category
data-products-category-options='{{ productsCategorySettings|json_encode }}'>
<div class="cam"
:class="{'cam--search': searchActive, 'cam--menu': !searchActive}"
:style="{'height': camHeight, 'max-height': menuMaxHeight}"
>
<div v-if="!isReady" class="cam__loader">
<div class="lds-ellipsis"><div></div><div></div><div></div><div></div></div>
</div>
<div class="cam__overflow" :style="overflowTopStyle"></div>
<div class="cam__search" v-show="isReady">
<div class="cam_search-inner" :class="{'cam_search-inner--focus': isFocused}">
<input @focusin="onInputFocusIn" @focusout="onInputFocusOut" v-model="search"
@keyup="onSearch" type="search" name="search"
class="form-control cam__search-input" autocomplete="off"
autocapitalize="off" placeholder="Wyszukaj kategorie"
aria-label="Wyszukaj kategorie" maxlength="30">
<div class="cam__search-icon cam__search-icon--x" @click.prevent="onClearSearch">
{% sw_icon 'x' %}
</div>
<div class="cam__search-icon cam__search-icon--search">
{% sw_icon 'search' %}
</div>
</div>
</div>
<div class="cam__result" v-show="searchActive && isReady">
<div class="cam__result-first" v-for="first in searchResult" v-show="first.show">
<a class="cam__result-first-name" :href="first.url" v-html="first.text"></a>
<div class="cam__result-first-sub">
<div class="cam__result-second" v-for="second in first.childs"
v-show="second.show">
<a class="cam__result-second-name" :href="second.url">
<span v-html="second.text"></span>
{% sw_icon 'arrow-head-right' %}
</a>
</div>
</div>
</div>
</div>
<div class="cam__categories"
v-show="!searchActive && isReady"
@load="calculateStyles"
ref="categories"
>
<div class="cam__categories-items"
:class="{'cam__categories-items--show-top': showItemsTopArrow, 'cam__categories-items--show-bottom': showItemsBottomArrow}">
<div class="cam__categories-items-top" v-if="showItemsTopArrow"
@click="onScrollList('top')">
{% sw_icon 'arrow-head-up' %}
</div>
<div class="cam__categories-items-elements" ref="menuElements"
:style="{'max-height': menuElementsMaxHeightPx}"
>
<a v-for="item in tree"
class="cam__categories-item"
:class="{'cam__categories-item--active': (currentId === item.id)}"
@mouseover="onOpenMenu(item.id)"
@mouseleave="onCloseMenu(item.id)"
:href="item.url"
>
<div class="cam__categories-item-image">
<img v-if="item.icon && item.isSvgIcon"
class="cam__categories-item-media"
:src="item.icon"
data-svg-inject
/>
<img v-if="item.icon && !item.isSvgIcon"
class="cam__categories-item-media" :src="item.icon"/>
</div>
<div class="cam__categories-item-text">
<span class="cam__categories-item-text-inner">${ item.name }</span>
</div>
<div class="cam__categories-item-arrow">
<span v-if="item.hasChild" class="cam__categories-item-arrow-triangle"></span>
{% sw_icon 'arrow-head-right' %}
</div>
</a>
</div>
<div class="cam__categories-items-bottom" v-if="showItemsBottomArrow"
@click="onScrollList('bottom')">
{% sw_icon 'arrow-head-down' %}
</div>
</div>
<div class="cam__categories-content" :style="{'max-height': menuContentMaxHeightPx}">
<div
v-for="item in tree"
class="cam__categories-sub"
:class="{'cam__categories-sub--has-background': item.background, 'cam__categories-sub--show': (currentId === item.id && item.hasChild)}"
:style="getCategoryStyle(item)"
@mouseover="onOpenMenu(item.id)"
@mouseleave="onCloseMenu(item.id)"
:ref="item.id"
>
<div v-if="item.hasChild" class="container">
<div class="row">
<a class="col-12 d-flex" :href="item.url">
<span class="cam__categories-link">{{ "cradvancedmenu.skipToCategory"|trans|sw_sanitize }} <strong class="cam__categories-link-bold">${ item.name } {% sw_icon 'arrow-head-right' %}</strong></span>
</a>
</div>
<div class="row">
<div v-if="item.twoColumn" class="col-12 cam__categories-col cam__categories-col--two-column">
<div class="cam__categories-subcategory cam__categories-subcategory--childrens">
<a class="cam__categories-subcategory-name"
:href="item.categoryLeft.url">
${ item.categoryLeft.name }
</a>
<div class="cam__categories-subcategories">
<div v-for="column in item.columnLeft" class="cam__categories-subcategories-col" :style="{ width: item.categoryLeft.columnWidth}">
<a v-for="sub in column" :href="sub.url"
class="cam__categories-child" :class="[{'cam__category-highlighted': sub.isHighlighted}, sub.isHighlightedColor]">
<span>${ sub.name }</span>
</a>
</div>
</div>
</div>
<div class="cam__categories-subcategory cam__categories-subcategory--childrens">
<a class="cam__categories-subcategory-name"
:href="item.categoryRight.url">
${ item.categoryRight.name }
</a>
<div class="cam__categories-subcategories">
<div v-for="column in item.columnRight" class="cam__categories-subcategories-col" :style="{ width: item.categoryRight.columnWidth}">
<a v-for="sub in column" :href="sub.url"
class="cam__categories-child" :class="[{'cam__category-highlighted': sub.isHighlighted}, sub.isHighlightedColor]">
<span>${ sub.name }</span>
</a>
</div>
</div>
</div>
</div>
<div v-else class="col-12 cam__categories-col">
<div class="cam__categories-subcategory cam__categories-subcategory--childrens">
<div class="cam__categories-subcategories cam__categories-subcategories--4">
<div v-for="column in item.chunk" class="cam__categories-subcategories-col" :style="{ width: item.columnWidth}">
<a v-for="sub in column" :href="sub.url"
class="cam__categories-child" :class="[{'cam__category-highlighted': sub.isHighlighted}, sub.isHighlightedColor]">
<span>${ sub.name }</span>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{% endif %}
{{ parent() }}
{% endblock %}