@openeuropa/bcl-listing 0.4230.202512021730 → 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.
Files changed (2) hide show
  1. package/listing.html.twig +88 -88
  2. package/package.json +5 -5
package/listing.html.twig CHANGED
@@ -14,7 +14,7 @@
14
14
  - attributes (drupal attrs)
15
15
  #}
16
16
 
17
- {% set _title = title|default('') %}
17
+ {%- set _title = title|default('') %}
18
18
  {% set _title_tag = title_tag|default('h2') %}
19
19
  {% set _title_link = title_link|default({}) %}
20
20
  {% set _title_attributes = title_attributes ?: create_attribute() %}
@@ -24,7 +24,7 @@
24
24
  {% set _alignment = alignment|default('') %}
25
25
  {% set _image_size = image_size|default('') %}
26
26
 
27
- {% set _classes = ['bcl-listing', 'bcl-listing--' ~ _variant] %}
27
+ {%- set _classes = ['bcl-listing', 'bcl-listing--' ~ _variant] %}
28
28
  {% set _cards = [] %}
29
29
  {% set _card_layout = {
30
30
  type: 'grid',
@@ -33,16 +33,16 @@
33
33
  attributes: create_attribute(),
34
34
  } %}
35
35
 
36
- {% if attributes is empty %}
37
- {% set attributes = create_attribute() %}
36
+ {%- if attributes is empty %}
37
+ {%- set attributes = create_attribute() %}
38
38
  {% endif %}
39
39
 
40
- {% set attributes = attributes.addClass(_classes) %}
40
+ {%- set attributes = attributes.addClass(_classes) -%}
41
41
 
42
42
  <div {{ attributes }}>
43
43
 
44
- {% if _title is not empty %}
45
- {% include '@oe-bcl/bcl-heading/heading.html.twig' with {
44
+ {%- if _title is not empty %}
45
+ {%- include '@oe-bcl/bcl-heading/heading.html.twig' with {
46
46
  title: _title,
47
47
  title_tag: _title_tag,
48
48
  title_link: _title_link,
@@ -50,37 +50,37 @@
50
50
  } only %}
51
51
  {% endif %}
52
52
 
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(['fs-5'])
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'])
73
73
  }) %}
74
74
 
