@openeuropa/bcl-listing 0.4298.202511051800 → 0.4360.202601141610
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/listing.html.twig +88 -91
- package/package.json +5 -5
package/listing.html.twig
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
{% apply spaceless %}
|
|
2
|
-
|
|
3
1
|
{# Parameters:
|
|
4
2
|
- title: (string) (default: '')
|
|
5
3
|
- title_tag: (string) (default: 'h2')
|
|
@@ -16,7 +14,7 @@
|
|
|
16
14
|
- attributes (drupal attrs)
|
|
17
15
|
#}
|
|
18
16
|
|
|
19
|
-
{
|
|
17
|
+
{%- set _title = title|default('') %}
|
|
20
18
|
{% set _title_tag = title_tag|default('h2') %}
|
|
21
19
|
{% set _title_link = title_link|default({}) %}
|
|
22
20
|
{% set _title_attributes = title_attributes ?: create_attribute() %}
|
|
@@ -26,7 +24,7 @@
|
|
|
26
24
|
{% set _alignment = alignment|default('') %}
|
|
27
25
|
{% set _image_size = image_size|default('') %}
|
|
28
26
|
|
|
29
|
-
{
|
|
27
|
+
{%- set _classes = ['bcl-listing', 'bcl-listing--' ~ _variant] %}
|
|
30
28
|
{% set _cards = [] %}
|
|
31
29
|
{% set _card_layout = {
|
|
32
30
|
type: 'grid',
|
|
@@ -35,16 +33,16 @@
|
|
|
35
33
|
attributes: create_attribute(),
|
|
36
34
|
} %}
|
|
37
35
|
|
|
38
|
-
{
|
|
39
|
-
{
|
|
36
|
+
{%- if attributes is empty %}
|
|
37
|
+
{%- set attributes = create_attribute() %}
|
|
40
38
|
{% endif %}
|
|
41
39
|
|
|
42
|
-
{
|
|
40
|
+
{%- set attributes = attributes.addClass(_classes) -%}
|
|
43
41
|
|
|
44
42
|
<div {{ attributes }}>
|
|
45
43
|
|
|
46
|
-
{
|
|
47
|
-
{
|
|
44
|
+
{%- if _title is not empty %}
|
|
45
|
+
{%- include '@oe-bcl/bcl-heading/heading.html.twig' with {
|
|
48
46
|
title: _title,
|
|
49
47
|
title_tag: _title_tag,
|
|
50
48
|
title_link: _title_link,
|
|
@@ -52,37 +50,37 @@
|
|
|
52
50
|
} only %}
|
|
53
51
|
{% endif %}
|
|
54
52
|
|
|
55
|
-
{
|
|
56
|
-
{
|
|
57
|
-
{
|
|
58
|
-
{
|
|
59
|
-
{
|
|
60
|
-
{
|
|
61
|
-
{
|
|
62
|
-
{
|
|
63
|
-
{
|
|
64
|
-
{
|
|
65
|
-
{
|
|
66
|
-
{
|
|
67
|
-
{
|
|
68
|
-
{
|
|
69
|
-
{
|
|
70
|
-
{
|
|
71
|
-
{
|
|
72
|
-
{
|
|
73
|
-
{
|
|
74
|
-
title_attributes: _card_title_attributes.addClass(['
|
|
53
|
+
{%- if _items is not empty %}
|
|
54
|
+
{%- for _card in _items %}
|
|
55
|
+
{%- set _alignment_class = '' %}
|
|
56
|
+
{%- set _image_classes = _card.image.classes ?: '' %}
|
|
57
|
+
{%- set _start_col_classes = 'bcl-card-start-col mb-3 mb-lg-0' %}
|
|
58
|
+
{%- set _end_col_classes = 'col-12 col-md' %}
|
|
59
|
+
{%- if _image_size is not empty %}
|
|
60
|
+
{%- set _start_col_classes = _start_col_classes ~ ' bcl-size-' ~ _image_size %}
|
|
61
|
+
{%- endif %}
|
|
62
|
+
{%- if 'd-none' in _image_classes %}
|
|
63
|
+
{%- set _start_col_classes = _start_col_classes ~ ' d-none d-md-block' %}
|
|
64
|
+
{%- endif %}
|
|
65
|
+
{%- if _alignment is not empty %}
|
|
66
|
+
{%- set _alignment_class = ' align-self-' ~ _alignment %}
|
|
67
|
+
{%- endif %}
|
|
68
|
+
{%- set _card_classes = [] %}
|
|
69
|
+
{%- set _card_attributes = card.attributes ? card.attributes : create_attribute() %}
|
|
70
|
+
{%- set _card_title_attributes = card.title_attributes ? card.title_attributes : create_attribute() %}
|
|
71
|
+
{%- set _card = _card|merge({
|
|
72
|
+
title_attributes: _card_title_attributes.addClass(['h5'])
|
|
75
73
|
}) %}
|
|
76
74
|
|
|
77
|
-
{
|
|
78
|
-
{
|
|
75
|
+
{%- if _variant == 'default-1-col' or _variant == 'default-2-col' or _variant == 'default-3-col' %}
|
|
76
|
+
{%- set _card_classes = [
|
|
79
77
|
'listing-item',
|
|
80
78
|
'border-bottom',
|
|
81
79
|
'border-md-0',
|
|
82
80
|
'border-0',
|
|
83
81
|
] %}
|
|
84
|
-
{
|
|
85
|
-
{
|
|
82
|
+
{%- set _card_attributes = _card_attributes.addClass(_card_classes) %}
|
|
83
|
+
{%- set _card = _card|merge({
|
|
86
84
|
horizontal: true,
|
|
87
85
|
extra_classes_body: 'p-0 pb-md-0 pb-3',
|
|
88
86
|
attributes: _card_attributes,
|
|
@@ -91,109 +89,108 @@
|
|
|
91
89
|
right_col_classes: _end_col_classes ~ _alignment_class,
|
|
92
90
|
}
|
|
93
91
|
}) %}
|
|
94
|
-
|
|
95
|
-
{
|
|
96
|
-
{
|
|
92
|
+
|
|
93
|
+
{%- if _variant == 'default-2-col' %}
|
|
94
|
+
{%- set _card_layout = _card_layout|merge({
|
|
97
95
|
responsive_columns: 2,
|
|
98
96
|
}) %}
|
|
99
|
-
{
|
|
100
|
-
{
|
|
97
|
+
{%- elseif _variant == 'default-3-col' %}
|
|
98
|
+
{%- set _card_layout = _card_layout|merge({
|
|
101
99
|
attributes: _card_layout.attributes.addClass(['row-cols-md-2']),
|
|
102
100
|
responsive_columns: 3,
|
|
103
101
|
responsiveness: 'xl',
|
|
104
102
|
}) %}
|
|
105
|
-
{
|
|
106
|
-
{
|
|
103
|
+
{%- endif %}
|
|
104
|
+
{%- endif %}
|
|
107
105
|
|
|
108
|
-
{
|
|
109
|
-
{
|
|
106
|
+
{%- if _variant == 'highlight-1-col' %}
|
|
107
|
+
{%- set _card_classes = [
|
|
110
108
|
'listing-item--highlight',
|
|
111
109
|
'border-0',
|
|
112
110
|
'bg-lighter'
|
|
113
111
|
] %}
|
|
114
|
-
{
|
|
115
|
-
{
|
|
112
|
+
{%- set _card_attributes = _card_attributes.addClass(_card_classes) %}
|
|
113
|
+
{%- set _card = _card|merge({
|
|
116
114
|
wrapper_class: 'col',
|
|
117
115
|
attributes: _card_attributes,
|
|
118
116
|
}) %}
|
|
119
|
-
{
|
|
120
|
-
{
|
|
117
|
+
{%- if _card.image is defined and _card.image is not empty %}
|
|
118
|
+
{%- set _card = _card|merge({
|
|
121
119
|
extra_classes_body: "pt-0",
|
|
122
120
|
}) %}
|
|
123
|
-
{
|
|
124
|
-
{
|
|
121
|
+
{%- endif %}
|
|
122
|
+
{%- set _card_layout = _card_layout|merge({
|
|
125
123
|
cols_extra_classes: 'mt-4-5',
|
|
126
124
|
}) %}
|
|
127
|
-
{
|
|
128
|
-
{
|
|
129
|
-
{
|
|
130
|
-
{
|
|
131
|
-
{
|
|
132
|
-
{
|
|
125
|
+
{%- if _card.image is not empty %}
|
|
126
|
+
{%- set _image_classes = _card.image.classes ?: '' %}
|
|
127
|
+
{%- if not _alignment == 'center' %}
|
|
128
|
+
{%- set _image_classes = _image_classes ? _image_classes ~ ' mb-3' : 'mb-3' %}
|
|
129
|
+
{%- endif %}
|
|
130
|
+
{%- set _card = _card|merge({image: _card.image|merge({
|
|
133
131
|
classes: _image_classes,
|
|
134
132
|
})}) %}
|
|
135
|
-
{
|
|
133
|
+
{%- endif %}
|
|
136
134
|
|
|
137
|
-
{
|
|
135
|
+
{%- endif %}
|
|
138
136
|
|
|
139
|
-
{
|
|
140
|
-
{
|
|
137
|
+
{%- if _variant == 'highlight-2-col' or variant == 'highlight-3-col' %}
|
|
138
|
+
{%- set _card_classes = [
|
|
141
139
|
'listing-item--highlight',
|
|
142
140
|
'border-0',
|
|
143
141
|
'bg-lighter',
|
|
144
142
|
'h-100',
|
|
145
143
|
'rounded-2'
|
|
146
144
|
] %}
|
|
147
|
-
{
|
|
148
|
-
{
|
|
145
|
+
{%- set _card_attributes = _card_attributes.addClass(_card_classes) %}
|
|
146
|
+
{%- set _card = _card|merge({
|
|
149
147
|
wrapper_class: 'col',
|
|
150
148
|
attributes: _card_attributes,
|
|
151
149
|
}) %}
|
|
152
|
-
{
|
|
153
|
-
{
|
|
150
|
+
{%- if _card.image is defined and _card.image is not empty %}
|
|
151
|
+
{%- set _card = _card|merge({
|
|
154
152
|
extra_classes_body: 'pt-0',
|
|
155
153
|
}) %}
|
|
156
|
-
{
|
|
157
|
-
{
|
|
158
|
-
{
|
|
159
|
-
{
|
|
160
|
-
{
|
|
161
|
-
{
|
|
162
|
-
{
|
|
154
|
+
{%- endif %}
|
|
155
|
+
{%- if _card.image is not empty %}
|
|
156
|
+
{%- set _image_classes = _card.image.classes ?: '' %}
|
|
157
|
+
{%- if not _alignment == 'center' %}
|
|
158
|
+
{%- set _image_classes = _image_classes ? _image_classes ~ ' mb-3' : 'mb-3' %}
|
|
159
|
+
{%- endif %}
|
|
160
|
+
{%- set _card = _card|merge({image: _card.image|merge({
|
|
163
161
|
classes: _image_classes,
|
|
164
162
|
})}) %}
|
|
165
|
-
{
|
|
166
|
-
{
|
|
167
|
-
{
|
|
168
|
-
{
|
|
169
|
-
{
|
|
170
|
-
{
|
|
171
|
-
{
|
|
172
|
-
{
|
|
173
|
-
|
|
174
|
-
{
|
|
175
|
-
{
|
|
163
|
+
{%- endif %}
|
|
164
|
+
{%- set _card_layout = _card_layout|merge({ gutter: '4' }) %}
|
|
165
|
+
{%- if variant == 'highlight-2-col' %}
|
|
166
|
+
{%- set _card_layout = _card_layout|merge({ responsive_columns: 2 }) %}
|
|
167
|
+
{%- else %}
|
|
168
|
+
{%- set _card_layout = _card_layout|merge({ responsive_columns: 3 }) %}
|
|
169
|
+
{%- endif %}
|
|
170
|
+
{%- endif %}
|
|
171
|
+
|
|
172
|
+
{%- if _card.image is empty and _card.date is empty %}
|
|
173
|
+
{%- set _card = _card|merge({
|
|
176
174
|
horizontal: false,
|
|
177
175
|
}) %}
|
|
178
|
-
{
|
|
176
|
+
{%- endif %}
|
|
179
177
|
|
|
180
|
-
{
|
|
181
|
-
{
|
|
178
|
+
{%- set _cards = _cards|merge([_card]) %}
|
|
179
|
+
{%- endfor %}
|
|
182
180
|
{% endif %}
|
|
183
181
|
|
|
184
|
-
{
|
|
182
|
+
{%- include "@oe-bcl/bcl-card-layout/card-layout.html.twig" with _card_layout|merge({ items: _cards }) only %}
|
|
185
183
|
|
|
186
|
-
{
|
|
187
|
-
{
|
|
188
|
-
{
|
|
189
|
-
{
|
|
184
|
+
{%- if _link is not empty %}
|
|
185
|
+
{%- set _link_attributes = _link.attributes ? _link.attributes : create_attribute() %}
|
|
186
|
+
{%- set _link_attributes = _link_attributes.addClass(['mt-3-5', 'd-inline-block']) %}
|
|
187
|
+
{%- include '@oe-bcl/bcl-link/link.html.twig' with _link|merge({
|
|
190
188
|
attributes: _link_attributes,
|
|
191
189
|
icon: _link.icon|merge({
|
|
192
190
|
name: 'chevron-right',
|
|
193
191
|
size: 'xs',
|
|
194
192
|
}),
|
|
195
193
|
}) only %}
|
|
196
|
-
{% endif
|
|
194
|
+
{% endif -%}
|
|
197
195
|
</div>
|
|
198
|
-
|
|
199
|
-
{% endapply %}
|
|
196
|
+
{#--#}
|
package/package.json
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
"name": "@openeuropa/bcl-listing",
|
|
3
3
|
"author": "European Commission",
|
|
4
4
|
"license": "EUPL-1.2",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.4360.202601141610",
|
|
6
6
|
"description": "OE - BCL Listing",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@openeuropa/bcl-card-layout": "^0.
|
|
12
|
-
"@openeuropa/bcl-heading": "^0.
|
|
13
|
-
"@openeuropa/bcl-link": "^0.
|
|
11
|
+
"@openeuropa/bcl-card-layout": "^0.4360.202601141610",
|
|
12
|
+
"@openeuropa/bcl-heading": "^0.4360.202601141610",
|
|
13
|
+
"@openeuropa/bcl-link": "^0.4360.202601141610"
|
|
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": "2caf9255f88587416f6e83e572a1f20e4cf206f5"
|
|
30
30
|
}
|