@openeuropa/bcl-mega-menu 0.4230.202512021730 → 0.4360.202601141610

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.
@@ -2,31 +2,31 @@
2
2
  {% set _items = items ?? [] %}
3
3
  {% set _icon_path = icon_path ?? '' %}
4
4
  {% set _level = level ?? 1 %}
5
- {% set _see_all = see_all ?? null %}
5
+ {% set _see_all = see_all ?? null -%}
6
6
 
7
7
  <ul class="bcl-mega-menu__items __level-{{ _level }}">
8
- {% for _item in _items %}
9
- {% set _li_attributes = _item.li_attributes ?? create_attribute() %}
10
- {% if _item.items is defined and _item.items is not empty %}
11
- {# This is a parent item. #}
8
+ {%- for _item in _items %}
9
+ {%- set _li_attributes = _item.li_attributes ?? create_attribute() %}
10
+ {%- if _item.items is defined and _item.items is not empty %}
11
+ {#- This is a parent item. -#}
12
12
  <li{{ _li_attributes.addClass('__parent') }}>
13
- {% include '@oe-bcl/bcl-mega-menu/mega-menu-submenu.html.twig' with _item|merge({
13
+ {%- include '@oe-bcl/bcl-mega-menu/mega-menu-submenu.html.twig' with _item|merge({
14
14
  icon_path: _icon_path,
15
15
  level: _level + 1,
16
- }) only %}
16
+ }) only -%}
17
17
  </li>
18
- {% else %}
19
- {# This is a leaf item. #}
18
+ {%- else %}
19
+ {#- This is a leaf item. -#}
20
20
  <li{{ _li_attributes.addClass('__leaf') }}>
21
- {% if _item.path is empty %}
22
- {# This is a nolink item. #}
21
+ {%- if _item.path is empty %}
22
+ {#- This is a nolink item. -#}
23
23
  <span{{ _item.attributes ?? '' }}>{{ _item.label }}</span>
24
- {% else %}
25
- {# This is a link. #}
26
- {% include '@oe-bcl/bcl-link/link.html.twig' with _item only %}
27
- {% endif %}
24
+ {%- else %}
25
+ {#- This is a link. #}
26
+ {%- include '@oe-bcl/bcl-link/link.html.twig' with _item only %}
27
+ {%- endif -%}
28
28
  </li>
29
- {% endif %}
30
- {% endfor %}
29
+ {%- endif %}
30
+ {%- endfor -%}
31
31
  </ul>
32
-
32
+ {#--#}
@@ -4,10 +4,10 @@
4
4
  {% set _level = level ?? 2 %}
5
5
  {% set _see_all = see_all ?? null %}
6
6
 
7
- {% set _trigger_id = _trigger.id|default('mm-trigger-' ~ random(10000)) %}
7
+ {%- set _trigger_id = _trigger.id|default('mm-trigger-' ~ random(10000)) %}
8
8
  {% set _panel_id = 'mm-panel-' ~ _trigger_id %}
9
9
 
10
- {% set _trigger_attributes = _trigger.attributes ?? create_attribute() %}
10
+ {%- set _trigger_attributes = _trigger.attributes ?? create_attribute() %}
11
11
  {% set _trigger = _trigger|merge({
12
12
  attributes: _trigger_attributes
13
13
  .setAttribute('id', _trigger_id)
@@ -19,26 +19,24 @@
19
19
  }) %}
20
20
  {% include '@oe-bcl/bcl-button/button.html.twig' with _trigger only %}
21
21
 
22
- {# Add an optional "See all" link as last item. #}
22
+ {%- set _see_all_link = null %}
23
+ {# Prepare an optional "See all" link rendered outside the list. #}
23
24
  {% if _see_all is not empty %}
24
- {# Wrap the label for an ellipsis. #}
25
- {% set _see_all_label %}
25
+ {%- set _see_all_label -%}
26
26
  <span>{{- _see_all.label -}}</span>
27
- {% endset %}
28
- {% set _see_all_attr = (_see_all.attributes is defined ? _see_all.attributes : create_attribute()) %}
29
- {% set _see_all = _see_all|merge({
27
+ {%- endset %}
28
+ {%- set _see_all_attr = (_see_all.attributes is defined ? _see_all.attributes : create_attribute()) %}
29
+ {%- set _see_all_link = _see_all|merge({
30
30
  label: _see_all_label,
31
31
  icon: {
32
+ size: 'xs',
32
33
  name: 'arrow-right',
33
34
  path: _icon_path,
34
35
  },
35
- li_attributes: create_attribute()
36
- .addClass('__see_all'),
37
36
  attributes: _see_all_attr
38
37
  .addClass(['see-all-button'])
39
38
  .setAttribute('aria-label', 'See all items in ‘' ~ _trigger.label ~ '’')
40
39
  }) %}
41
- {% set _items = _items|merge([_see_all]) %}
42
40
  {% endif %}
43
41
  {% set submenu_attributes = create_attribute()
44
42
  .setAttribute('id', _panel_id)
@@ -46,17 +44,24 @@
46
44
  .setAttribute('role', 'group')
47
45
  .setAttribute('aria-labelledby', _trigger_id)
48
46
  .addClass('bcl-mega-menu__submenu', '__level-' ~ _level)
49
- %}
47
+ -%}
50
48
  <div{{ submenu_attributes }}>
51
- {% if _trigger %}
52
- <div class="__header">
53
- <p class="__label">{{ _trigger.label }}</p>
49
+ {%- if _trigger -%}
50
+ <div class="__header">{# -#}
51
+ <p class="__label">{{ _trigger.label }}</p>{# -#}
52
+ </div>
53
+ {%- endif %}
54
+ <div class="__submenu_body">
55
+ {%- include '@oe-bcl/bcl-mega-menu/mega-menu-items.html.twig' with {
56
+ items: _items,
57
+ icon_path: _icon_path,
58
+ level: _level,
59
+ } only -%}
60
+ {%- if _see_all_link -%}
61
+ <div class="__see_all">
62
+ {% include '@oe-bcl/bcl-link/link.html.twig' with _see_all_link only %}
63
+ </div>
64
+ {%- endif -%}
54
65
  </div>
55
- {% endif %}
56
- {% include '@oe-bcl/bcl-mega-menu/mega-menu-items.html.twig' with {
57
- items: _items,
58
- icon_path: _icon_path,
59
- level: _level,
60
- } only %}
61
66
  </div>
62
-
67
+ {#--#}
@@ -17,7 +17,7 @@
17
17
  - icon_path (string) (default: '')
18
18
  #}
19
19
 
20
- {% set _id = id|default('dropdown-' ~ random(1000)) %}
20
+ {%- set _id = id|default('dropdown-' ~ random(1000)) %}
21
21
  {% set _link = link ?? false %}
22
22
  {% set _trigger = trigger|default({}) %}
23
23
  {% set _content_block = content_block|default('') %}
@@ -28,16 +28,16 @@
28
28
  {% set _icon_path = icon_path|default('') %}
29
29
  {% set _menu_id = 'mega-menu-' ~ _id %}
30
30
 
31
- {% if attributes is empty %}
32
- {% set attributes = create_attribute() %}
31
+ {%- if attributes is empty %}
32
+ {%- set attributes = create_attribute() %}
33
33
  {% endif %}
34
34
 
35
- {% set _classes = ['bcl-mega-menu'] %}
35
+ {%- set _classes = ['bcl-mega-menu'] %}
36
36
 
37
- {% set attributes = attributes.addClass(_classes) %}
37
+ {%- set attributes = attributes.addClass(_classes) %}
38
38
 
39
- {% if _trigger.attributes is empty %}
40
- {% set _trigger = _trigger|merge({
39
+ {%- if _trigger.attributes is empty %}
40
+ {%- set _trigger = _trigger|merge({
41
41
  attributes: create_attribute()
42
42
  }) %}
43
43
  {% endif %}
@@ -49,19 +49,19 @@
49
49
  .setAttribute('data-bs-toggle', 'dropdown')
50
50
  .setAttribute('data-bs-auto-close', 'outside')
51
51
  .setAttribute('id', _id)
52
- }) %}
52
+ }) -%}
53
53
 
54
54
  <div {{ attributes }}>
55
- {% include '@oe-bcl/bcl-button/button.html.twig' with _trigger|merge({
55
+ {%- include '@oe-bcl/bcl-button/button.html.twig' with _trigger|merge({
56
56
  variant: 'link',
57
57
  clean_class: true,
58
58
  }) only %}
59
- {# Mega menu panel. #}
60
- <nav id="{{ _menu_id }}" class="bcl-mega-menu__container dropdown-menu" aria-labelledby="{{ _id }}" aria-label="Main mega menu">
59
+ {#- Mega menu panel. -#}
60
+ <nav id="{{ _menu_id }}" class="bcl-mega-menu__container dropdown-menu" aria-labelledby="{{ _id }}" aria-label="Main mega menu">{# -#}
61
61
  <div class="container">
62
- {# Mobile back button. #}
62
+ {#- Mobile back button. -#}
63
63
  <div class="container d-lg-none bcl-mega-menu__back-button-block">
64
- {% include '@oe-bcl/bcl-button/button.html.twig' with {
64
+ {%- include '@oe-bcl/bcl-button/button.html.twig' with {
65
65
  label: _back_button_label,
66
66
  icon_position: "before",
67
67
  variant: 'link',
@@ -70,20 +70,20 @@
70
70
  name: "arrow-left",
71
71
  },
72
72
  attributes: create_attribute().addClass(['back-button']).setAttribute('aria-label', 'Back to main menu')
73
- } only %}
73
+ } only -%}
74
74
  </div>
75
- {# Info/summary and submenu columns. #}
76
- <div class="position-relative">
75
+ {#- Info/summary and submenu columns. -#}
76
+ <div class="position-relative">{# -#}
77
77
  <div class="row">
78
- {# Content / summary column. #}
79
- {% if content_block is defined %}
80
- <div class="col-md-12 col-xl-3 position-relative bcl-mega-menu__info">
78
+ {#- Content / summary column. #}
79
+ {%- if content_block is defined -%}
80
+ <div class="col-md-12 col-xl-3 position-relative bcl-mega-menu__info">{# -#}
81
81
  <div class="content-block">
82
82
  {%- block content_block -%}
83
83
  {{ _content_block }}
84
84
  {%- endblock -%}
85
85
  {% if _content_link.path is not empty %}
86
- {% set _content_link = _content_link|merge({
86
+ {%- set _content_link = _content_link|merge({
87
87
  icon: _content_link.icon|default({})|merge({
88
88
  path: _icon_path
89
89
  }),
@@ -91,22 +91,24 @@
91
91
  ? _content_link.attributes
92
92
  : create_attribute()
93
93
  ).addClass('content-link')
94
- }) %}
94
+ }) -%}
95
95
  <p class="m-0">{% include '@oe-bcl/bcl-link/link.html.twig' with _content_link only %}</p>
96
- {% endif %}
97
- </div>
98
- <div class="shadow-container">
99
- <span class="shadow-bg"></span>
100
- </div>
96
+ {%- endif -%}
97
+ </div>{# -#}
98
+ <div class="shadow-container">{# -#}
99
+ <span class="shadow-bg"></span>{# -#}
100
+ </div>{# -#}
101
101
  </div>
102
- {% endif %}
103
- {# Submenu column. #}
102
+ {%- endif %}
103
+ {#- Submenu column. -#}
104
104
  <div class="col-md-12 col-lg-4 col-xl-3 bcl-mega-menu__menu">
105
- {% include '@oe-bcl/bcl-mega-menu/mega-menu-items.html.twig' %}
106
- </div>
107
- </div>
108
- </div>
109
- </div>
110
- </nav>
105
+ <div class="__submenu_body">
106
+ {% include '@oe-bcl/bcl-mega-menu/mega-menu-items.html.twig' %}
107
+ </div>{# -#}
108
+ </div>{# -#}
109
+ </div>{# -#}
110
+ </div>{# -#}
111
+ </div>{# -#}
112
+ </nav>{# -#}
111
113
  </div>
112
-
114
+ {#--#}
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.4230.202512021730",
5
+ "version": "0.4360.202601141610",
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },
9
9
  "description": "OE - BCL mega menu",
10
10
  "dependencies": {
11
- "@openeuropa/bcl-button": "^0.4230.202512021730",
12
- "@openeuropa/bcl-dropdown": "^0.4230.202512021730",
13
- "@openeuropa/bcl-link": "^0.4230.202512021730"
11
+ "@openeuropa/bcl-button": "^0.4360.202601141610",
12
+ "@openeuropa/bcl-dropdown": "^0.4360.202601141610",
13
+ "@openeuropa/bcl-link": "^0.4360.202601141610"
14
14
  },
15
15
  "repository": {
16
16
  "type": "git",
@@ -26,5 +26,5 @@
26
26
  "design-system",
27
27
  "twig"
28
28
  ],
29
- "gitHead": "19735e328b2b53ccefbcc6829e2aaf149a2c438c"
29
+ "gitHead": "2caf9255f88587416f6e83e572a1f20e4cf206f5"
30
30
  }