@openeuropa/bcl-card-layout 1.10.9 → 1.10.11
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/card-layout.html.twig +34 -37
- package/package.json +3 -3
package/card-layout.html.twig
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
{% apply spaceless %}
|
|
2
|
-
|
|
3
1
|
{# Parameters:
|
|
4
2
|
- type (string) (default: 'group')
|
|
5
3
|
options: ['group', 'grid', 'masonry']
|
|
@@ -20,7 +18,7 @@
|
|
|
20
18
|
- card_layout_card
|
|
21
19
|
#}
|
|
22
20
|
|
|
23
|
-
{
|
|
21
|
+
{%- set _type = type|default('group') %}
|
|
24
22
|
{% set _items = items|default([]) %}
|
|
25
23
|
{% set _grid_columns = grid_columns|default(1) %}
|
|
26
24
|
{% set _responsiveness = responsiveness|default('md') %}
|
|
@@ -29,59 +27,58 @@
|
|
|
29
27
|
{% set _equal_height = equal_height ?? false %}
|
|
30
28
|
{% set _cols_extra_classes = cols_extra_classes|default('') %}
|
|
31
29
|
|
|
32
|
-
{
|
|
30
|
+
{%- set _cols_classes = 'col' %}
|
|
33
31
|
|
|
34
|
-
{
|
|
35
|
-
{
|
|
32
|
+
{%- if _cols_extra_classes is not empty %}
|
|
33
|
+
{%- set _cols_classes = _cols_classes ~ ' ' ~ _cols_extra_classes %}
|
|
36
34
|
{% endif %}
|
|
37
35
|
{% if _type == 'group' %}
|
|
38
|
-
{
|
|
36
|
+
{%- set _classes = ['card-group'] %}
|
|
39
37
|
{% elseif type == 'grid' or type == 'masonry' %}
|
|
40
|
-
{
|
|
41
|
-
{
|
|
42
|
-
{
|
|
43
|
-
{
|
|
44
|
-
{
|
|
45
|
-
{
|
|
46
|
-
{
|
|
38
|
+
{%- set _classes = ['row', 'row-cols-' ~ _grid_columns] %}
|
|
39
|
+
{%- if _responsive_columns is not empty %}
|
|
40
|
+
{%- set _classes = _classes|merge(['row-cols-' ~ _responsiveness ~ '-' ~ _responsive_columns]) %}
|
|
41
|
+
{%- endif %}
|
|
42
|
+
{%- if _gutter is not empty %}
|
|
43
|
+
{%- set _classes = _classes|merge(['g-' ~ _gutter]) %}
|
|
44
|
+
{%- endif %}
|
|
47
45
|
{% endif %}
|
|
48
46
|
|
|
49
|
-
{
|
|
50
|
-
{
|
|
47
|
+
{%- if attributes is empty %}
|
|
48
|
+
{%- set attributes = create_attribute() %}
|
|
51
49
|
{% endif %}
|
|
52
50
|
|
|
53
|
-
{
|
|
51
|
+
{%- set attributes = attributes.addClass(_classes) -%}
|
|
54
52
|
|
|
55
53
|
<div
|
|
56
54
|
{{ attributes }}
|
|
57
|
-
{
|
|
55
|
+
{%- if _type == 'masonry' %}
|
|
58
56
|
data-masonry='{"percentPosition": true }'
|
|
59
57
|
{% endif %}
|
|
60
58
|
>
|
|
61
|
-
{
|
|
62
|
-
{
|
|
63
|
-
{
|
|
64
|
-
{
|
|
59
|
+
{%- if _items is not empty and _items is iterable %}
|
|
60
|
+
{%- for _item in _items %}
|
|
61
|
+
{%- if _item.attributes is empty %}
|
|
62
|
+
{%- set _item = _item|merge({
|
|
65
63
|
attributes: create_attribute()
|
|
66
64
|
}) %}
|
|
67
|
-
{
|
|
68
|
-
{
|
|
69
|
-
{
|
|
65
|
+
{%- endif %}
|
|
66
|
+
{%- if _equal_height %}
|
|
67
|
+
{%- set _item = _item|merge({
|
|
70
68
|
attributes: _item.attributes.addClass('h-100')
|
|
71
69
|
})
|
|
72
70
|
%}
|
|
73
|
-
{
|
|
74
|
-
{
|
|
71
|
+
{%- endif %}
|
|
72
|
+
{%- if _type == 'grid' or _type == 'masonry' -%}
|
|
75
73
|
<div class="{{ _cols_classes }}">
|
|
76
|
-
{
|
|
77
|
-
{
|
|
78
|
-
{
|
|
79
|
-
{
|
|
80
|
-
{
|
|
74
|
+
{%- endif %}
|
|
75
|
+
{%- block card_layout_card %}
|
|
76
|
+
{%- include '@oe-bcl/bcl-card/card.html.twig' with _item only %}
|
|
77
|
+
{%- endblock %}
|
|
78
|
+
{%- if _type == 'grid' or _type == 'masonry' -%}
|
|
81
79
|
</div>
|
|
82
|
-
{
|
|
83
|
-
{
|
|
84
|
-
{% endif
|
|
80
|
+
{%- endif %}
|
|
81
|
+
{%- endfor %}
|
|
82
|
+
{% endif -%}
|
|
85
83
|
</div>
|
|
86
|
-
|
|
87
|
-
{% endapply %}
|
|
84
|
+
{#--#}
|
package/package.json
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
"name": "@openeuropa/bcl-card-layout",
|
|
3
3
|
"author": "European Commission",
|
|
4
4
|
"license": "EUPL-1.2",
|
|
5
|
-
"version": "1.10.
|
|
5
|
+
"version": "1.10.11",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
8
8
|
},
|
|
9
9
|
"description": "OE - BCL card layout",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@openeuropa/bcl-card": "^1.10.
|
|
11
|
+
"@openeuropa/bcl-card": "^1.10.11"
|
|
12
12
|
},
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
@@ -24,5 +24,5 @@
|
|
|
24
24
|
"design-system",
|
|
25
25
|
"twig"
|
|
26
26
|
],
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "82aecf2f60f8bd8f9afd447ea0d044396f085823"
|
|
28
28
|
}
|