@openeuropa/bcl-twig-templates 0.28.1 → 1.0.2

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 (51) hide show
  1. package/package.json +65 -65
  2. package/templates/bcl-accordion/accordion.html.twig +1 -1
  3. package/templates/bcl-badge/badge.html.twig +29 -28
  4. package/templates/bcl-banner/banner.html.twig +4 -4
  5. package/templates/bcl-base-templates/content-type.html.twig +5 -5
  6. package/templates/bcl-breadcrumb/breadcrumb.html.twig +1 -1
  7. package/templates/bcl-button/button.html.twig +6 -6
  8. package/templates/bcl-button-group/button-group.html.twig +3 -3
  9. package/templates/bcl-card/card.html.twig +3 -4
  10. package/templates/bcl-card-layout/card-layout.html.twig +2 -2
  11. package/templates/bcl-carousel/carousel.html.twig +7 -10
  12. package/templates/bcl-content-banner/content-banner.html.twig +23 -8
  13. package/templates/bcl-description-list/description-list.html.twig +4 -5
  14. package/templates/bcl-dropdown/dropdown.html.twig +7 -7
  15. package/templates/bcl-fact-figures/fact-figures.html.twig +3 -3
  16. package/templates/bcl-featured-media/featured-media.html.twig +16 -16
  17. package/templates/bcl-file/file-translations.html.twig +1 -1
  18. package/templates/bcl-file/file.html.twig +2 -2
  19. package/templates/bcl-footer/footer.html.twig +3 -2
  20. package/templates/bcl-form/form.html.twig +2 -2
  21. package/templates/bcl-form-input/form-input.html.twig +12 -12
  22. package/templates/bcl-gallery/gallery-item.html.twig +7 -6
  23. package/templates/bcl-gallery/gallery.html.twig +120 -79
  24. package/templates/bcl-header/header.html.twig +3 -2
  25. package/templates/bcl-inpage-navigation/inpage-navigation.html.twig +3 -5
  26. package/templates/bcl-language-list/language-list.html.twig +2 -2
  27. package/templates/bcl-language-switcher/language-switcher.html.twig +3 -3
  28. package/templates/bcl-link/link.html.twig +3 -3
  29. package/templates/bcl-links-block/links-block.html.twig +1 -1
  30. package/templates/bcl-list-group/list-group.html.twig +3 -3
  31. package/templates/bcl-listing/listing.html.twig +1 -1
  32. package/templates/bcl-modal/modal.html.twig +4 -4
  33. package/templates/bcl-navbar/navbar.html.twig +1 -1
  34. package/templates/bcl-navigation/navigation.html.twig +10 -10
  35. package/templates/bcl-offcanvas/offcanvas.html.twig +2 -2
  36. package/templates/bcl-pagination/pagination-item.html.twig +73 -0
  37. package/templates/bcl-pagination/pagination.html.twig +103 -223
  38. package/templates/bcl-progress/progress.html.twig +3 -3
  39. package/templates/bcl-project/project.html.twig +14 -29
  40. package/templates/bcl-project-status/project-contributions.html.twig +2 -2
  41. package/templates/bcl-project-status/project-status.html.twig +3 -4
  42. package/templates/bcl-recent-activities/recent-activities.html.twig +1 -1
  43. package/templates/bcl-search-form/search-form.html.twig +1 -1
  44. package/templates/bcl-select/select.html.twig +22 -8
  45. package/templates/bcl-subscription/subscription-modal.html.twig +1 -1
  46. package/templates/bcl-table/table.html.twig +8 -8
  47. package/templates/bcl-textarea/textarea.html.twig +8 -8
  48. package/templates/bcl-timeline/timeline.html.twig +2 -2
  49. package/templates/bcl-toast/toasts.html.twig +4 -4
  50. package/templates/bcl-user/user-compact.html.twig +1 -1
  51. package/templates/bcl-gallery/gallery-modal.html.twig +0 -105
