@openeuropa/bcl-file 0.22.0 → 0.23.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.
Files changed (2) hide show
  1. package/file.html.twig +14 -9
  2. package/package.json +5 -5
package/file.html.twig CHANGED
@@ -4,6 +4,7 @@
4
4
  Parameters:
5
5
  - title (string) (default: '')
6
6
  - title_tag (string) (default: 'h2')
7
+ - title_link: (link object) (default: {})
7
8
  - title_attributes (drupal attrs)
8
9
  - item_title (string) (default: '')
9
10
  - icon (icon Object) (default: {})
@@ -38,6 +39,7 @@
38
39
  {% set _icon = icon|default({}) %}
39
40
  {% set _title = title|default('') %}
40
41
  {% set _title_tag = title_tag|default('h2') %}
42
+ {% set _title_link = title_link|default({}) %}
41
43
  {% set _title_attributes = title_attributes ?: create_attribute() %}
42
44
  {% set _item_title = item_title|default('') %}
43
45
  {% set _text = text|default('') %}
@@ -51,6 +53,12 @@
51
53
  {% set _translation = translation|default({}) %}
52
54
  {% set _icon_path = icon_path|default({}) %}
53
55
 
56
+ {% if attributes is empty %}
57
+ {% set attributes = create_attribute() %}
58
+ {% endif %}
59
+
60
+ {% set attributes = attributes.addClass(['bcl-file']) %}
61
+
54
62
  {% set _container_classes = 'w-100 d-md-flex' %}
55
63
  {% if _icon is not empty %}
56
64
  {% set _container_classes = _container_classes ~ ' ms-2-5' %}
@@ -59,14 +67,11 @@
59
67
  }) %}
60
68
  {% endif %}
61
69
 
62
- {% if attributes is empty %}
63
- {% set attributes = create_attribute() %}
64
- {% endif %}
65
-
66
70
  {% if _title is not empty %}
67
71
  {% include '@oe-bcl/bcl-heading/heading.html.twig' with {
68
72
  title: _title,
69
73
  title_tag: _title_tag,
74
+ title_link: _title_link,
70
75
  attributes: _title_attributes,
71
76
  } only %}
72
77
  {% endif %}
@@ -85,9 +90,7 @@
85
90
  right_col_classes: "col-12 col-md-8",
86
91
  },
87
92
  badges: _badges,
88
- title: {
89
- content: _item_title,
90
- },
93
+ title: _item_title,
91
94
  text: {
92
95
  content: _text,
93
96
  classes: "mb-2",
@@ -137,7 +140,8 @@
137
140
  path: _icon_path,
138
141
  },
139
142
  attributes: create_attribute()
140
- .setAttribute('download', _download.url)
143
+ .setAttribute('download', true)
144
+ .setAttribute('target', '_blank')
141
145
  .addClass(['standalone', 'align-self-center', 'd-inline-block', 'mt-1', 'mt-md-0'])
142
146
  }) %}
143
147
  {% include '@oe-bcl/bcl-link/link.html.twig' with _download only %}
@@ -196,7 +200,8 @@
196
200
  path: _icon_path,
197
201
  },
198
202
  attributes: create_attribute()
199
- .setAttribute("download", _item.download.url)
203
+ .setAttribute('download', true)
204
+ .setAttribute('target', '_blank')
200
205
  .addClass(['d-block', 'standalone', 'mt-1'])
201
206
  }) only %}
202
207
  </div>
package/package.json CHANGED
@@ -2,15 +2,15 @@
2
2
  "name": "@openeuropa/bcl-file",
3
3
  "author": "European Commission",
4
4
  "license": "EUPL-1.2",
5
- "version": "0.22.0",
5
+ "version": "0.23.0",
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },
9
9
  "description": "OE - BCL file",
10
10
  "dependencies": {
11
- "@openeuropa/bcl-heading": "^0.22.0",
12
- "@openeuropa/bcl-icon": "^0.22.0",
13
- "@openeuropa/bcl-link": "^0.22.0"
11
+ "@openeuropa/bcl-heading": "^0.23.0",
12
+ "@openeuropa/bcl-icon": "^0.23.0",
13
+ "@openeuropa/bcl-link": "^0.23.0"
14
14
  },
15
15
  "repository": {
16
16
  "type": "git",
@@ -26,5 +26,5 @@
26
26
  "design-system",
27
27
  "twig"
28
28
  ],
29
- "gitHead": "57304ad94ae3c234f2f2b904208ce540a7a53f23"
29
+ "gitHead": "fa2097e14024989cddf6f9cd7a9115bed5886aeb"
30
30
  }