@openeuropa/bcl-inpage-navigation 0.22.0 → 0.25.0

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,17 +2,22 @@
2
2
 
3
3
  {#
4
4
  Parameters:
5
- - "title": (string) (default: '')
6
- - "full_layout": (boolean) (default: false)
7
- - "links": (array of link objects) (default: [])
8
- - "content": (string) (default: '')
5
+ - title: (string) (default: '')
6
+ - title_tag: (string) (default: 'h3')
7
+ - title_link: (link object) (default: {})
8
+ - title_attributes (drupal attrs)
9
+ - links: (array of link objects) (default: [])
10
+ - id (string) (default: 'bcl-inpage-navigation-' random(10))
11
+ - attributes (drupal attrs)
9
12
  #}
10
13
 
11
- {# Internal properties #}
12
14
  {% set _title = title|default('') %}
15
+ {% set _title_tag = title_tag|default('h2') %}
16
+ {% set _title_link = title_link|default({}) %}
17
+ {% set _title_attributes = title_attributes ?: create_attribute() %}
13
18
  {% set _links = links|default([]) %}
14
19
  {% set _content = content|default('') %}
15
- {% set _id = id|default('bcl-inpage-navigation-' ~ random(5)) %}
20
+ {% set _id = id|default('bcl-inpage-navigation-' ~ random(10)) %}
16
21
  {% set _full_layout = full_layout|default(false) %}
17
22
 
18
23
  {% if attributes is empty %}
@@ -20,28 +25,20 @@ Parameters:
20
25
  {% endif %}
21
26
 
22
27
  {% set attributes = attributes.addClass(['bcl-inpage-navigation', 'position-sticky']).setAttribute('id', _id) %}
28
+ {% set title_attributes = _title_attributes.addClass('mb-0') %}
23
29
 
24
- {# Print the result #}
25
- {% if _full_layout %}
26
- <div class="row">
27
- <div class="col-md-3 d-none d-md-block">
28
- {% endif %}
29
- <nav {{ attributes }}>
30
- {% if _title is defined and _title is not empty %}
31
- <h5>{{ _title }}</h5>
32
- {% endif %}
33
- {% include '@oe-bcl/bcl-navigation/navigation.html.twig' with {
34
- 'pills': true,
35
- 'vertical': true,
36
- 'items': _links,
37
- } only %}
38
- </nav>
39
- {% if _full_layout %}
40
- </div>
41
- <div class="col-md-9">
42
- {{ _content }}
43
- </div>
44
- </div>
45
- {% endif %}
30
+ <nav {{ attributes }}>
31
+ {% include '@oe-bcl/bcl-heading/heading.html.twig' with {
32
+ title: _title,
33
+ title_tag: _title_tag,
34
+ title_link: _title_link,
35
+ attributes: _title_attributes.addClass('mb-0'),
36
+ } only %}
37
+ {% include '@oe-bcl/bcl-navigation/navigation.html.twig' with {
38
+ 'pills': true,
39
+ 'vertical': true,
40
+ 'items': _links,
41
+ } only %}
42
+ </nav>
46
43
 
47
44
  {% endspaceless %}
package/package.json CHANGED
@@ -2,13 +2,16 @@
2
2
  "name": "@openeuropa/bcl-inpage-navigation",
3
3
  "author": "European Commission",
4
4
  "license": "EUPL-1.2",
5
- "version": "0.22.0",
5
+ "version": "0.25.0",
6
6
  "description": "OE - BCL inpage navigation",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
10
10
  "dependencies": {
11
- "@openeuropa/bcl-navigation": "^0.22.0"
11
+ "@openeuropa/bcl-navigation": "^0.25.0"
12
+ },
13
+ "devDependencies": {
14
+ "lorem-ipsum": "2.0.8"
12
15
  },
13
16
  "repository": {
14
17
  "type": "git",
@@ -24,5 +27,5 @@
24
27
  "design-system",
25
28
  "twig"
26
29
  ],
27
- "gitHead": "57304ad94ae3c234f2f2b904208ce540a7a53f23"
30
+ "gitHead": "f50c7dfeab8695bbb5c18d5f7d5304509512268a"
28
31
  }