@openeuropa/bcl-file 0.20.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 +22 -14
  2. package/package.json +5 -4
package/file.html.twig CHANGED
@@ -4,6 +4,8 @@
4
4
  Parameters:
5
5
  - title (string) (default: '')
6
6
  - title_tag (string) (default: 'h2')
7
+ - title_link: (link object) (default: {})
8
+ - title_attributes (drupal attrs)
7
9
  - item_title (string) (default: '')
8
10
  - icon (icon Object) (default: {})
9
11
  - text (string) (default: '')
@@ -37,6 +39,8 @@
37
39
  {% set _icon = icon|default({}) %}
38
40
  {% set _title = title|default('') %}
39
41
  {% set _title_tag = title_tag|default('h2') %}
42
+ {% set _title_link = title_link|default({}) %}
43
+ {% set _title_attributes = title_attributes ?: create_attribute() %}
40
44
  {% set _item_title = item_title|default('') %}
41
45
  {% set _text = text|default('') %}
42
46
  {% set _content = content|default('') %}
@@ -49,6 +53,12 @@
49
53
  {% set _translation = translation|default({}) %}
50
54
  {% set _icon_path = icon_path|default({}) %}
51
55
 
56
+ {% if attributes is empty %}
57
+ {% set attributes = create_attribute() %}
58
+ {% endif %}
59
+
60
+ {% set attributes = attributes.addClass(['bcl-file']) %}
61
+
52
62
  {% set _container_classes = 'w-100 d-md-flex' %}
53
63
  {% if _icon is not empty %}
54
64
  {% set _container_classes = _container_classes ~ ' ms-2-5' %}
@@ -57,15 +67,13 @@
57
67
  }) %}
58
68
  {% endif %}
59
69
 
60
- {% if attributes is empty %}
61
- {% set attributes = create_attribute() %}
62
- {% endif %}
63
-
64
70
  {% if _title is not empty %}
65
- {% set _title_classes = 'fw-bold mb-4' %}
66
- <{{ _title_tag }} class="{{ _title_classes }}">
67
- {{- _title -}}
68
- </{{ _title_tag }}>
71
+ {% include '@oe-bcl/bcl-heading/heading.html.twig' with {
72
+ title: _title,
73
+ title_tag: _title_tag,
74
+ title_link: _title_link,
75
+ attributes: _title_attributes,
76
+ } only %}
69
77
  {% endif %}
70
78
 
71
79
  {% if _variant == 'card' %}
@@ -82,9 +90,7 @@
82
90
  right_col_classes: "col-12 col-md-8",
83
91
  },
84
92
  badges: _badges,
85
- title: {
86
- content: _item_title,
87
- },
93
+ title: _item_title,
88
94
  text: {
89
95
  content: _text,
90
96
  classes: "mb-2",
@@ -134,7 +140,8 @@
134
140
  path: _icon_path,
135
141
  },
136
142
  attributes: create_attribute()
137
- .setAttribute('download', _download.url)
143
+ .setAttribute('download', true)
144
+ .setAttribute('target', '_blank')
138
145
  .addClass(['standalone', 'align-self-center', 'd-inline-block', 'mt-1', 'mt-md-0'])
139
146
  }) %}
140
147
  {% include '@oe-bcl/bcl-link/link.html.twig' with _download only %}
@@ -168,7 +175,7 @@
168
175
  {% if _item.title is not empty %}
169
176
  <p class="fw-bold m-0">{{ _item.title }}</p>
170
177
  {% endif %}
171
- {% if _item.title is not empty %}
178
+ {% if _item.description is not empty %}
172
179
  <p class="m-0">{{ _item.description }}</p>
173
180
  {% endif %}
174
181
  {% if _item.language is not empty or _item.meta is not empty %}
@@ -193,7 +200,8 @@
193
200
  path: _icon_path,
194
201
  },
195
202
  attributes: create_attribute()
196
- .setAttribute("download", _item.download.url)
203
+ .setAttribute('download', true)
204
+ .setAttribute('target', '_blank')
197
205
  .addClass(['d-block', 'standalone', 'mt-1'])
198
206
  }) only %}
199
207
  </div>
package/package.json CHANGED
@@ -2,14 +2,15 @@
2
2
  "name": "@openeuropa/bcl-file",
3
3
  "author": "European Commission",
4
4
  "license": "EUPL-1.2",
5
- "version": "0.20.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-icon": "^0.20.0",
12
- "@openeuropa/bcl-link": "^0.20.0"
11
+ "@openeuropa/bcl-heading": "^0.23.0",
12
+ "@openeuropa/bcl-icon": "^0.23.0",
13
+ "@openeuropa/bcl-link": "^0.23.0"
13
14
  },
14
15
  "repository": {
15
16
  "type": "git",
@@ -25,5 +26,5 @@
25
26
  "design-system",
26
27
  "twig"
27
28
  ],
28
- "gitHead": "ea13560489a089d0c198f781e75951a9160d2554"
29
+ "gitHead": "fa2097e14024989cddf6f9cd7a9115bed5886aeb"
29
30
  }