@@ -0,0 +1,73 @@
1
+ {% apply spaceless %}
2
+
3
+ {# Parameters:
4
+ - path (string) (default: '')
5
+ - label (string) (default: '')
6
+ - disabled (boolean) (default: false)
7
+ - active (boolean) (default: false)
8
+ - aria_label (string) (default: '') - deprecated, use attributes
9
+ - icon (icon object) (default: {})
10
+ - attributes (drupal attrs)
11
+ #}
12
+
13
+ {% set _path = path|default('') %}
14
+ {% set _label = label|default('') %}
15
+ {% set _disabled = disabled ?? false %}
16
+ {% set _active = active ?? false %}
17
+ {% set _aria_label = aria_label|default('') %}
18
+ {% set _icon = icon|default({}) %}
19
+ {% set _icon_path = icon_path|default('') %}
20
+ {% set _icon_name = icon_name|default('') %}
21
+ {% set _icon_html = icon_html|default('') %}
22
+ {% set _classes = ['page-link'] %}
23
+
24
+ {% if _icon_path is not empty and _icon is empty %}
25
+ {% if _icon_name is not empty %}
26
+ {% set _icon = _icon|merge({
27
+ name: _icon_name,
28
+ path: _icon_path,
29
+ size: "fluid"
30
+ }) %}
31
+ {% set _label = "" %}
32
+ {% endif %}
33
+ {% else %}
34
+ {% if _icon_html is not empty %}
35
+ {% set _label %}
36
+ <span aria-hidden="true">{{- _icon_html -}}</span>
37
+ {% endset %}
38
+ {% endif %}
39
+ {% endif %}
40
+
41
+ {% if _icon is not empty %}
42
+ {% set _icon = _icon|merge({
43
+ path: _icon_path,
44
+ }) %}
45
+ {% endif %}
46
+
47
+ {% if attributes is empty %}
48
+ {% set attributes = create_attribute() %}
49
+ {% endif %}
50
+
51
+ {% if _aria_label is not empty %}
52
+ {% set attributes = attributes.setAttribute('aria-label', _aria_label ) %}
53
+ {% endif %}
54
+
55
+ {% if _active %}
56
+ {% set attributes = attributes.setAttribute('aria-current', 'page' ) %}
57
+ {% endif %}
58
+
59
+ {% set attributes = attributes.addClass(_classes) %}
60
+
61
+ {% if _path %}
62
+ {%- include '@oe-bcl/bcl-link/link.html.twig' with {
63
+ label: _label,
64
+ path: _path,
65
+ disabled: _disabled,
66
+ icon: _icon,
67
+ attributes: attributes,
68
+ } only -%}
69
+ {% else %}
70
+ <div {{ attributes }}>{{- _label -}}</div>
71
+ {% endif %}
72
+
73
+ {% endapply %}
@@ -5,49 +5,27 @@
5
5
  - options ['sm', 'lg']
6
6
  - alignment (string) (default: '')
7
7
  - options ['end', 'center']
8
- - aria_label (string) (default: '')
9
8
  - variant: (string) (default: '')
9
+ - options: ['glossary']
10
+ - aria_label (string) (default: '') - deprecated, use attributes
10
11
  - enable_prev_next_icon (boolean) (default: false)
11
12
  - enable_first_last_icon (boolean) (default: true)
12
- - first (object)
13
- format: {
14
- - path (string)
15
- - label (string)
16
- - disabled (boolean)
17
- - aria_label (string)
18
- - icon (Icon component)
19
- }
20
- - prev (object)
21
- format: {
22
- - path (string)
23
- - label (string)
24
- - disabled (boolean)
25
- - aria_label (string)
26
- - icon (Icon component)
27
- }
28
- - next (object)
29
- format: {
30
- - path (string)
31
- - label (string)
32
- - disabled (boolean)
33
- - aria_label (string)
34
- - icon (Icon component)
35
- }
36
- - last (object)
37
- format: {
38
- - path (string)
39
- - label (string)
40
- - disabled (boolean)
41
- - aria_label (string)
42
- - icon (Icon component)
43
- }
44
- - items (array of objects)
13
+ - ellipsis_before (boolean) (default: false)
14
+ - ellipsis_after (boolean) (default: false)
15
+ - first (pagination Item object) (default: {})
16
+ - prev (pagination Item object) (default: {})
17
+ - next (pagination Item object) (default: {})
18
+ - last (pagination Item object) (default: {})
19
+ - items (pagination item[]) (default: [])
45
20
  format: [
46
21
  {
47
- - path (string)
48
- - label (string)
49
- - disabled (boolean)
50
- - active (boolean)
22
+ - path (string) (default: '')
23
+ - label (string) (default: '')
24
+ - disabled (boolean) (default: false)
25
+ - active (boolean) (default: false)
26
+ - aria_label (string) (default: '') - deprecated, use attributes
27
+ - icon (Icon component) (default: {})
28
+ - attributes (drupal attrs)
51
29
  }
52
30
  - icon_path (string) (default: '')
53
31
  - attributes (drupal attrs)
@@ -55,32 +33,90 @@
55
33
 
56
34
  {% set _size = size|default('') %}
57
35
  {% set _alignment = alignment|default('') %}
58
- {% set _aria_label = aria_label|default('') %}
59
36
  {% set _variant = variant|default('') %}
60
- {% set _enable_prev_next_icon = enable_prev_next_icon|default(false) %}
37
+ {% set _aria_label = aria_label|default('') %}
38
+ {% set _enable_prev_next_icon = enable_prev_next_icon ?? false %}
61
39
  {% set _enable_first_last_icon = enable_first_last_icon ?? true %}
40
+ {% set _ellipsis_before = ellipsis_before ?? false %}
41
+ {% set _ellipsis_after = ellipsis_after ?? false %}
62
42
  {% set _first = first|default({}) %}
63
43
  {% set _prev = prev|default({}) %}
64
44
  {% set _next = next|default({}) %}
65
45
  {% set _last = last|default({}) %}
66
46
  {% set _items = items|default([]) %}
67
47
  {% set _icon_path = icon_path|default('') %}
48
+ {% set _internal_items = [] %}
68
49
 
69
- {% set _classes = 'pagination' %}
70
- {% if _size is not empty %}
71
- {% set _classes = _classes ~ ' pagination-' ~ _size %}
50
+ {% if _enable_first_last_icon %}
51
+ {% if _first is not empty %}
52
+ {% set _first = _first|merge({
53
+ icon_html: "&laquo;",
54
+ icon_name: "chevron-double-left",
55
+ }) %}
56
+ {% endif %}
57
+ {% if _last is not empty %}
58
+ {% set _last = _last|merge({
59
+ icon_html: '&raquo;',
60
+ icon_name: "chevron-double-right",
61
+ }) %}
62
+ {% endif %}
72
63
  {% endif %}
73
- {% if _variant is not empty %}
74
- {% set _classes = _classes ~ ' pagination--' ~ _variant %}
64
+
65
+ {% if _enable_prev_next_icon %}
66
+ {% if _prev is not empty %}
67
+ {% set _prev = _prev|merge({
68
+ icon_html: "&lsaquo;",
69
+ icon_name: "chevron-left",
70
+ }) %}
71
+ {% endif %}
72
+ {% if _next is not empty %}
73
+ {% set _next = _next|merge({
74
+ icon_html: "&rsaquo;",
75
+ icon_name: "chevron-right",
76
+ }) %}
77
+ {% endif %}
75
78
  {% endif %}
76
- {% if _alignment is not empty %}
77
- {% set _classes = _classes ~ ' justify-content-' ~ _alignment %}
79
+
80
+
81
+ {% set _internal_items = _internal_items|merge([_first, _prev]) %}
82
+
83
+ {% set _ellipsis_markup %} &hellip; {% endset %}
84
+
85
+ {% if _ellipsis_before %}
86
+ {% set _ellipsis_before_item = {
87
+ icon_html: _ellipsis_markup,
88
+ icon_path: "",
89
+ } %}
90
+ {% set _internal_items = _internal_items|merge([_ellipsis_before_item]) %}
91
+ {% endif %}
92
+
93
+ {% set _internal_items = _internal_items|merge(_items) %}
94
+
95
+ {% if _ellipsis_after %}
96
+ {% set _ellipsis_after_item = {
97
+ icon_html: _ellipsis_markup,
98
+ icon_path: "",
99
+ } %}
100
+ {% set _internal_items = _internal_items|merge([_ellipsis_after_item]) %}
78
101
  {% endif %}
79
102
 
103
+ {% set _internal_items = _internal_items|merge([_next, _last]) %}
104
+
80
105
  {% if attributes is empty %}
81
106
  {% set attributes = create_attribute() %}
82
107
  {% endif %}
83
108
 
109
+ {% set _classes = ['pagination'] %}
110
+ {% if _size is not empty %}
111
+ {% set _classes = _classes|merge(['pagination-' ~ _size]) %}
112
+ {% endif %}
113
+ {% if _variant is not empty %}
114
+ {% set _classes = _classes|merge(['pagination--' ~ _variant]) %}
115
+ {% endif %}
116
+ {% if _alignment is not empty %}
117
+ {% set _classes = _classes|merge(['justify-content-' ~ _alignment]) %}
118
+ {% endif %}
119
+
84
120
  {% set attributes = attributes.setAttribute('role', 'navigation') %}
85
121
 
86
122
  {% if _variant == 'glossary' %}
@@ -90,188 +126,32 @@
90
126
  {% if _aria_label is not empty %}
91
127
  {% set attributes = attributes.setAttribute('aria-label', aria_label) %}
92
128
  {% endif %}
93
- {% if _extra_classes is not empty %}
94
- {% set _class = _class ~ ' ' ~ _extra_classes %}
95
- {% endif %}
96
129
 
97
130
  <nav
98
131
  {{ attributes }}
99
132
  >
100
- <ul class="{{ _classes }}">
101
- {% if _first is not empty %}
102
- {% set _first_class = 'page-item' %}
103
- {% if _first.disabled %}
104
- {% set _first_class = _first_class ~ ' disabled' %}
105
- {% endif %}
106
- <li class="{{ _first_class }}">
107
- <a
108
- class="page-link"
109
- href="{{ _first.path }}"
110
- {% if _first.disabled %}
111
- tabindex="-1"
112
- aria-disabled="true"
133
+ <ul class="{{ _classes|join(' ') }}">
134
+ {% if _internal_items is not empty and _internal_items is iterable %}
135
+ {% for _item in _internal_items %}
136
+ {% if _item is not empty %}
137
+ {% set _item_class = ['page-item'] %}
138
+ {% if _item.disabled %}
139
+ {% set _item_class = _item_class|merge(['disabled']) %}
140
+ {% endif %}
141
+ {% if _item.active %}
142
+ {% set _item_class = _item_class|merge(['active']) %}
143
+ {% endif %}
144
+ <li class="{{ _item_class|join(' ') }}">
145
+ {% if _item.icon_path is not defined %}
146
+ {% set _item = _item|merge({
147
+ icon_path: _icon_path,
148
+ }) %}
113
149
  {% endif %}
114
- {%- if _first.aria_label -%}
115
- aria-label="{{ _first.aria_label }}"
116
- {%- endif -%}
117
- >
118
- {%- if _enable_first_last_icon -%}
119
- {%- if _first.icon is not empty -%}
120
- {%- include '@oe-bcl/bcl-icon/icon.html.twig' with _first.icon only -%}
121
- {%- else -%}
122
- {%- if _icon_path is not empty -%}
123
- {% include '@oe-bcl/bcl-icon/icon.html.twig' with {
124
- name: "chevron-double-left",
125
- size: "fluid",
126
- path: _icon_path,
127
- } only %}
128
- {%- else -%}
129
- <span aria-hidden="true">&laquo;</span>
130
- {%- endif -%}
131
- {%- endif -%}
132
- {%- else -%}
133
- {{- _first.label -}}
134
- {%- endif -%}
135
- </a>
136
- </li>
137
- {% endif %}
138
- {% if _prev is not empty %}
139
- {% set _prev_class = 'page-item' %}
140
- {% if _prev.disabled %}
141
- {% set _prev_class = _prev_class ~ ' disabled' %}
142
- {% endif %}
143
- <li class="{{ _prev_class }}">
144
- <a
145
- class="page-link"
146
- href="{{ _prev.path }}"
147
- {% if _prev.disabled %}
148
- tabindex="-1"
149
- aria-disabled="true"
150
- {% endif %}
151
- {%- if _prev.aria_label -%}
152
- aria-label="{{ _prev.aria_label }}"
153
- {%- endif -%}
154
- >
155
- {%- if _enable_prev_next_icon -%}
156
- {%- if _prev.icon is not empty -%}
157
- {%- include '@oe-bcl/bcl-icon/icon.html.twig' with _prev.icon only -%}
158
- {%- else -%}
159
- {%- if _icon_path is not empty -%}
160
- {% include '@oe-bcl/bcl-icon/icon.html.twig' with {
161
- name: "chevron-left",
162
- size: "fluid",
163
- path: _icon_path,
164
- } only %}
165
- {%- else -%}
166
- <span aria-hidden="true">&lsaquo;</span>
167
- {%- endif -%}
168
- {%- endif -%}
169
- {%- else -%}
170
- {{- _prev.label -}}
171
- {%- endif -%}
172
- </a>
173
- </li>
174
- {% endif %}
175
- {% if _items is not empty and _items is iterable %}
176
- {% for _item in _items %}
177
- {% set _item_class = 'page-item' %}
178
- {% if _item.disabled %}
179
- {% set _item_class = _item_class ~ ' disabled' %}
150
+ {% include '@oe-bcl/bcl-pagination/pagination-item.html.twig' with _item only %}
151
+ </li>
180
152
  {% endif %}
181
- {% if _item.active %}
182
- {% set _item_class = _item_class ~ ' active' %}
183
- {% endif %}
184
- <li class="{{ _item_class }}">
185
- <a
186
- class="page-link"
187
- href="{{ _item.path }}"
188
- {% if _item.disabled %}
189
- tabindex="-1"
190
- aria-disabled="true"
191
- {% endif %}
192
- {% if _item.active %}
193
- aria-current="page"
194
- {% endif %}
195
- >
196
- {{- _item.label -}}
197
- </a>
198
- </li>
199
- {% endfor %}
200
- {% endif %}
201
- {% if _next is not empty %}
202
- {% set _next_class = 'page-item' %}
203
- {% if _next.disabled %}
204
- {% set _next_class = _next_class ~ ' disabled' %}
205
- {% endif %}
206
- <li class="{{ _next_class }}">
207
- <a
208
- class="page-link"
209
- href="{{ _next.path }}"
210
- {% if _next.disabled %}
211
- tabindex="-1"
212
- aria-disabled="true"
213
- {% endif %}
214
- {%- if _next.aria_label -%}
215
- aria-label="{{ _next.aria_label }}"
216
- {%- endif -%}
217
- >
218
- {%- if _enable_prev_next_icon -%}
219
- {%- if _next.icon is not empty -%}
220
- {%- include '@oe-bcl/bcl-icon/icon.html.twig' with _next.icon only -%}
221
- {%- else -%}
222
- {%- if _icon_path is not empty -%}
223
- {% include '@oe-bcl/bcl-icon/icon.html.twig' with {
224
- name: "chevron-right",
225
- size: "fluid",
226
- path: _icon_path,
227
- } only %}
228
- {%- else -%}
229
- <span aria-hidden="true">&rsaquo;</span>
230
- {%- endif -%}
231
- {%- endif -%}
232
- {%- else -%}
233
- {{- _next.label -}}
234
- {%- endif -%}
235
- </a>
236
- </li>
237
- {% endif %}
238
- {% if _last is not empty %}
239
- {% set _last_class = 'page-item' %}
240
- {% if _last.disabled %}
241
- {% set _last_class = _last_class ~ ' disabled' %}
242
- {% endif %}
243
- <li class="{{ _last_class }}">
244
- <a
245
- class="page-link"
246
- href="{{ _last.path }}"
247
- {% if _last.disabled %}
248
- tabindex="-1"
249
- aria-disabled="true"
250
- {% endif %}
251
- {%- if _last.aria_label -%}
252
- aria-label="{{ _last.aria_label }}"
253
- {%- endif -%}
254
- >
255
- {%- if _enable_first_last_icon -%}
256
- {%- if _last.icon is not empty -%}
257
- {%- include '@oe-bcl/bcl-icon/icon.html.twig' with _last.icon only -%}
258
- {%- else -%}
259
- {%- if _icon_path is not empty -%}
260
- {% include '@oe-bcl/bcl-icon/icon.html.twig' with {
261
- name: "chevron-double-right",
262
- size: "fluid",
263
- path: _icon_path,
264
- } only %}
265
- {%- else -%}
266
- <span aria-hidden="true">&raquo;</span>
267
- {%- endif -%}
268
- {%- endif -%}
269
- {%- else -%}
270
- {{- _last.label -}}
271
- {%- endif -%}
272
- </a>
273
- </li>
274
- {% endif %}
153
+ {% endfor %}
154
+ {% endif %}
275
155
  </ul>
276
156
  </nav>
277
157
 
@@ -17,9 +17,9 @@
17
17
  {% set _progress = progress|default(0) %}
18
18
  {% set _min = min|default(0) %}
19
19
  {% set _max = max|default(100) %}
20
- {% set _striped = striped|default(false) %}
21
- {% set _animated = animated|default(false) %}
22
- {% set _hidden_label = hidden_label|default(false) %}
20
+ {% set _striped = striped ?? false %}
21
+ {% set _animated = animated ?? false %}
22
+ {% set _hidden_label = hidden_label ?? false %}
23
23
  {% set _label = label|default('') %}
24
24
  {% set _bar_label = bar_label|default('') %}
25
25
  {% set _variant = variant|default('') %}
@@ -5,26 +5,22 @@
5
5
  {% endblock %}
6
6
 
7
7
  {% block content %}
8
- {% if project_status_title is not empty %}
9
- {% set _project_title_attributes = create_attribute().addClass(['mb-4']) %}
10
- {% if project_status_id is not empty %}
11
- {% set _project_title_attributes = _project_title_attributes.setAttribute('id', project_status_id) %}
12
- {% endif %}
13
- {% include '@oe-bcl/bcl-heading/heading.html.twig' with {
14
- title: project_status_title,
15
- title_tag: 'h2',
16
- attributes: _project_title_attributes,
17
- } only %}
18
- {% endif %}
19
8
  {% if project_status is not empty %}
9
+ {% if project_status_title is not empty %}
10
+ {% set _project_title_attributes = create_attribute().addClass(['mb-4']) %}
11
+ {% include '@oe-bcl/bcl-heading/heading.html.twig' with {
12
+ title: project_status_title,
13
+ title_tag: 'h2',
14
+ attributes: create_attribute().setAttribute('id', project_status_id),
15
+ } only %}
16
+ {% endif %}
20
17
  {% include '@oe-bcl/bcl-project-status/project-status.html.twig' with project_status %}
21
- {% endif %}
22
- {% if project_contributions is not empty %}
23
- {% include '@oe-bcl/bcl-project-status/project-contributions.html.twig' with project_contributions %}
24
- {% endif %}
25
-
26
- {% if status_lists is not empty %}
27
- {% include '@oe-bcl/bcl-project/project-lists.html.twig' with status_lists only %}
18
+ {% if project_contributions is not empty %}
19
+ {% include '@oe-bcl/bcl-project-status/project-contributions.html.twig' with project_contributions %}
20
+ {% endif %}
21
+ {% if status_lists is not empty %}
22
+ {% include '@oe-bcl/bcl-project/project-lists.html.twig' with status_lists only %}
23
+ {% endif %}
28
24
  {% endif %}
29
25
 
30
26
  {% if first_paragraphs is defined and first_paragraphs is not empty %}
@@ -59,17 +55,6 @@
59
55
  {% endfor %}
60
56
  {% endif %}
61
57
 
62
- {% if gallery.main_title is not empty %}
63
- {% set _gallery_title_attributes = create_attribute().addClass(['my-4']) %}
64
- {% if gallery.main_title_id is not empty %}
65
- {% set _gallery_title_attributes = _gallery_title_attributes.setAttribute('id', gallery.main_title_id) %}
66
- {% endif %}
67
- {% include '@oe-bcl/bcl-heading/heading.html.twig' with {
68
- title: gallery.main_title,
69
- title_tag: 'h2',
70
- attributes: _gallery_title_attributes,
71
- } only %}
72
- {% endif %}
73
58
  {% if gallery is not empty %}
74
59
  <div class="mt-3 mb-4-5">
75
60
  {% include '@oe-bcl/bcl-gallery/gallery.html.twig' with gallery only %}
@@ -2,7 +2,7 @@
2
2
 
3
3
  {# Parameters:
4
4
  - corporate_contributions (string) (default: '') // value every 5 percent
5
- - legend (description list object) (default: false)
5
+ - legend (description list object) (default: {})
6
6
  - chart (boolean) (default: false)
7
7
 
8
8
  Blocks -
@@ -12,7 +12,7 @@
12
12
 
13
13
  {% set _corporate_contributions = corporate_contributions|default('') %}
14
14
  {% set _legend = legend|default({}) %}
15
- {% set _chart = chart|default(false) %}
15
+ {% set _chart = chart ?? false %}
16
16
 
17
17
  {% if attributes is empty %}
18
18
  {% set attributes = create_attribute() %}
@@ -1,24 +1,23 @@
1
1
  {% apply spaceless %}
2
2
 
3
3
  {# Parameters:
4
+ - label (string) (default: '')
4
5
  - status (string) (default: 'planned')
6
+ - badge (string) (default: '')
5
7
  - start_date (string) (default: '')
6
8
  - start_label (string) (default: '')
7
9
  - end_date (string) (default: '')
8
10
  - end_label (string) (default: '')
9
- - label (string) (default: '')
10
- - badge (string) (default: ''),
11
11
  - progress (string) (default: '')
12
12
  - attributes (drupal attrs)
13
13
  #}
14
14
 
15
15
  {% set _label = label|default('') %}
16
16
  {% set _status = status|default('planned') %}
17
- {% set _charts = charts|default('') %}
18
17
  {% set _badge = badge|default('') %}
19
18
  {% set _start_date = start_date|default('') %}
20
- {% set _end_date = end_date|default('') %}
21
19
  {% set _start_label = start_label|default('') %}
20
+ {% set _end_date = end_date|default('') %}
22
21
  {% set _end_label = end_label|default('') %}
23
22
  {% set _progress = progress|default('') %}
24
23
 
@@ -1,7 +1,7 @@
1
1
  {% apply spaceless %}
2
2
 
3
3
  {# Parameters:
4
- - activities (array of custom object) (default: [])
4
+ - activities (object[]) (default: [])
5
5
  format: [
6
6
  {
7
7
  image: {
@@ -9,7 +9,7 @@
9
9
  ]
10
10
  #}
11
11
 
12
- {% set _pill = pill|default(false) %}
12
+ {% set _pill = pill ?? false %}
13
13
  {% set _icon = icon|default({}) %}
14
14
  {% set _submit = submit|default({}) %}
15
15
  {% set _input = input|default({}) %}
@@ -15,7 +15,21 @@
15
15
  - valid_feedback (string) (default: '')
16
16
  - required (boolean) (default: false)
17
17
  - multiple (boolean) (default: false)
18
- - options: (array of objects with value and label keys) (default: [])
18
+ - options (object[]) (default: [])
19
+ format: [
20
+ {
21
+ selected (boolean, optional)
22
+ disabled (boolean, optional)
23
+ label (string)
24
+ hidden (boolean, optional)
25
+ options (object[], optional)
26
+ format: [{
27
+ selected (boolean, optional)
28
+ disabled (boolean, optional)
29
+ label (string)
30
+ }]
31
+ }
32
+ ]
19
33
  - aria_label (string) (default: '')
20
34
  - clean_class (boolean) (default: false) - removes 'form-select' class
21
35
  - attributes (drupal attrs)
@@ -24,19 +38,19 @@
24
38
  {% set _id = id|default('') %}
25
39
  {% set _label = label|default('') %}
26
40
  {% set _label_extra_classes = label_extra_classes|default('') %}
27
- {% set _hidden_label = hidden_label|default(false) %}
41
+ {% set _hidden_label = hidden_label ?? false %}
28
42
  {% set _helper_text = helper_text|default('') %}
29
43
  {% set _helper_text_id = helper_text_id|default('') %}
30
- {% set _disabled = disabled|default(false) %}
31
- {% set _invalid = invalid|default(false) %}
32
- {% set _valid = valid|default(false) %}
44
+ {% set _disabled = disabled ?? false %}
45
+ {% set _invalid = invalid ?? false %}
46
+ {% set _valid = valid ?? false %}
33
47
  {% set _invalid_feedback = invalid_feedback|default('') %}
34
48
  {% set _valid_feedback = valid_feedback|default('') %}
35
- {% set _required = required|default(false) %}
36
- {% set _multiple = multiple|default(false) %}
49
+ {% set _required = required ?? false %}
50
+ {% set _multiple = multiple ?? false %}
37
51
  {% set _options = options|default([]) %}
38
52
  {% set _aria_label = aria_label|default('') %}
39
- {% set _clean_class = clean_class|default(false) %}
53
+ {% set _clean_class = clean_class ?? false %}
40
54
 
41
55
  {% set _classes = ['form-select'] %}
42
56
  {% set _label_class = 'form-label' %}
@@ -3,7 +3,7 @@
3
3
  {# Parameters:
4
4
  - form: (form object) (default: {})
5
5
  - success_alert: (alert object) (default: {})
6
- - error_alert: (button Object) (default: {})
6
+ - error_alert: (alert Object) (default: {})
7
7
 
8
8
  Blocks:
9
9
  - body