@openeuropa/bcl-file 0.27.0 → 0.28.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.
- package/file-translations.html.twig +93 -0
- package/file.html.twig +7 -67
- package/package.json +5 -5
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
{% apply spaceless %}
|
|
2
|
+
|
|
3
|
+
{# Parameters:
|
|
4
|
+
- id (string) (default: language-dropdown + random(1000))
|
|
5
|
+
- label (string) (default: '')
|
|
6
|
+
- icon_path (string) (default: '')
|
|
7
|
+
- items (string) (default: [])
|
|
8
|
+
format: [
|
|
9
|
+
{
|
|
10
|
+
extension: '',
|
|
11
|
+
language: '',
|
|
12
|
+
size: '',
|
|
13
|
+
download: {}, - link Object
|
|
14
|
+
},
|
|
15
|
+
]
|
|
16
|
+
#}
|
|
17
|
+
|
|
18
|
+
{% set _id = id|default('language-dropdown' ~ random(1000)) %}
|
|
19
|
+
{% set _label = label|default('') %}
|
|
20
|
+
{% set _icon_path = icon_path|default('') %}
|
|
21
|
+
{% set _items = items|default([]) %}
|
|
22
|
+
|
|
23
|
+
{% if attributes is empty %}
|
|
24
|
+
{% set attributes = create_attribute() %}
|
|
25
|
+
{% endif %}
|
|
26
|
+
|
|
27
|
+
{% set attributes = attributes.addClass(['bg-lighter', 'py-3', 'px-4', 'border-top']) %}
|
|
28
|
+
|
|
29
|
+
<div
|
|
30
|
+
{{ attributes }}>
|
|
31
|
+
<div class="text-end text-md-center">
|
|
32
|
+
{% include '@oe-bcl/bcl-link/link.html.twig' with _label|merge({
|
|
33
|
+
path: '#' ~ _id,
|
|
34
|
+
attributes: create_attribute()
|
|
35
|
+
.addClass(['standalone'])
|
|
36
|
+
.setAttribute('aria-controls', _id)
|
|
37
|
+
.setAttribute('data-bs-toggle', 'collapse')
|
|
38
|
+
.setAttribute('aria-expanded', 'false')
|
|
39
|
+
.setAttribute('role', 'button'),
|
|
40
|
+
}) only %}
|
|
41
|
+
</div>
|
|
42
|
+
{% if _items is not empty and _items is iterable %}
|
|
43
|
+
<div class="collapse" id="{{ _id }}">
|
|
44
|
+
{% for _item in _items %}
|
|
45
|
+
{% set _item_classes = loop.last ? 'pt-3' : 'py-3 border-bottom' %}
|
|
46
|
+
<div class="{{ _item_classes }}">
|
|
47
|
+
{% if _item.type == 'content' %}
|
|
48
|
+
{{ _item.content }}
|
|
49
|
+
{% else %}
|
|
50
|
+
<div class="row">
|
|
51
|
+
<div class="col-12 col-md-9">
|
|
52
|
+
{% if _item.title is not empty %}
|
|
53
|
+
<p class="fw-bold m-0">{{ _item.title }}</p>
|
|
54
|
+
{% endif %}
|
|
55
|
+
{% if _item.description is not empty %}
|
|
56
|
+
<p class="m-0">{{ _item.description }}</p>
|
|
57
|
+
{% endif %}
|
|
58
|
+
{% if _item.language is not empty or _item.meta is not empty %}
|
|
59
|
+
<small class="fw-bold m-0">
|
|
60
|
+
{%- if _item.language is not empty -%}
|
|
61
|
+
{{- _item.language -}}
|
|
62
|
+
{%- endif -%}
|
|
63
|
+
{%- if _item.meta is not empty -%}
|
|
64
|
+
<span class="fw-normal">
|
|
65
|
+
{{- ' ' ~ _item.meta -}}
|
|
66
|
+
</span>
|
|
67
|
+
{%- endif -%}
|
|
68
|
+
</small>
|
|
69
|
+
{% endif %}
|
|
70
|
+
</div>
|
|
71
|
+
<div class="col-12 col-md-3 align-self-end text-md-end">
|
|
72
|
+
{% include '@oe-bcl/bcl-link/link.html.twig' with _item.download|merge({
|
|
73
|
+
icon_position: "after",
|
|
74
|
+
icon: {
|
|
75
|
+
name: "download",
|
|
76
|
+
size: "fluid",
|
|
77
|
+
path: _icon_path,
|
|
78
|
+
},
|
|
79
|
+
attributes: create_attribute()
|
|
80
|
+
.setAttribute('download', true)
|
|
81
|
+
.setAttribute('target', '_blank')
|
|
82
|
+
.addClass(['d-block', 'standalone', 'mt-1'])
|
|
83
|
+
}) only %}
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
{% endif %}
|
|
87
|
+
</div>
|
|
88
|
+
{% endfor %}
|
|
89
|
+
</div>
|
|
90
|
+
{% endif %}
|
|
91
|
+
</div>
|
|
92
|
+
|
|
93
|
+
{% endapply %}
|
package/file.html.twig
CHANGED
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
|
|
39
39
|
{# Internal properties #}
|
|
40
40
|
|
|
41
|
-
{% set _icon = icon|default({}) %}
|
|
42
|
-
{% set _icon_inline = icon_inline ?? true %}
|
|
43
41
|
{% set _title = title|default('') %}
|
|
44
42
|
{% set _title_tag = title_tag|default('h2') %}
|
|
45
43
|
{% set _title_link = title_link|default({}) %}
|
|
46
44
|
{% set _title_attributes = title_attributes ?: create_attribute() %}
|
|
47
45
|
{% set _item_title = item_title|default('') %}
|
|
46
|
+
{% set _icon = icon|default({}) %}
|
|
47
|
+
{% set _icon_inline = icon_inline ?? true %}
|
|
48
48
|
{% set _text = text|default('') %}
|
|
49
49
|
{% set _content = content|default('') %}
|
|
50
50
|
{% set _image = image|default({}) %}
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
{% set _variant = variant|default('default') %}
|
|
55
55
|
{% set _download = download|default({}) %}
|
|
56
56
|
{% set _translation = translation|default({}) %}
|
|
57
|
-
{% set _icon_path = icon_path|default(
|
|
57
|
+
{% set _icon_path = icon_path|default('') %}
|
|
58
58
|
|
|
59
59
|
{% set _classes = ['bcl-file'] %}
|
|
60
60
|
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
</div>
|
|
111
111
|
{% endif %}
|
|
112
112
|
<div class="px-3-5 py-3">
|
|
113
|
-
<div class="d-flex">
|
|
113
|
+
<div class="d-md-flex">
|
|
114
114
|
{% if _icon is not empty and _variant == 'default' %}
|
|
115
115
|
<div class="pe-2 pb-2">
|
|
116
116
|
{% if _icon is not empty %}
|
|
@@ -155,69 +155,9 @@
|
|
|
155
155
|
</div>
|
|
156
156
|
</div>
|
|
157
157
|
{% if _translation is not empty %}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
{% include '@oe-bcl/bcl-link/link.html.twig' with _translation.label|merge({
|
|
162
|
-
path: '#' ~ _id,
|
|
163
|
-
attributes: create_attribute()
|
|
164
|
-
.addClass(['standalone'])
|
|
165
|
-
.setAttribute('aria-controls', _id)
|
|
166
|
-
.setAttribute('data-bs-toggle', 'collapse')
|
|
167
|
-
.setAttribute('aria-expanded', 'false')
|
|
168
|
-
.setAttribute('role', 'button'),
|
|
169
|
-
}) only %}
|
|
170
|
-
</div>
|
|
171
|
-
{% if _translation.items is not empty and _translation.items is iterable %}
|
|
172
|
-
<div class="collapse" id="{{ _id }}">
|
|
173
|
-
{% for _item in _translation.items %}
|
|
174
|
-
{% set _item_classes = loop.last ? 'pt-3' : 'py-3 border-bottom' %}
|
|
175
|
-
<div class="{{ _item_classes }}">
|
|
176
|
-
{% if _item.type == 'content' %}
|
|
177
|
-
{{ _item.content }}
|
|
178
|
-
{% else %}
|
|
179
|
-
<div class="row">
|
|
180
|
-
<div class="col-12 col-md-9">
|
|
181
|
-
{% if _item.title is not empty %}
|
|
182
|
-
<p class="fw-bold m-0">{{ _item.title }}</p>
|
|
183
|
-
{% endif %}
|
|
184
|
-
{% if _item.description is not empty %}
|
|
185
|
-
<p class="m-0">{{ _item.description }}</p>
|
|
186
|
-
{% endif %}
|
|
187
|
-
{% if _item.language is not empty or _item.meta is not empty %}
|
|
188
|
-
<small class="fw-bold m-0">
|
|
189
|
-
{%- if _item.language is not empty -%}
|
|
190
|
-
{{- _item.language -}}
|
|
191
|
-
{%- endif -%}
|
|
192
|
-
{%- if _item.meta is not empty -%}
|
|
193
|
-
<span class="fw-normal">
|
|
194
|
-
{{- ' ' ~ _item.meta -}}
|
|
195
|
-
</span>
|
|
196
|
-
{%- endif -%}
|
|
197
|
-
</small>
|
|
198
|
-
{% endif %}
|
|
199
|
-
</div>
|
|
200
|
-
<div class="col-12 col-md-3 align-self-end text-md-end">
|
|
201
|
-
{% include '@oe-bcl/bcl-link/link.html.twig' with _item.download|merge({
|
|
202
|
-
icon_position: "after",
|
|
203
|
-
icon: {
|
|
204
|
-
name: "download",
|
|
205
|
-
size: "fluid",
|
|
206
|
-
path: _icon_path,
|
|
207
|
-
},
|
|
208
|
-
attributes: create_attribute()
|
|
209
|
-
.setAttribute('download', true)
|
|
210
|
-
.setAttribute('target', '_blank')
|
|
211
|
-
.addClass(['d-block', 'standalone', 'mt-1'])
|
|
212
|
-
}) only %}
|
|
213
|
-
</div>
|
|
214
|
-
</div>
|
|
215
|
-
{% endif %}
|
|
216
|
-
</div>
|
|
217
|
-
{% endfor %}
|
|
218
|
-
</div>
|
|
219
|
-
{% endif %}
|
|
220
|
-
</div>
|
|
158
|
+
{% include '@oe-bcl/bcl-file/file-translations.html.twig' with _translation|merge({
|
|
159
|
+
icon_path: _icon_path
|
|
160
|
+
}) only %}
|
|
221
161
|
{% endif %}
|
|
222
162
|
</div>
|
|
223
163
|
|
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.
|
|
5
|
+
"version": "0.28.0",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
8
8
|
},
|
|
9
9
|
"description": "OE - BCL file",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@openeuropa/bcl-heading": "^0.
|
|
12
|
-
"@openeuropa/bcl-icon": "^0.
|
|
13
|
-
"@openeuropa/bcl-link": "^0.
|
|
11
|
+
"@openeuropa/bcl-heading": "^0.28.0",
|
|
12
|
+
"@openeuropa/bcl-icon": "^0.28.0",
|
|
13
|
+
"@openeuropa/bcl-link": "^0.28.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": "
|
|
29
|
+
"gitHead": "9ceb916258c8c7331f37bbb7c4380a2121440e12"
|
|
30
30
|
}
|