@openeuropa/bcl-mega-menu 0.3694.202508290100 → 0.3694.202508290300
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.
- package/mega-menu.html.twig +10 -5
- package/package.json +5 -5
package/mega-menu.html.twig
CHANGED
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
{% set _items = items|default([]) %}
|
|
30
30
|
{% set _back_button_label = back_button_label|default('Back') %}
|
|
31
31
|
{% set _icon_path = icon_path|default('') %}
|
|
32
|
+
{% set _menu_id = 'mega-menu-' ~ _id %}
|
|
32
33
|
|
|
33
34
|
{% if attributes is empty %}
|
|
34
35
|
{% set attributes = create_attribute() %}
|
|
@@ -36,7 +37,7 @@
|
|
|
36
37
|
|
|
37
38
|
{% set _classes = ['bcl-mega-menu'] %}
|
|
38
39
|
|
|
39
|
-
{% set attributes = attributes.
|
|
40
|
+
{% set attributes = attributes.addClass(_classes) %}
|
|
40
41
|
|
|
41
42
|
{% if _trigger.attributes is empty %}
|
|
42
43
|
{% set _trigger = _trigger|merge({
|
|
@@ -46,6 +47,8 @@
|
|
|
46
47
|
{% set _trigger = _trigger|merge({
|
|
47
48
|
attributes: _trigger.attributes.addClass(['dropdown-toggle', 'nav-link'])
|
|
48
49
|
.setAttribute('aria-expanded', 'false')
|
|
50
|
+
.setAttribute('aria-haspopup', 'menu')
|
|
51
|
+
.setAttribute('aria-controls', _menu_id)
|
|
49
52
|
.setAttribute('data-bs-toggle', 'dropdown')
|
|
50
53
|
.setAttribute('data-bs-auto-close', 'outside')
|
|
51
54
|
.setAttribute('id', _id)
|
|
@@ -64,7 +67,7 @@
|
|
|
64
67
|
{% include '@oe-bcl/bcl-button/button.html.twig' with _trigger|merge({
|
|
65
68
|
variant: 'link'
|
|
66
69
|
}) only %}
|
|
67
|
-
<
|
|
70
|
+
<nav id="{{ _menu_id }}" class="mega-menu-container dropdown-menu" aria-labelledby="{{ _id }}" aria-label="Main mega menu">
|
|
68
71
|
<div class="container position-relative">
|
|
69
72
|
<div class="d-lg-none back-button-block">
|
|
70
73
|
{% include '@oe-bcl/bcl-button/button.html.twig' with {
|
|
@@ -75,7 +78,7 @@
|
|
|
75
78
|
path: _icon_path,
|
|
76
79
|
name: "arrow-left",
|
|
77
80
|
},
|
|
78
|
-
attributes: create_attribute().addClass(['back-button'])
|
|
81
|
+
attributes: create_attribute().addClass(['back-button']).setAttribute('aria-label', 'Back to main menu')
|
|
79
82
|
} only %}
|
|
80
83
|
</div>
|
|
81
84
|
<div class="row">
|
|
@@ -125,7 +128,7 @@
|
|
|
125
128
|
name: 'arrow-right',
|
|
126
129
|
path: _icon_path,
|
|
127
130
|
},
|
|
128
|
-
attributes: _see_all_attr.addClass(['see-all-button'])
|
|
131
|
+
attributes: _see_all_attr.addClass(['see-all-button']).setAttribute('aria-label', 'See all items in ‘' ~ _raw.trigger.label ~ '’')
|
|
129
132
|
}) %}
|
|
130
133
|
|
|
131
134
|
{% set _raw_items = _raw_items|merge([ _see_all ]) %}
|
|
@@ -174,6 +177,7 @@
|
|
|
174
177
|
id="{{ _panel.id }}"
|
|
175
178
|
role="tabpanel"
|
|
176
179
|
aria-labelledby="{{ _panel.trigger_id }}"
|
|
180
|
+
tabindex="0"
|
|
177
181
|
>
|
|
178
182
|
<p class="panel-title">{{ _panel.title }}</p>
|
|
179
183
|
<ul class="list-unstyled m-0 position-relative">
|
|
@@ -183,6 +187,7 @@
|
|
|
183
187
|
attributes: create_attribute()
|
|
184
188
|
}) %}
|
|
185
189
|
{% endif %}
|
|
190
|
+
{% set _item_classes = [] %}
|
|
186
191
|
{% if _item.active %}
|
|
187
192
|
{% set _item_classes = _item_classes|merge(['active']) %}
|
|
188
193
|
{% endif %}
|
|
@@ -204,7 +209,7 @@
|
|
|
204
209
|
</div>
|
|
205
210
|
</div>
|
|
206
211
|
</div>
|
|
207
|
-
</
|
|
212
|
+
</nav>
|
|
208
213
|
</div>
|
|
209
214
|
|
|
210
215
|
{% endapply %}
|
package/package.json
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
"name": "@openeuropa/bcl-mega-menu",
|
|
3
3
|
"author": "European Commission",
|
|
4
4
|
"license": "EUPL-1.2",
|
|
5
|
-
"version": "0.3694.
|
|
5
|
+
"version": "0.3694.202508290300",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
8
8
|
},
|
|
9
9
|
"description": "OE - BCL mega menu",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@openeuropa/bcl-button": "^0.3694.
|
|
12
|
-
"@openeuropa/bcl-dropdown": "^0.3694.
|
|
13
|
-
"@openeuropa/bcl-link": "^0.3694.
|
|
11
|
+
"@openeuropa/bcl-button": "^0.3694.202508290300",
|
|
12
|
+
"@openeuropa/bcl-dropdown": "^0.3694.202508290300",
|
|
13
|
+
"@openeuropa/bcl-link": "^0.3694.202508290300"
|
|
14
14
|
},
|
|
15
15
|
"repository": {
|
|
16
16
|
"type": "git",
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"design-system",
|
|
27
27
|
"twig"
|
|
28
28
|
],
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "18d93e77b10a08bfa7eae1c594b42144cb4b451b"
|
|
30
30
|
}
|