@openeuropa/bcl-theme-joinup 1.10.5 → 1.10.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -91,7 +91,7 @@
91
91
  {% set _nav_class = _nav_class ~ ' dropdown' %}
92
92
  {% set _item = _item|merge({remove_wrapper: true}) %}
93
93
  {% endif %}
94
- {% if _item.dropdown %}
94
+ {% if _item.dropdown or _item.mega_menu %}
95
95
  {% set _item_classes = [] %}
96
96
  {% else %}
97
97
  {% set _item_classes = ['nav-link'] %}
@@ -124,6 +124,8 @@
124
124
  {% include '@oe-bcl/bcl-dropdown/dropdown.html.twig' with _item only %}
125
125
  {% elseif _item.button is defined %}
126
126
  {% include '@oe-bcl/bcl-button/button.html.twig' with _item only %}
127
+ {% elseif _item.mega_menu is defined %}
128
+ {% include '@oe-bcl/bcl-mega-menu/mega-menu.html.twig' with _item only %}
127
129
  {% else %}
128
130
  {% include '@oe-bcl/bcl-link/link.html.twig' with _item only %}
129
131
  {% endif %}
@@ -25,7 +25,7 @@
25
25
  {% set _title_link = title_link|default({}) %}
26
26
  {% set _title_attributes = title_attributes ?: create_attribute() %}
27
27
  {% set _placement = placement|default('') %}
28
- {% set _id = id|default('') %}
28
+ {% set _id = id|default('bcl-offcanvas-' ~ random(10000)) %}
29
29
  {% set _body = body|default('') %}
30
30
  {% set _with_body_scroll = with_body_scroll ?? false %}
31
31
  {% set _with_backdrop = with_backdrop ?? true %}
@@ -57,14 +57,12 @@
57
57
  {% set attributes = create_attribute() %}
58
58
  {% endif %}
59
59
 
60
+ {% set attributes = attributes.setAttribute('id', _id) %}
61
+
60
62
  {% if _aria_labelled is defined and _aria_labelled is not empty %}
61
63
  {% set attributes = attributes.setAttribute('aria-labelledby', _aria_labelled) %}
62
64
  {% endif %}
63
65
 
64
- {% if _id is not empty %}
65
- {% set attributes = attributes.setAttribute('id', _id) %}
66
- {% endif %}
67
-
68
66
  {% if _with_body_scroll %}
69
67
  {% set attributes = attributes.setAttribute('data-bs-scroll', 'true') %}
70
68
  {% endif %}
@@ -73,6 +71,10 @@
73
71
  {% set attributes = attributes.setAttribute('data-bs-backdrop', 'false') %}
74
72
  {% endif %}
75
73
 
74
+ {% if _title is not empty %}
75
+ {% set attributes = attributes.setAttribute('aria-labelledby', _id ~ '-title') %}
76
+ {% endif %}
77
+
76
78
  {% set attributes = attributes.setAttribute('tabindex', '-1').addClass(_classes) %}
77
79
 
78
80
  <div
@@ -85,7 +87,7 @@
85
87
  title: _title,
86
88
  title_tag: _title_tag,
87
89
  title_link: _title_link,
88
- attributes: _title_attributes.addClass(['offcanvas-title']),
90
+ attributes: _title_attributes.setAttribute('id', _id ~ '-title').addClass(['offcanvas-title']),
89
91
  } only %}
90
92
  {% endif %}
91
93
  {% if _with_close %}
@@ -94,6 +96,7 @@
94
96
  .setAttribute('data-bs-dismiss', 'offcanvas')
95
97
  .setAttribute('data-bs-target', '#' ~ _id)
96
98
  .setAttribute('aria-label', _close_aria_label)
99
+ .setAttribute('aria-controls', _id)
97
100
  %}
98
101
  {% if _extra_classes_close is not empty %}
99
102
  {% set button_attributes = button_attributes.addClass(_extra_classes_close) %}