<div class="sds-megamenu collapse sds-collapse -collapseNoTransition text-left text-wrap show -standalone position-relative w-100" id="megamenu" data-megamenu data-current-item="particuliers-quotidien">
<nav class="sds-megamenu__surface sds-box -boxInsetMd sds-boxShadowActive sds-overflowAutoBlock rounded d-flex flex-column d-lg-block" aria-label="Menu principal complet">
<div class="sds-megamenu__body position-relative d-flex flex-column justify-content-between flex-grow-1 flex-shrink-0 sds-staticStackMd">
<ul class="list-unstyled position-relative sds-staticStackSm" id="megamenu-root" data-megamenu-list data-level="0">
<li>
<button type="button" class="sds-megamenu__item dropdown-item d-flex align-items-center text-left text-wrap sds-textBold sds-staticGapMd" data-megamenu-item="particuliers" data-megamenu-branch data-toggle="collapse" data-target="#megamenu-particuliers" aria-controls="megamenu-particuliers" aria-expanded="false">
<span class="h5">Particuliers</span>
<span class="sds-btn -iconBtn -btnSecondary -btnInverse sds-megamenu__arrow ml-auto" aria-hidden="true">
<span aria-hidden="true" class="sds-icon sds-icon-chevronright"></span>
</span>
</button>
<div class="sds-megamenu__level collapse collapse -collapseNoTransition" id="megamenu-particuliers" data-parent="#megamenu-root" data-megamenu-level data-parent-item="particuliers" role="group" aria-label="Particuliers">
<div class="d-flex flex-column sds-staticGapSm">
<button type="button" class="sds-megamenu__item dropdown-item d-flex align-items-center text-left text-wrap sds-textBold sds-staticGapMd" data-megamenu-back="particuliers" data-toggle="collapse" data-target="#megamenu-particuliers" aria-controls="megamenu-particuliers" aria-expanded="false">
<span class="sds-iconBlock -iconBlockInverse" aria-hidden="true">
<span class="sds-iconBlock__icon sds-icon sds-icon-chevronleft"></span>
</span>
<span class="h5">Particuliers</span><span class="sr-only"> : retour au niveau précédent</span>
</button>
<div aria-hidden="true" class="sds-divider"></div>
<ul class="list-unstyled position-relative sds-staticStackSm" id="megamenu-particuliers-list" data-megamenu-list data-level="1">
<li>
<a class="sds-megamenu__item dropdown-item d-flex align-items-center text-left text-wrap sds-textBold sds-staticGapMd" data-megamenu-item="particuliers-overview" href="#!">
<span class="sds-iconBlock" aria-hidden="true">
<span class="sds-iconBlock__icon sds-icon sds-icon-grid"></span>
</span>
<span class="h5">Voir tout particuliers</span>
</a>
</li>
<li>
<a class="sds-megamenu__item dropdown-item d-flex align-items-center text-left text-wrap sds-textBold sds-staticGapMd -current" data-megamenu-item="particuliers-quotidien" href="#!" aria-current="page">
<span class="sds-iconBlock" aria-hidden="true">
<span class="sds-iconBlock__icon sds-icon sds-icon-graph"></span>
</span>
<span class="h5">Gérer le quotidien</span>
</a>
</li>
<li>
<a class="sds-megamenu__item dropdown-item d-flex align-items-center text-left text-wrap sds-textBold sds-staticGapMd" data-megamenu-item="particuliers-financer" href="#!">
<span class="sds-iconBlock" aria-hidden="true">
<span class="sds-iconBlock__icon sds-icon sds-icon-allocation"></span>
</span>
<span class="h5">Financer</span>
</a>
</li>
<li>
<a class="sds-megamenu__item dropdown-item d-flex align-items-center text-left text-wrap sds-textBold sds-staticGapMd" data-megamenu-item="particuliers-investir" href="#!">
<span class="sds-iconBlock" aria-hidden="true">
<span class="sds-iconBlock__icon sds-icon sds-icon-pig"></span>
</span>
<span class="h5">Epargner & Investir</span>
</a>
</li>
<li>
<a class="sds-megamenu__item dropdown-item d-flex align-items-center text-left text-wrap sds-textBold sds-staticGapMd" data-megamenu-item="particuliers-aide" href="#!">
<span class="sds-iconBlock" aria-hidden="true">
<span class="sds-iconBlock__icon sds-icon sds-icon-rescuebuoy"></span>
</span>
<span class="h5">Infos & aide</span>
</a>
</li>
<li>
<a class="sds-megamenu__item dropdown-item d-flex align-items-center text-left text-wrap sds-textBold sds-staticGapMd" data-megamenu-item="particuliers-outils" href="#!">
<span class="sds-iconBlock" aria-hidden="true">
<span class="sds-iconBlock__icon sds-icon sds-icon-tools"></span>
</span>
<span class="h5">Outils</span>
</a>
</li>
<li>
<a class="sds-megamenu__item dropdown-item d-flex align-items-center text-left text-wrap sds-textBold sds-staticGapMd" data-megamenu-item="particuliers-luxfunds" href="#!">
<span class="sds-iconBlock" aria-hidden="true">
<span class="sds-iconBlock__icon sds-icon sds-icon-graphline"></span>
</span>
<span class="h5">Luxfunds</span>
</a>
</li>
</ul>
</div>
</div>
</li>
<li>
<button type="button" class="sds-megamenu__item dropdown-item d-flex align-items-center text-left text-wrap sds-textBold sds-staticGapMd" data-megamenu-item="jeunes" data-megamenu-branch data-toggle="collapse" data-target="#megamenu-jeunes" aria-controls="megamenu-jeunes" aria-expanded="false">
<span class="h5">Jeunes</span>
<span class="sds-btn -iconBtn -btnSecondary -btnInverse sds-megamenu__arrow ml-auto" aria-hidden="true">
<span aria-hidden="true" class="sds-icon sds-icon-chevronright"></span>
</span>
</button>
<div class="sds-megamenu__level collapse collapse -collapseNoTransition" id="megamenu-jeunes" data-parent="#megamenu-root" data-megamenu-level data-parent-item="jeunes" role="group" aria-label="Jeunes">
<div class="d-flex flex-column sds-staticGapSm">
<button type="button" class="sds-megamenu__item dropdown-item d-flex align-items-center text-left text-wrap sds-textBold sds-staticGapMd" data-megamenu-back="jeunes" data-toggle="collapse" data-target="#megamenu-jeunes" aria-controls="megamenu-jeunes" aria-expanded="false">
<span class="sds-iconBlock -iconBlockInverse" aria-hidden="true">
<span class="sds-iconBlock__icon sds-icon sds-icon-chevronleft"></span>
</span>
<span class="h5">Jeunes</span><span class="sr-only"> : retour au niveau précédent</span>
</button>
<div aria-hidden="true" class="sds-divider"></div>
<ul class="list-unstyled position-relative sds-staticStackSm" id="megamenu-jeunes-list" data-megamenu-list data-level="1">
<li>
<button type="button" class="sds-megamenu__item dropdown-item d-flex align-items-center text-left text-wrap sds-textBold sds-staticGapMd" data-megamenu-item="tweenz" data-megamenu-branch data-toggle="collapse" data-target="#megamenu-tweenz" aria-controls="megamenu-tweenz" aria-expanded="false">
<span class="h5">Tweenz (0 - 12)</span>
<span class="sds-btn -iconBtn -btnSecondary -btnInverse sds-megamenu__arrow ml-auto" aria-hidden="true">
<span aria-hidden="true" class="sds-icon sds-icon-chevronright"></span>
</span>
</button>
<div class="sds-megamenu__level collapse collapse -collapseNoTransition" id="megamenu-tweenz" data-parent="#megamenu-jeunes-list" data-megamenu-level data-parent-item="tweenz" role="group" aria-label="Tweenz (0 - 12)">
<div class="d-flex flex-column sds-staticGapSm">
<button type="button" class="sds-megamenu__item dropdown-item d-flex align-items-center text-left text-wrap sds-textBold sds-staticGapMd" data-megamenu-back="tweenz" data-toggle="collapse" data-target="#megamenu-tweenz" aria-controls="megamenu-tweenz" aria-expanded="false">
<span class="sds-iconBlock -iconBlockInverse" aria-hidden="true">
<span class="sds-iconBlock__icon sds-icon sds-icon-chevronleft"></span>
</span>
<span class="h5">Tweenz (0 - 12)</span><span class="sr-only"> : retour au niveau précédent</span>
</button>
<div aria-hidden="true" class="sds-divider"></div>
<ul class="list-unstyled position-relative sds-staticStackSm" data-megamenu-list data-level="2">
<li>
<a class="sds-megamenu__item dropdown-item d-flex align-items-center text-left text-wrap sds-textBold sds-staticGapMd" data-megamenu-item="tweenz-overview" href="#!">
<span class="sds-iconBlock" aria-hidden="true">
<span class="sds-iconBlock__icon sds-icon sds-icon-grid"></span>
</span>
<span class="h5">Voir tout Tweenz</span>
</a>
</li>
<li>
<a class="sds-megamenu__item dropdown-item d-flex align-items-center text-left text-wrap sds-textBold sds-staticGapMd" data-megamenu-item="tweenz-quotidien" href="#!">
<span class="sds-iconBlock" aria-hidden="true">
<span class="sds-iconBlock__icon sds-icon sds-icon-graph"></span>
</span>
<span class="h5">Gérer le quotidien</span>
</a>
</li>
<li>
<a class="sds-megamenu__item dropdown-item d-flex align-items-center text-left text-wrap sds-textBold sds-staticGapMd" data-megamenu-item="tweenz-financer" href="#!">
<span class="sds-iconBlock" aria-hidden="true">
<span class="sds-iconBlock__icon sds-icon sds-icon-allocation"></span>
</span>
<span class="h5">Financer</span>
</a>
</li>
<li>
<a class="sds-megamenu__item dropdown-item d-flex align-items-center text-left text-wrap sds-textBold sds-staticGapMd" data-megamenu-item="tweenz-investir" href="#!">
<span class="sds-iconBlock" aria-hidden="true">
<span class="sds-iconBlock__icon sds-icon sds-icon-pig"></span>
</span>
<span class="h5">Epargner & Investir</span>
</a>
</li>
<li>
<a class="sds-megamenu__item dropdown-item d-flex align-items-center text-left text-wrap sds-textBold sds-staticGapMd" data-megamenu-item="tweenz-aide" href="#!">
<span class="sds-iconBlock" aria-hidden="true">
<span class="sds-iconBlock__icon sds-icon sds-icon-rescuebuoy"></span>
</span>
<span class="h5">Infos & aide</span>
</a>
</li>
<li>
<a class="sds-megamenu__item dropdown-item d-flex align-items-center text-left text-wrap sds-textBold sds-staticGapMd" data-megamenu-item="tweenz-outils" href="#!">
<span class="sds-iconBlock" aria-hidden="true">
<span class="sds-iconBlock__icon sds-icon sds-icon-tools"></span>
</span>
<span class="h5">Outils</span>
</a>
</li>
<li>
<a class="sds-megamenu__item dropdown-item d-flex align-items-center text-left text-wrap sds-textBold sds-staticGapMd" data-megamenu-item="tweenz-luxfunds" href="#!">
<span class="sds-iconBlock" aria-hidden="true">
<span class="sds-iconBlock__icon sds-icon sds-icon-graphline"></span>
</span>
<span class="h5">Luxfunds</span>
</a>
</li>
</ul>
</div>
</div>
</li>
<li>
<button type="button" class="sds-megamenu__item dropdown-item d-flex align-items-center text-left text-wrap sds-textBold sds-staticGapMd" data-megamenu-item="axxess" data-megamenu-branch data-toggle="collapse" data-target="#megamenu-axxess" aria-controls="megamenu-axxess" aria-expanded="false">
<span class="h5">Axxess (12 - 30)</span>
<span class="sds-btn -iconBtn -btnSecondary -btnInverse sds-megamenu__arrow ml-auto" aria-hidden="true">
<span aria-hidden="true" class="sds-icon sds-icon-chevronright"></span>
</span>
</button>
<div class="sds-megamenu__level collapse collapse -collapseNoTransition" id="megamenu-axxess" data-parent="#megamenu-jeunes-list" data-megamenu-level data-parent-item="axxess" role="group" aria-label="Axxess (12 - 30)">
<div class="d-flex flex-column sds-staticGapSm">
<button type="button" class="sds-megamenu__item dropdown-item d-flex align-items-center text-left text-wrap sds-textBold sds-staticGapMd" data-megamenu-back="axxess" data-toggle="collapse" data-target="#megamenu-axxess" aria-controls="megamenu-axxess" aria-expanded="false">
<span class="sds-iconBlock -iconBlockInverse" aria-hidden="true">
<span class="sds-iconBlock__icon sds-icon sds-icon-chevronleft"></span>
</span>
<span class="h5">Axxess (12 - 30)</span><span class="sr-only"> : retour au niveau précédent</span>
</button>
<div aria-hidden="true" class="sds-divider"></div>
<ul class="list-unstyled position-relative sds-staticStackSm" data-megamenu-list data-level="2">
<li>
<a class="sds-megamenu__item dropdown-item d-flex align-items-center text-left text-wrap sds-textBold sds-staticGapMd" data-megamenu-item="axxess-overview" href="#!">
<span class="sds-iconBlock" aria-hidden="true">
<span class="sds-iconBlock__icon sds-icon sds-icon-grid"></span>
</span>
<span class="h5">Voir tout Axxess</span>
</a>
</li>
<li>
<a class="sds-megamenu__item dropdown-item d-flex align-items-center text-left text-wrap sds-textBold sds-staticGapMd" data-megamenu-item="axxess-quotidien" href="#!">
<span class="sds-iconBlock" aria-hidden="true">
<span class="sds-iconBlock__icon sds-icon sds-icon-graph"></span>
</span>
<span class="h5">Gérer le quotidien</span>
</a>
</li>
<li>
<a class="sds-megamenu__item dropdown-item d-flex align-items-center text-left text-wrap sds-textBold sds-staticGapMd" data-megamenu-item="axxess-financer" href="#!">
<span class="sds-iconBlock" aria-hidden="true">
<span class="sds-iconBlock__icon sds-icon sds-icon-allocation"></span>
</span>
<span class="h5">Financer</span>
</a>
</li>
<li>
<a class="sds-megamenu__item dropdown-item d-flex align-items-center text-left text-wrap sds-textBold sds-staticGapMd" data-megamenu-item="axxess-investir" href="#!">
<span class="sds-iconBlock" aria-hidden="true">
<span class="sds-iconBlock__icon sds-icon sds-icon-pig"></span>
</span>
<span class="h5">Epargner & Investir</span>
</a>
</li>
<li>
<a class="sds-megamenu__item dropdown-item d-flex align-items-center text-left text-wrap sds-textBold sds-staticGapMd" data-megamenu-item="axxess-aide" href="#!">
<span class="sds-iconBlock" aria-hidden="true">
<span class="sds-iconBlock__icon sds-icon sds-icon-rescuebuoy"></span>
</span>
<span class="h5">Infos & aide</span>
</a>
</li>
<li>
<a class="sds-megamenu__item dropdown-item d-flex align-items-center text-left text-wrap sds-textBold sds-staticGapMd" data-megamenu-item="axxess-outils" href="#!">
<span class="sds-iconBlock" aria-hidden="true">
<span class="sds-iconBlock__icon sds-icon sds-icon-tools"></span>
</span>
<span class="h5">Outils</span>
</a>
</li>
<li>
<a class="sds-megamenu__item dropdown-item d-flex align-items-center text-left text-wrap sds-textBold sds-staticGapMd" data-megamenu-item="axxess-luxfunds" href="#!">
<span class="sds-iconBlock" aria-hidden="true">
<span class="sds-iconBlock__icon sds-icon sds-icon-graphline"></span>
</span>
<span class="h5">Luxfunds</span>
</a>
</li>
</ul>
</div>
</div>
</li>
</ul>
</div>
</div>
</li>
<li>
<button type="button" class="sds-megamenu__item dropdown-item d-flex align-items-center text-left text-wrap sds-textBold sds-staticGapMd" data-megamenu-item="professionnels" data-megamenu-branch data-toggle="collapse" data-target="#megamenu-professionnels" aria-controls="megamenu-professionnels" aria-expanded="false">
<span class="h5">Professionnels</span>
<span class="sds-btn -iconBtn -btnSecondary -btnInverse sds-megamenu__arrow ml-auto" aria-hidden="true">
<span aria-hidden="true" class="sds-icon sds-icon-chevronright"></span>
</span>
</button>
<div class="sds-megamenu__level collapse collapse -collapseNoTransition" id="megamenu-professionnels" data-parent="#megamenu-root" data-megamenu-level data-parent-item="professionnels" role="group" aria-label="Professionnels">
<div class="d-flex flex-column sds-staticGapSm">
<button type="button" class="sds-megamenu__item dropdown-item d-flex align-items-center text-left text-wrap sds-textBold sds-staticGapMd" data-megamenu-back="professionnels" data-toggle="collapse" data-target="#megamenu-professionnels" aria-controls="megamenu-professionnels" aria-expanded="false">
<span class="sds-iconBlock -iconBlockInverse" aria-hidden="true">
<span class="sds-iconBlock__icon sds-icon sds-icon-chevronleft"></span>
</span>
<span class="h5">Professionnels</span><span class="sr-only"> : retour au niveau précédent</span>
</button>
<div aria-hidden="true" class="sds-divider"></div>
<ul class="list-unstyled position-relative sds-staticStackSm" id="megamenu-professionnels-list" data-megamenu-list data-level="1">
<li>
<a class="sds-megamenu__item dropdown-item d-flex align-items-center text-left text-wrap sds-textBold sds-staticGapMd" data-megamenu-item="professionnels-overview" href="#!">
<span class="sds-iconBlock" aria-hidden="true">
<span class="sds-iconBlock__icon sds-icon sds-icon-grid"></span>
</span>
<span class="h5">Voir tout professionnels</span>
</a>
</li>
</ul>
</div>
</div>
</li>
<li>
<button type="button" class="sds-megamenu__item dropdown-item d-flex align-items-center text-left text-wrap sds-textBold sds-staticGapMd" data-megamenu-item="private-banking" data-megamenu-branch data-toggle="collapse" data-target="#megamenu-private-banking" aria-controls="megamenu-private-banking" aria-expanded="false">
<span class="h5">Private Banking</span>
<span class="sds-btn -iconBtn -btnSecondary -btnInverse sds-megamenu__arrow ml-auto" aria-hidden="true">
<span aria-hidden="true" class="sds-icon sds-icon-chevronright"></span>
</span>
</button>
<div class="sds-megamenu__level collapse collapse -collapseNoTransition" id="megamenu-private-banking" data-parent="#megamenu-root" data-megamenu-level data-parent-item="private-banking" role="group" aria-label="Private Banking">
<div class="d-flex flex-column sds-staticGapSm">
<button type="button" class="sds-megamenu__item dropdown-item d-flex align-items-center text-left text-wrap sds-textBold sds-staticGapMd" data-megamenu-back="private-banking" data-toggle="collapse" data-target="#megamenu-private-banking" aria-controls="megamenu-private-banking" aria-expanded="false">
<span class="sds-iconBlock -iconBlockInverse" aria-hidden="true">
<span class="sds-iconBlock__icon sds-icon sds-icon-chevronleft"></span>
</span>
<span class="h5">Private Banking</span><span class="sr-only"> : retour au niveau précédent</span>
</button>
<div aria-hidden="true" class="sds-divider"></div>
<ul class="list-unstyled position-relative sds-staticStackSm" id="megamenu-private-banking-list" data-megamenu-list data-level="1">
<li>
<a class="sds-megamenu__item dropdown-item d-flex align-items-center text-left text-wrap sds-textBold sds-staticGapMd" data-megamenu-item="private-banking-overview" href="#!">
<span class="sds-iconBlock" aria-hidden="true">
<span class="sds-iconBlock__icon sds-icon sds-icon-grid"></span>
</span>
<span class="h5">Voir tout Private Banking</span>
</a>
</li>
</ul>
</div>
</div>
</li>
<li>
<button type="button" class="sds-megamenu__item dropdown-item d-flex align-items-center text-left text-wrap sds-textBold sds-staticGapMd" data-megamenu-item="a-propos" data-megamenu-branch data-toggle="collapse" data-target="#megamenu-a-propos" aria-controls="megamenu-a-propos" aria-expanded="false">
<span class="h5">À propos de nous</span>
<span class="sds-btn -iconBtn -btnSecondary -btnInverse sds-megamenu__arrow ml-auto" aria-hidden="true">
<span aria-hidden="true" class="sds-icon sds-icon-chevronright"></span>
</span>
</button>
<div class="sds-megamenu__level collapse collapse -collapseNoTransition" id="megamenu-a-propos" data-parent="#megamenu-root" data-megamenu-level data-parent-item="a-propos" role="group" aria-label="À propos de nous">
<div class="d-flex flex-column sds-staticGapSm">
<button type="button" class="sds-megamenu__item dropdown-item d-flex align-items-center text-left text-wrap sds-textBold sds-staticGapMd" data-megamenu-back="a-propos" data-toggle="collapse" data-target="#megamenu-a-propos" aria-controls="megamenu-a-propos" aria-expanded="false">
<span class="sds-iconBlock -iconBlockInverse" aria-hidden="true">
<span class="sds-iconBlock__icon sds-icon sds-icon-chevronleft"></span>
</span>
<span class="h5">À propos de nous</span><span class="sr-only"> : retour au niveau précédent</span>
</button>
<div aria-hidden="true" class="sds-divider"></div>
<ul class="list-unstyled position-relative sds-staticStackSm" id="megamenu-a-propos-list" data-megamenu-list data-level="1">
<li>
<a class="sds-megamenu__item dropdown-item d-flex align-items-center text-left text-wrap sds-textBold sds-staticGapMd" data-megamenu-item="a-propos-overview" href="#!">
<span class="sds-iconBlock" aria-hidden="true">
<span class="sds-iconBlock__icon sds-icon sds-icon-grid"></span>
</span>
<span class="h5">Voir tout à propos de nous</span>
</a>
</li>
</ul>
</div>
</div>
</li>
</ul>
<div class="sds-megamenu__footer position-sticky flex-shrink-0">
<a href="#!" class="sds-btn -btnSecondary -btnBlock">
<span class="sds-btn__text">
Devenir client
</span>
</a>
</div>
</div>
</nav>
</div>
{% set itemClasses = namespace + "megamenu__item dropdown-item d-flex align-items-center text-left text-wrap " + namespace + "textBold " + namespace + "staticGapMd" %}
{% set listClasses = "list-unstyled position-relative sds-staticStackSm" %}
{% set levelClasses = namespace + "megamenu__level collapse " + "collapse -collapseNoTransition" %}
<div class="{{ namespace }}megamenu collapse {{ namespace }}collapse -collapseNoTransition text-left text-wrap{% if initialOpen %} show{% endif %}{% if embedded %} position-absolute{% else %} -standalone position-relative w-100{% endif %}" id="{{ id }}" data-megamenu data-current-item="{{ currentItemId }}">
<nav class="{{ namespace }}megamenu__surface {{ namespace }}box -boxInsetMd {{ namespace }}boxShadowActive {{ namespace }}overflowAutoBlock rounded d-flex flex-column d-lg-block" aria-label="Menu principal complet">
<div class="{{ namespace }}megamenu__body position-relative d-flex flex-column justify-content-between flex-grow-1 flex-shrink-0 {{ namespace }}staticStackMd">
<ul class="{{ listClasses }}" id="{{ id }}-root" data-megamenu-list data-level="0">
{% for item in items %}
<li>
{% if item.children and item.children.length %}
<button type="button" class="{{ itemClasses }}" data-megamenu-item="{{ item.id }}" data-megamenu-branch data-toggle="collapse" data-target="#{{ id }}-{{ item.id }}" aria-controls="{{ id }}-{{ item.id }}" aria-expanded="false">
{% else %}
<a class="{{ itemClasses }}{% if item.id == currentItemId %} -current{% endif %}" data-megamenu-item="{{ item.id }}" href="{{ item.href }}"{% if item.id == currentItemId %} aria-current="page"{% endif %}>
{% endif %}
{% if item.icon %}
{% render "@icon-block", { icon: item.icon, text: false, modifiers: [], classes: [] }, true %}
{% endif %}
<span class="h5">{{ item.text }}</span>
{% if item.children and item.children.length %}
{% render "@icon-btn-secondary-inverse", { eltType: 'span', icon: 'icon-chevronright', action: false, classes: [namespace + 'megamenu__arrow', 'ml-auto'], attrs: { 'aria-hidden': 'true' } }, true %}
</button>
<div class="{{ levelClasses }}" id="{{ id }}-{{ item.id }}" data-parent="#{{ id }}-root" data-megamenu-level data-parent-item="{{ item.id }}" role="group" aria-label="{{ item.text }}">
<div class="d-flex flex-column {{ namespace }}staticGapSm">
<button type="button" class="{{ itemClasses }}" data-megamenu-back="{{ item.id }}" data-toggle="collapse" data-target="#{{ id }}-{{ item.id }}" aria-controls="{{ id }}-{{ item.id }}" aria-expanded="false">
{% render "@icon-block--inverse", { icon: 'icon-chevronleft', text: false, classes: [] }, true %}
<span class="h5">{{ item.text }}</span><span class="sr-only"> : retour au niveau précédent</span>
</button>
{% render "@divider" %}
<ul class="{{ listClasses }}" id="{{ id }}-{{ item.id }}-list" data-megamenu-list data-level="1">
{% for subItem in item.children %}
<li>
{% if subItem.children and subItem.children.length %}
<button type="button" class="{{ itemClasses }}" data-megamenu-item="{{ subItem.id }}" data-megamenu-branch data-toggle="collapse" data-target="#{{ id }}-{{ subItem.id }}" aria-controls="{{ id }}-{{ subItem.id }}" aria-expanded="false">
{% else %}
<a class="{{ itemClasses }}{% if subItem.id == currentItemId %} -current{% endif %}" data-megamenu-item="{{ subItem.id }}" href="{{ subItem.href }}"{% if subItem.id == currentItemId %} aria-current="page"{% endif %}>
{% endif %}
{% if subItem.icon %}
{% render "@icon-block", { icon: subItem.icon, text: false, modifiers: [], classes: [] }, true %}
{% endif %}
<span class="h5">{{ subItem.text }}</span>
{% if subItem.children and subItem.children.length %}
{% render "@icon-btn-secondary-inverse", { eltType: 'span', icon: 'icon-chevronright', action: false, classes: [namespace + 'megamenu__arrow', 'ml-auto'], attrs: { 'aria-hidden': 'true' } }, true %}
</button>
<div class="{{ levelClasses }}" id="{{ id }}-{{ subItem.id }}" data-parent="#{{ id }}-{{ item.id }}-list" data-megamenu-level data-parent-item="{{ subItem.id }}" role="group" aria-label="{{ subItem.text }}">
<div class="d-flex flex-column {{ namespace }}staticGapSm">
<button type="button" class="{{ itemClasses }}" data-megamenu-back="{{ subItem.id }}" data-toggle="collapse" data-target="#{{ id }}-{{ subItem.id }}" aria-controls="{{ id }}-{{ subItem.id }}" aria-expanded="false">
{% render "@icon-block--inverse", { icon: 'icon-chevronleft', text: false, classes: [] }, true %}
<span class="h5">{{ subItem.text }}</span><span class="sr-only"> : retour au niveau précédent</span>
</button>
{% render "@divider" %}
<ul class="{{ listClasses }}" data-megamenu-list data-level="2">
{% for destination in subItem.children %}
<li>
<a class="{{ itemClasses }}{% if destination.id == currentItemId %} -current{% endif %}" data-megamenu-item="{{ destination.id }}" href="{{ destination.href }}"{% if destination.id == currentItemId %} aria-current="page"{% endif %}>
{% if destination.icon %}
{% render "@icon-block", { icon: destination.icon, text: false, modifiers: [], classes: [] }, true %}
{% endif %}
<span class="h5">{{ destination.text }}</span>
</a>
</li>
{% endfor %}
</ul>
</div>
</div>
{% else %}
</a>
{% endif %}
</li>
{% endfor %}
</ul>
</div>
</div>
{% else %}
</a>
{% endif %}
</li>
{% endfor %}
</ul>
{% if cta %}
<div class="{{ namespace }}megamenu__footer position-sticky flex-shrink-0">
{% render "@btn-secondary--full-width", { eltType: 'a', text: cta.text, href: cta.href }, true %}
</div>
{% endif %}
</div>
</nav>
</div>
import breakpoints from '../../../../config/design-tokens-generated-config/js/breakpoint';
export default class Megamenu {
constructor() {
document.querySelectorAll('[data-megamenu]').forEach(menu => this.init(menu));
}
// Bootstrap owns collapse state, accordion siblings and aria-expanded. This
// controller adds responsive presentation, measurement and focus management.
init(menu) {
const $menu = $(menu);
const desktop = window.matchMedia(`(min-width: ${breakpoints.BreakpointLg})`);
const levels = Array.from(menu.querySelectorAll('[data-megamenu-level]'));
const lists = Array.from(menu.querySelectorAll('[data-megamenu-list]'));
const rootList = lists[0];
const rootControl = rootList.querySelector('[data-megamenu-item]');
const backButtons = Array.from(menu.querySelectorAll('[data-megamenu-back]'));
const branches = Array.from(menu.querySelectorAll('[data-megamenu-branch]'));
const toggles = Array.from(document.querySelectorAll('[data-megamenu-toggle]'))
.filter(toggle => toggle.getAttribute('aria-controls') === menu.id);
const header = menu.closest('.sds-header');
const surface = menu.querySelector('.sds-megamenu__surface');
const footer = menu.querySelector('.sds-megamenu__footer');
// Capture the branch trigger before Bootstrap hides the focused panel.
let returnFocus = null;
let heightFrame = 0;
// Absolutely positioned nested columns do not contribute to the panel height.
// Measure their visible lists and let CSS animate the resulting surface height.
const updateHeight = () => {
heightFrame = 0;
if (!desktop.matches || !$menu.hasClass('show')) return;
// A descendant can retain .show briefly while an ancestor is closing.
const visibleLists = lists.filter(list => !list.closest('[data-megamenu-level]:not(.show)'));
const px = value => parseFloat(value) || 0;
const footerStyle = footer ? getComputedStyle(footer) : null;
const footerSpace = footer ? footer.getBoundingClientRect().height + px(footerStyle.marginTop) + px(footerStyle.marginBottom) : 0;
// The CTA belongs to the first column, not beneath every nested column.
const contentHeight = Math.ceil(Math.max(rootList.getBoundingClientRect().height + footerSpace, ...visibleLists.map(list => list.getBoundingClientRect().height)));
// Add padding/borders once; the body and columns share the content height.
const style = getComputedStyle(surface);
const inset = px(style.paddingTop) + px(style.paddingBottom) + px(style.borderTopWidth) + px(style.borderBottomWidth);
menu.style.setProperty('--megamenu-content-height', `${contentHeight}px`);
menu.style.setProperty('--megamenu-height', `${contentHeight + inset}px`);
};
// Collapse events and ResizeObserver may fire together; measure once per frame.
const scheduleHeight = () => {
if (!heightFrame) heightFrame = requestAnimationFrame(updateHeight);
};
// Prevent temporary scrollbars while the surface catches up with its content.
// Ignore descendant transitions and restore scrolling even if this one is cancelled.
['transitionrun', 'transitionend', 'transitioncancel'].forEach(type => {
surface.addEventListener(type, event => {
if (event.target === surface && event.propertyName === 'height') {
surface.classList.toggle('overflow-hidden', type === 'transitionrun');
}
});
});
// Breakpoint changes or ancestor closes may hide a previously valid target.
const focus = element => {
if (element?.getClientRects().length) element.focus();
};
const currentControl = () => backButtons.find(button => !button.hidden) || rootControl;
const updateView = () => {
// Bootstrap owns the open state; only its visible ancestor chain determines the layout.
const open = levels.filter(level => level.classList.contains('show') && !level.parentElement.closest('[data-megamenu-level]:not(.show)'));
const visibleList = open.length ? open[open.length - 1].querySelector('[data-megamenu-list]') : rootList;
// Mobile hides ancestor controls, not their list containers: the active
// nested panel must remain rendered inside the original ul/li structure.
lists.forEach(list => {
const visible = desktop.matches || list === visibleList;
// Hidden ancestor rows must not leave stack spacing above the active level.
list.classList.toggle('sds-staticStackSm', visible);
Array.from(list.children).forEach(item => {
item.firstElementChild.classList.toggle('d-none', !visible);
item.firstElementChild.classList.toggle('d-flex', visible);
});
});
// Only the active mobile level needs Back and its following divider.
backButtons.forEach(button => {
button.hidden = desktop.matches || button.parentElement.querySelector('[data-megamenu-list]') !== visibleList;
// Bootstrap's d-flex overrides [hidden], so update both display utilities.
button.classList.toggle('d-none', button.hidden);
button.classList.toggle('d-flex', !button.hidden);
button.nextElementSibling.classList.toggle('d-none', button.hidden);
});
// Read Bootstrap state for row styling and the number of desktop columns.
branches.forEach(button => button.classList.toggle('-selected', button.getAttribute('aria-expanded') === 'true'));
menu.style.setProperty('--megamenu-visible-columns', open.length + 1);
scheduleHeight();
};
// Bootstrap already ignores hide requests when the menu is closed.
const close = () => $menu.collapse('hide');
// Keep the header positioned over the page and notify its Headroom controller.
const headerState = open => {
header?.classList.toggle('-megamenuOpen', open);
menu.dispatchEvent(new CustomEvent(open ? 'megamenu:open' : 'megamenu:close', { bubbles: true }));
};
// Desktop starts on the configured current path; mobile always starts at root.
const showCurrentBranch = () => {
if (!desktop.matches) return;
const current = Array.from(menu.querySelectorAll('[data-megamenu-item]'))
.find(item => item.dataset.megamenuItem === menu.dataset.currentItem);
if (!current) return;
let panel = current.hasAttribute('data-megamenu-branch') ? document.getElementById(current.getAttribute('aria-controls')) : current.closest('[data-megamenu-level]');
// Open outer panels first, including the current item itself if it is a branch.
const parents = [];
while (panel) {
parents.unshift(panel);
panel = panel.parentElement.closest('[data-megamenu-level]');
}
$(parents).collapse('show');
};
// Nested collapse events bubble to the menu; only the outer collapse changes
// header state. Nested hides merely record where focus should return.
$menu.on('show.bs.collapse hide.bs.collapse', event => {
if (event.target !== menu) {
if (event.type === 'hide' && event.target.contains(document.activeElement)) {
returnFocus = branches.find(button => button.getAttribute('aria-controls') === event.target.id);
}
return;
}
returnFocus = null;
const opening = event.type === 'show';
if (opening) {
// Clear the previous visit before applying the responsive default on shown.
$(levels).collapse('hide');
} else if (menu.contains(document.activeElement)) {
focus(toggles[0]);
}
headerState(opening);
});
// Wait for Bootstrap's final classes before deriving visibility and measuring.
$menu.on('shown.bs.collapse hidden.bs.collapse', event => {
const panel = event.target;
if (panel !== menu && !panel.hasAttribute('data-megamenu-level')) return;
// Closing an ancestor also clears its descendants for the next visit.
if (event.type === 'hidden') $(panel).find('[data-megamenu-level].show').collapse('hide');
updateView();
if (event.type === 'shown') {
if (panel === menu) {
showCurrentBranch();
focus(rootControl);
surface.scrollTop = 0;
}
// On mobile, Back is the first control in the newly displayed level.
else if (!desktop.matches) focus(panel.querySelector('[data-megamenu-back]'));
} else if ($menu.hasClass('show') && returnFocus) {
// A sibling switch can hide the old trigger too; use a visible fallback.
focus(returnFocus.getClientRects().length ? returnFocus : currentControl());
returnFocus = null;
}
});
// This is nonmodal navigation: dismiss on navigation, outside clicks, Escape,
// or another header overlay. Ignore its toggles so their clicks can open it.
$menu.on('click', 'a', close);
document.addEventListener('click', event => {
if (!menu.contains(event.target) && !toggles.some(toggle => toggle.contains(event.target))) close();
});
document.addEventListener('keydown', event => {
if (event.key === 'Escape' && $menu.hasClass('show')) {
event.preventDefault();
close();
focus(toggles[0]);
}
});
$(document).on('show.bs.modal show.bs.dropdown', close);
// Apply the same default when crossing lg as when opening at that size.
desktop.addEventListener('change', () => {
if ($menu.hasClass('show')) {
if (desktop.matches) showCurrentBranch();
else $(levels).collapse('hide');
}
updateView();
if (menu.contains(document.activeElement) && !document.activeElement.getClientRects().length) focus(currentControl());
});
// Standalone previews may already be open without emitting collapse events.
updateView();
if ($menu.hasClass('show')) {
showCurrentBranch();
headerState(true);
}
// Watch intrinsic content, not the animated surface, to avoid resize feedback.
// This also covers wrapping after viewport changes and late-loading fonts.
const resizeObserver = new ResizeObserver(scheduleHeight);
lists.forEach(list => resizeObserver.observe(list));
if (footer) resizeObserver.observe(footer);
}
}
.#{$namespace}megamenu {
--megamenu-gap: #{map-deep-get($token-spacer-unit-map, "32")};
z-index: z("dropdown");
//max-width: 460px;
&.collapsing,
&__level.collapsing {
height: auto !important;
overflow: visible;
transition: none;
}
&:not(.-standalone) {
top: 100%;
left: 0;
width: 100%;
@include media-breakpoint-up(sm) {
top: calc(100% + #{map-deep-get($token-spacer-unit-map, "8")});
left: map-deep-get($token-spacer-unit-map, "16");
width: calc(100% - #{map-deep-get($token-spacer-unit-map, "32")});
}
}
&__surface {
//@include custom-prop-fallback("color", "sys-color-text-primary-vivid");
height: calc(100vh - var(--comp-header-nav-top-height));
height: calc(100dvh - var(--comp-header-nav-top-height));
overscroll-behavior: contain;
@include media-breakpoint-up(sm) {
height: calc(100vh - var(--comp-header-nav-top-height) - 16px);
height: calc(100dvh - var(--comp-header-nav-top-height) - 16px);
}
@include media-breakpoint-up(lg) {
height: var(--megamenu-height, auto);
max-height: calc(100vh - var(--comp-header-nav-top-height) - 16px);
max-height: calc(100dvh - var(--comp-header-nav-top-height) - 16px);
@include transition($transition-collapse);
}
}
&__body {
//min-height: 440px;
}
&__item {
// Keep the source aliases as fallbacks until these component tokens are generated.
padding-inline: var(--comp-navbar-mega-menu-item-inset-h);
padding-block: var(--comp-navbar-mega-menu-item-inset-v);
gap: var(--comp-navbar-mega-menu-item-inline);
border-radius: var(--comp-navbar-mega-menu-item-border-radius);
min-width: var(--comp-navbar-mega-menu-item-min-width, var(--sys-size-width-17500, 280px));
background-color: var(--comp-navbar-mega-menu-item-enabled-background-color);
color: var(--comp-navbar-mega-menu-item-enabled-text-color);
> .h5,
> .#{$namespace}iconBlock:not(.#{$namespace}megamenu__arrow) {
color: inherit;
}
&.-selected,
&.-current {
background-color: var(--comp-navbar-mega-menu-item-active-background-color);
color: var(--comp-navbar-mega-menu-item-active-text-color);
}
@include hover {
background-color: var(--comp-navbar-mega-menu-item-hovered-background-color);
color: var(--comp-navbar-mega-menu-item-hovered-text-color);
}
&:active,
&:focus-visible {
background-color: var(--comp-navbar-mega-menu-item-pressed-background-color);
color: var(--comp-navbar-mega-menu-item-pressed-text-color);
}
&:hover,
&.-selected,
&.-current,
&:active,
&:focus-visible {
> .#{$namespace}iconBlock {
@include custom-prop-fallback("background-color", "comp-navbar-icon-block-active-background-color");
}
}
}
&__footer {
position: sticky;
bottom: 0;
}
@include media-breakpoint-up(lg) {
max-width: 1020px;
// Override the retained standalone w-100 utility as well as the mobile width.
width: auto !important;
&.-standalone.show { display: inline-block; }
--megamenu-column-width: calc((min(1020px, calc(100vw - #{map-deep-get($token-spacer-unit-map, "32")})) - #{map-deep-get($token-spacer-unit-map, "24") * 2} - 2 * var(--megamenu-gap)) / 3);
&__surface {
padding: map-deep-get($token-spacer-unit-map, "24");
width: calc(var(--megamenu-visible-columns, 1) * var(--megamenu-column-width) + (var(--megamenu-visible-columns, 1) - 1) * var(--megamenu-gap) + #{map-deep-get($token-spacer-unit-map, "24") * 2});
}
&__body { min-height: var(--megamenu-content-height, 0px); }
&__body > [data-megamenu-list],
&__footer {
width: var(--megamenu-column-width);
}
&__level {
position: absolute;
top: 0;
left: calc(100% + var(--megamenu-gap));
width: 100%;
min-height: var(--megamenu-content-height, 0px);
&::before {
content: "";
position: absolute;
top: 0;
bottom: 0;
left: calc(var(--megamenu-gap) / -2);
border-left: 1px solid currentColor;
opacity: .3;
}
}
}
}
.#{$namespace}header.-megamenuOpen { transform: none; }