@openeuropa/bcl-mega-menu 0.1057.202503031100 → 0.3694.202507310910

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.
Files changed (2) hide show
  1. package/mega-menu.html.twig +40 -12
  2. package/package.json +5 -5
@@ -5,14 +5,14 @@
5
5
  - link (boolean) (default: false) - sets trigger to link, default is button
6
6
  - trigger (link or button)
7
7
  - content_block (block) (default: '')
8
+ - content_link (link)
9
+ - icon_path (string) (default: '')
8
10
  - min_height (string) (default: '300px')
9
11
  ! set min-height of mega-menu
10
12
  - items (object[])
11
13
  format: [
12
14
  {
13
15
  - link or dropdown
14
- ! dropdown extra property:
15
- collapse (render) - to showcase on the last column
16
16
  }
17
17
  ]
18
18
  - back_button_label (string) (default: 'Back')
@@ -23,6 +23,8 @@
23
23
  {% set _link = link ?? false %}
24
24
  {% set _trigger = trigger|default({}) %}
25
25
  {% set _content_block = content_block|default('') %}
26
+ {% set _content_link = content_link|default({}) %}
27
+ {% set _icon_path = icon_path|default('') %}
26
28
  {% set _min_height = min_height|default('300px') %}
27
29
  {% set _items = items|default([]) %}
28
30
  {% set _back_button_label = back_button_label|default('Back') %}
@@ -77,33 +79,59 @@
77
79
  attributes: create_attribute().addClass(['back-button'])
78
80
  } only %}
79
81
  </div>
80
- <div class="row position-relative">
82
+ <div class="row pb-md-3">
81
83
  {% if content_block is defined %}
82
- <div class="col-12 col-lg-4">
83
- <div class="content-block py-3">
84
+ <div class="col-md-12 col-xl-3">
85
+ <div class="content-block">
84
86
  {%- block content_block -%}
85
87
  {{ _content_block }}
86
88
  {%- endblock -%}
89
+ {% if _content_link is defined %}
90
+ {% set _content_link = _content_link|merge({
91
+ icon: _content_link.icon|default({})|merge({
92
+ path: _icon_path
93
+ }),
94
+ attributes: (_content_link.attributes is defined
95
+ ? _content_link.attributes
96
+ : create_attribute()
97
+ ).addClass('content-link')
98
+ }) %}
99
+
100
+ {% include '@oe-bcl/bcl-link/link.html.twig' with _content_link only %}
101
+ {% endif %}
87
102
  </div>
88
103
  </div>
89
104
  {% endif %}
90
- <div class="col-12 col-lg-8">
105
+ <div class="col-md-12 col-xl-9 mb-lg-3">
91
106
  <div class="navigation-items">
92
107
  {% for _item in _items %}
93
108
  {% if _item.items is defined %}
109
+ {% set _items_list = _item.items %}
110
+ {% if _item.see_all is defined %}
111
+ {% set _items_list = _items_list|merge([
112
+ _item.see_all|merge({
113
+ icon: {
114
+ name: "arrow-right",
115
+ path: _icon_path,
116
+ },
117
+ attributes: create_attribute().addClass('see-all-button')
118
+ })
119
+ ]) %}
120
+ {% endif %}
121
+ {% set _item = _item|merge({ items: _items_list }) %}
94
122
  {% set _trigger_attributes = _item.trigger.attributes is defined ? _item.trigger.attributes : create_attribute() %}
95
123
  {% include '@oe-bcl/bcl-dropdown/dropdown.html.twig' with _item|merge({
96
124
  direction: 'dropend',
97
125
  link: true,
98
126
  trigger: _item.trigger|merge({
99
- attributes: _trigger_attributes.setAttribute('data-bs-auto-close', 'false')
127
+ icon: {
128
+ name: "chevron-right",
129
+ path: _icon_path,
130
+ size: "fluid",
131
+ },
132
+ attributes: _trigger_attributes.setAttribute('data-bs-auto-close', 'outside')
100
133
  })
101
134
  }) only %}
102
- {% if _item.collapse is defined %}
103
- <div class="collapse">
104
- {{ _item.collapse|raw }}
105
- </div>
106
- {% endif %}
107
135
  {% else %}
108
136
  {% include '@oe-bcl/bcl-link/link.html.twig' with _item only %}
109
137
  {% endif %}
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.1057.202503031100",
5
+ "version": "0.3694.202507310910",
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },
9
9
  "description": "OE - BCL mega menu",
10
10
  "dependencies": {
11
- "@openeuropa/bcl-button": "^0.1057.202503031100",
12
- "@openeuropa/bcl-dropdown": "^0.1057.202503031100",
13
- "@openeuropa/bcl-link": "^0.1057.202503031100"
11
+ "@openeuropa/bcl-button": "^0.3694.202507310910",
12
+ "@openeuropa/bcl-dropdown": "^0.3694.202507310910",
13
+ "@openeuropa/bcl-link": "^0.3694.202507310910"
14
14
  },
15
15
  "repository": {
16
16
  "type": "git",
@@ -26,5 +26,5 @@
26
26
  "design-system",
27
27
  "twig"
28
28
  ],
29
- "gitHead": "bc17151b7d40bf73fea2c5fb3f40da249dfa4a2f"
29
+ "gitHead": "308519827015f3c551adb98919f77d97f0687680"
30
30
  }