75
- {% if _variant == 'default-1-col' or _variant == 'default-2-col' or _variant == 'default-3-col' %}
76
- {% set _card_classes = [
75
+ {%- if _variant == 'default-1-col' or _variant == 'default-2-col' or _variant == 'default-3-col' %}
76
+ {%- set _card_classes = [
77
77
  'listing-item',
78
78
  'border-bottom',
79
79
  'border-md-0',
80
80
  'border-0',
81
81
  ] %}
82
- {% set _card_attributes = _card_attributes.addClass(_card_classes) %}
83
- {% set _card = _card|merge({
82
+ {%- set _card_attributes = _card_attributes.addClass(_card_classes) %}
83
+ {%- set _card = _card|merge({
84
84
  horizontal: true,
85
85
  extra_classes_body: 'p-0 pb-md-0 pb-3',
86
86
  attributes: _card_attributes,
@@ -89,108 +89,108 @@
89
89
  right_col_classes: _end_col_classes ~ _alignment_class,
90
90
  }
91
91
  }) %}
92
-
93
- {% if _variant == 'default-2-col' %}
94
- {% set _card_layout = _card_layout|merge({
92
+
93
+ {%- if _variant == 'default-2-col' %}
94
+ {%- set _card_layout = _card_layout|merge({
95
95
  responsive_columns: 2,
96
96
  }) %}
97
- {% elseif _variant == 'default-3-col' %}
98
- {% set _card_layout = _card_layout|merge({
97
+ {%- elseif _variant == 'default-3-col' %}
98
+ {%- set _card_layout = _card_layout|merge({
99
99
  attributes: _card_layout.attributes.addClass(['row-cols-md-2']),
100
100
  responsive_columns: 3,
101
101
  responsiveness: 'xl',
102
102
  }) %}
103
- {% endif %}
104
- {% endif %}
103
+ {%- endif %}
104
+ {%- endif %}
105
105
 
106
- {% if _variant == 'highlight-1-col' %}
107
- {% set _card_classes = [
106
+ {%- if _variant == 'highlight-1-col' %}
107
+ {%- set _card_classes = [
108
108
  'listing-item--highlight',
109
109
  'border-0',
110
110
  'bg-lighter'
111
111
  ] %}
112
- {% set _card_attributes = _card_attributes.addClass(_card_classes) %}
113
- {% set _card = _card|merge({
112
+ {%- set _card_attributes = _card_attributes.addClass(_card_classes) %}
113
+ {%- set _card = _card|merge({
114
114
  wrapper_class: 'col',
115
115
  attributes: _card_attributes,
116
116
  }) %}
117
- {% if _card.image is defined and _card.image is not empty %}
118
- {% set _card = _card|merge({
117
+ {%- if _card.image is defined and _card.image is not empty %}
118
+ {%- set _card = _card|merge({
119
119
  extra_classes_body: "pt-0",
120
120
  }) %}
121
- {% endif %}
122
- {% set _card_layout = _card_layout|merge({
121
+ {%- endif %}
122
+ {%- set _card_layout = _card_layout|merge({
123
123
  cols_extra_classes: 'mt-4-5',
124
124
  }) %}
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({
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({
131
131
  classes: _image_classes,
132
132
  })}) %}
133
- {% endif %}
133
+ {%- endif %}
134
134
 
135
- {% endif %}
135
+ {%- endif %}
136
136
 
137
- {% if _variant == 'highlight-2-col' or variant == 'highlight-3-col' %}
138
- {% set _card_classes = [
137
+ {%- if _variant == 'highlight-2-col' or variant == 'highlight-3-col' %}
138
+ {%- set _card_classes = [
139
139
  'listing-item--highlight',
140
140
  'border-0',
141
141
  'bg-lighter',
142
142
  'h-100',
143
143
  'rounded-2'
144
144
  ] %}
145
- {% set _card_attributes = _card_attributes.addClass(_card_classes) %}
146
- {% set _card = _card|merge({
145
+ {%- set _card_attributes = _card_attributes.addClass(_card_classes) %}
146
+ {%- set _card = _card|merge({
147
147
  wrapper_class: 'col',
148
148
  attributes: _card_attributes,
149
149
  }) %}
150
- {% if _card.image is defined and _card.image is not empty %}
151
- {% set _card = _card|merge({
150
+ {%- if _card.image is defined and _card.image is not empty %}
151
+ {%- set _card = _card|merge({
152
152
  extra_classes_body: 'pt-0',
153
153
  }) %}
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({
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({
161
161
  classes: _image_classes,
162
162
  })}) %}
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({
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({
174
174
  horizontal: false,
175
175
  }) %}
176
- {% endif %}
176
+ {%- endif %}
177
177
 
178
- {% set _cards = _cards|merge([_card]) %}
179
- {% endfor %}
178
+ {%- set _cards = _cards|merge([_card]) %}
179
+ {%- endfor %}
180
180
  {% endif %}
181
181
 
182
- {% include "@oe-bcl/bcl-card-layout/card-layout.html.twig" with _card_layout|merge({ items: _cards }) only %}
182
+ {%- include "@oe-bcl/bcl-card-layout/card-layout.html.twig" with _card_layout|merge({ items: _cards }) only %}
183
183
 
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({
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({
188
188
  attributes: _link_attributes,
189
189
  icon: _link.icon|merge({
190
190
  name: 'chevron-right',
191
191
  size: 'xs',
192
192
  }),
193
193
  }) only %}
194
- {% endif %}
194
+ {% endif -%}
195
195
  </div>
196
-
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.4230.202512021730",
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.4230.202512021730",
12
- "@openeuropa/bcl-heading": "^0.4230.202512021730",
13
- "@openeuropa/bcl-link": "^0.4230.202512021730"
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": "19735e328b2b53ccefbcc6829e2aaf149a2c438c"
29
+ "gitHead": "2caf9255f88587416f6e83e572a1f20e4cf206f5"
30
30
  }