desy-html 8.1.6 → 8.2.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.
Files changed (34) hide show
  1. package/config/tailwind.config.js +0 -1
  2. package/docs/_macro.example-render.njk +13 -13
  3. package/docs/_macro.load-component-template.njk +1 -1
  4. package/docs/_macro.render-caller.njk +1 -1
  5. package/docs/index.html +12 -0
  6. package/package.json +4 -5
  7. package/src/js/aria/MenuVertical.js +71 -0
  8. package/src/js/aria/dataGrid.js +1 -1
  9. package/src/js/desy-html.js +14 -0
  10. package/src/js/index.js +3 -2
  11. package/src/templates/components/button/_examples.button.njk +9 -2
  12. package/src/templates/components/button/_template.button.njk +1 -1
  13. package/src/templates/components/listbox/_examples.listbox.njk +3 -3
  14. package/src/templates/components/menu-vertical/_examples.menu-vertical.njk +8 -4
  15. package/src/templates/components/menu-vertical/_template.menu-vertical.njk +7 -7
  16. package/src/templates/components/menu-vertical/params.menu-vertical.yaml +4 -0
  17. package/src/templates/components/pagination/_examples.pagination.njk +177 -8
  18. package/src/templates/components/pagination/_template.pagination.njk +48 -15
  19. package/src/templates/components/pagination/params.pagination.yaml +36 -4
  20. package/src/templates/components/status-item/_examples.status-item.njk +13 -13
  21. package/src/templates/components/table/_examples.table.njk +75 -0
  22. package/src/templates/components/table/_template.table.njk +11 -0
  23. package/src/templates/components/table/params.table.yaml +29 -0
  24. package/src/templates/components/table-advanced/_examples.table-advanced.njk +115 -1
  25. package/src/templates/components/table-advanced/_template.table-advanced.njk +42 -2
  26. package/src/templates/components/table-advanced/params.table-advanced.yaml +33 -0
  27. package/src/templates/pages/_template.home.njk +4 -1
  28. package/src/templates/pages/_template.logged-out.njk +4 -1
  29. package/src/templates/pages/_template.logged-selector-fixed-headroom.njk +3 -0
  30. package/src/templates/pages/_template.logged-selector-fixed.njk +3 -0
  31. package/src/templates/pages/_template.logged.njk +3 -0
  32. package/src/templates/pages/_template.mfe.njk +3 -0
  33. package/src/templates/pages/_template.test.njk +3 -0
  34. package/src/templates/pages/_template.with-header-advanced.njk +4 -1
@@ -40,7 +40,7 @@
40
40
  }
41
41
  },
42
42
  {
43
- "name": "Estilo Listbox ",
43
+ "name": "Estilo Listbox",
44
44
  "description": 'Usa el parámetro <code>"hasSelect": true</code> para mostrar la paginación como un Listbox en vez de botones.',
45
45
  "data": {
46
46
  "id": "listbox-style",
@@ -55,12 +55,12 @@
55
55
  },
56
56
  {
57
57
  "href": "#",
58
- "text": 2
58
+ "text": 2,
59
+ "active": true
59
60
  },
60
61
  {
61
62
  "href": "#",
62
- "text": 3,
63
- "active": true
63
+ "text": 3
64
64
  },
65
65
  {
66
66
  "href": "#",
@@ -107,8 +107,6 @@
107
107
  "text": 14
108
108
  }
109
109
  ],
110
- "hasPrevious": true,
111
- "hasNext": true,
112
110
  "previousText": "Anterior",
113
111
  "nextText": "Siguiente",
114
112
  "attributes": {
@@ -117,8 +115,52 @@
117
115
  }
118
116
  },
119
117
  {
120
- "name": "sin página previa",
118
+ "name": "Con página previa deshabilitada",
121
119
  "description": 'En este ejemplo <code>"hasSelect": true</code> y <code>"hasPrevious": false</code>',
120
+ "data": {
121
+ "id": "with-previous-page-disabled",
122
+ "hasSelect": true,
123
+ "idPrefix": "pagination-without-prev",
124
+ "totalItems": "64",
125
+ "itemsPerPage": "10",
126
+ "items": [
127
+ {
128
+ "href": "#",
129
+ "text": 1,
130
+ "active": true
131
+ },
132
+ {
133
+ "href": "#",
134
+ "text": 2
135
+ },
136
+ {
137
+ "href": "#",
138
+ "text": 3
139
+ },
140
+ {
141
+ "href": "#",
142
+ "text": 4
143
+ },
144
+ {
145
+ "href": "#",
146
+ "text": 5
147
+ },
148
+ {
149
+ "href": "#",
150
+ "text": 6
151
+ }
152
+ ],
153
+ "hasPrevious": false,
154
+ "previousText": "Anterior",
155
+ "nextText": "Siguiente",
156
+ "attributes": {
157
+ "aria-label": "Paginación"
158
+ }
159
+ }
160
+ },
161
+ {
162
+ "name": "Sin página previa",
163
+ "description": 'En este ejemplo <code>"hasSelect": true</code> y <code>"showPrevious": false</code>',
122
164
  "data": {
123
165
  "id": "without-previous-page",
124
166
  "hasSelect": true,
@@ -152,10 +194,137 @@
152
194
  "text": 6
153
195
  }
154
196
  ],
197
+ "showPrevious": false,
198
+ "previousText": "Anterior",
199
+ "nextText": "Siguiente",
200
+ "attributes": {
201
+ "aria-label": "Paginación"
202
+ }
203
+ }
204
+ },
205
+ {
206
+ "name": "Con página primera y última",
207
+ "description": 'En este ejemplo <code>"hasSelect": true</code>, <code>"showFirst": true</code> y <code>"showLast": true</code>',
208
+ "data": {
209
+ "id": "without-previous-page-disabled",
210
+ "hasSelect": true,
211
+ "idPrefix": "pagination-without-prev",
212
+ "totalItems": "64",
213
+ "itemsPerPage": "10",
214
+ "items": [
215
+ {
216
+ "href": "#",
217
+ "text": 1
218
+ },
219
+ {
220
+ "href": "#",
221
+ "text": 2,
222
+ "active": true
223
+ },
224
+ {
225
+ "href": "#",
226
+ "text": 3
227
+ },
228
+ {
229
+ "href": "#",
230
+ "text": 4
231
+ },
232
+ {
233
+ "href": "#",
234
+ "text": 5
235
+ },
236
+ {
237
+ "href": "#",
238
+ "text": 6
239
+ }
240
+ ],
241
+ "previousText": "Anterior",
242
+ "nextText": "Siguiente",
243
+ "showFirst": true,
244
+ "showLast": true,
245
+ "firstText": "Primera",
246
+ "lastText": "Última",
247
+ "attributes": {
248
+ "aria-label": "Paginación"
249
+ }
250
+ }
251
+ },
252
+ {
253
+ "name": "Con página primera deshabilitada y última",
254
+ "description": 'En este ejemplo <code>"hasSelect": true</code>, <code>"hasPrevious": false</code>, <code>"showFirst": true</code> y <code>"hasFirst": false</code>',
255
+ "data": {
256
+ "id": "listbox-style",
257
+ "hasSelect": true,
258
+ "idPrefix": "pagination-has-select",
259
+ "totalItems": "64",
260
+ "itemsPerPage": "10",
261
+ "items": [
262
+ {
263
+ "href": "#",
264
+ "text": 1,
265
+ "active": true
266
+ },
267
+ {
268
+ "href": "#",
269
+ "text": 2
270
+ },
271
+ {
272
+ "href": "#",
273
+ "text": 3
274
+ },
275
+ {
276
+ "href": "#",
277
+ "text": 4
278
+ },
279
+ {
280
+ "href": "#",
281
+ "text": 5
282
+ },
283
+ {
284
+ "href": "#",
285
+ "text": 6
286
+ },
287
+ {
288
+ "href": "#",
289
+ "text": 7
290
+ },
291
+ {
292
+ "href": "#",
293
+ "text": 8
294
+ },
295
+ {
296
+ "href": "#",
297
+ "text": 9
298
+ },
299
+ {
300
+ "href": "#",
301
+ "text": 10
302
+ },
303
+ {
304
+ "href": "#",
305
+ "text": 11
306
+ },
307
+ {
308
+ "href": "#",
309
+ "text": 12
310
+ },
311
+ {
312
+ "href": "#",
313
+ "text": 13
314
+ },
315
+ {
316
+ "href": "#",
317
+ "text": 14
318
+ }
319
+ ],
155
320
  "hasPrevious": false,
156
- "hasNext": true,
157
321
  "previousText": "Anterior",
158
322
  "nextText": "Siguiente",
323
+ "showFirst": true,
324
+ "showLast": true,
325
+ "hasFirst": false,
326
+ "firstText": "Primera",
327
+ "lastText": "Última",
159
328
  "attributes": {
160
329
  "aria-label": "Paginación"
161
330
  }
@@ -12,8 +12,10 @@
12
12
  {% set activePosition = loop.index0 %}
13
13
  {% endif %}
14
14
  {% endfor %}
15
- {% set disabledPrevious = not params.hasPrevious %}
16
- {% set disabledNext = not params.hasNext %}
15
+ {% set disabledPrevious = not params.hasPrevious if params.hasPrevious != undefined else false %}
16
+ {% set disabledNext = not params.hasNext if params.hasNext != undefined else false %}
17
+ {% set disabledFirst = not params.hasFirst if params.hasFirst != undefined else false %}
18
+ {% set disabledLast = not params.hasLast if params.hasLast != undefined else false %}
17
19
 
18
20
  {% set commonAttributes %} class="flex flex-wrap items-center flex-1 mb-base lg:mb-0 text-sm{%- if params.classes %} {{ params.classes }}{% endif %}"
19
21
  {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}{% endset %}
@@ -77,6 +79,18 @@
77
79
  Selecciona una página para cargar datos
78
80
  </p>
79
81
  <nav {{- commonAttributes | safe }}>
82
+ {% if params.showFirst %}
83
+ {{ componentButton({
84
+ "html": '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" class="self-center h-2.5 w-2.5 mr-2" aria-hidden="true" focusable="false"><g><path d="M10.42,12a2.64,2.64,0,0,1,.77-1.88L20.73.58a1.77,1.77,0,0,1,2.5,2.5l-8.74,8.74a.27.27,0,0,0,0,.36l8.74,8.74a1.77,1.77,0,0,1-2.5,2.5l-9.54-9.54A2.64,2.64,0,0,1,10.42,12Z" fill="currentColor"></path><path d="M.25,12A2.65,2.65,0,0,1,1,10.12L10.57.58a1.77,1.77,0,0,1,2.5,2.5L4.33,11.82a.25.25,0,0,0,0,.36l8.74,8.74a1.77,1.77,0,0,1-2.5,2.5L1,13.88A2.65,2.65,0,0,1,.25,12Z" fill="currentColor"></path></g></svg>' + prefix + params.firstText + previousSuffix,
85
+ "href": "#",
86
+ "disabled": disabledFirst,
87
+ "classes": "c-button--sm c-button--transparent mr-xs",
88
+ "attributes": {
89
+ "id": params.idPrefix + "-first"
90
+ }
91
+ }) | trim | indent(4) }}
92
+ {% endif %}
93
+ {% if params.showPrevious != false %}
80
94
  {{ componentButton({
81
95
  "html": '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" width="1em" height="1em" class="self-center h-2.5 w-2.5 mr-2" aria-hidden="true" focusable="false"><path d="M54.87 71.77a2.5 2.5 0 010-3.54L106 17.07A10 10 0 1091.89 2.93L35.43 59.39a15 15 0 000 21.22l56.46 56.46A10 10 0 10106 122.93z" fill="currentColor" /></svg>' + prefix + params.previousText + previousSuffix,
82
96
  "href": "#",
@@ -86,19 +100,26 @@
86
100
  "id": params.idPrefix + "-previous"
87
101
  }
88
102
  }) | trim | indent(4) }}
89
- {{ componentListbox({
90
- "id": params.id + "-listbox",
91
- "idPrefix": params.idPrefix,
92
- "text": "Página " + params.items[activePosition].text,
93
- "classes": "c-listbox--sm c-listbox--transparent mr-xs",
94
- "classesTooltip": "max-h-52 overflow-y-auto",
95
- "doesChangeButtonText": true,
96
- "label": {
97
- "text": "Selecciona una página para cargar datos",
98
- "classes": "sr-only"
99
- },
100
- "items": params.items
101
- }) | trim | indent(4) }}
103
+ {% endif %}
104
+ <div class="flex flex-wrap items-center {%- if params.showFirst or params.showLast %} w-full lg:w-auto{% endif %} pl-sm">
105
+ {% if params.showFirst or params.showLast %}
106
+ <p class="lg:hidden mr-xs text-sm text-neutral-dark">Página actual:</p>
107
+ {% endif %}
108
+ {{ componentListbox({
109
+ "id": params.id + "-listbox",
110
+ "idPrefix": params.idPrefix,
111
+ "text": "Página " + params.items[activePosition].text,
112
+ "classes": "c-listbox--sm c-listbox--transparent mr-xs",
113
+ "classesTooltip": "max-h-52 overflow-y-auto",
114
+ "doesChangeButtonText": true,
115
+ "label": {
116
+ "text": "Selecciona una página para cargar datos",
117
+ "classes": "sr-only"
118
+ },
119
+ "items": params.items
120
+ }) | trim | indent(4) }}
121
+ </div>
122
+ {% if params.showNext != false %}
102
123
  {{ componentButton({
103
124
  "html": prefix + params.nextText + nextSuffix + '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" width="1em" height="1em" class="self-center h-2.5 w-2.5 ml-2" aria-hidden="true" focusable="false"><path d="M34 137.07a10 10 0 010-14.14l51.13-51.16a2.5 2.5 0 000-3.54L34 17.07A10 10 0 0148.11 2.93l56.46 56.46a15 15 0 010 21.22l-56.46 56.46a10 10 0 01-14.11 0z" fill="currentColor" /></svg>',
104
125
  "href": "#",
@@ -108,6 +129,18 @@
108
129
  "id": params.idPrefix + "-next"
109
130
  }
110
131
  }) | trim | indent(4) }}
132
+ {% endif %}
133
+ {% if params.showLast %}
134
+ {{ componentButton({
135
+ "html": prefix + params.lastText + nextSuffix + '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" class="self-center h-2.5 w-2.5 ml-2" aria-hidden="true" focusable="false"><g><path d="M13.58,12a2.64,2.64,0,0,1-.77,1.88L3.27,23.42a1.77,1.77,0,0,1-2.5-2.5l8.74-8.74a.27.27,0,0,0,0-.36L.77,3.08A1.77,1.77,0,0,1,3.27.58l9.54,9.54A2.64,2.64,0,0,1,13.58,12Z" fill="currentColor"></path><path d="M23.75,12A2.65,2.65,0,0,1,23,13.88l-9.54,9.54a1.77,1.77,0,0,1-2.5-2.5l8.74-8.74a.25.25,0,0,0,0-.36L10.93,3.08a1.77,1.77,0,0,1,2.5-2.5L23,10.12A2.65,2.65,0,0,1,23.75,12Z" fill="currentColor"></path></g></svg>',
136
+ "href": "#",
137
+ "disabled": disabledLast,
138
+ "classes": "c-button--sm c-button--transparent mr-xs",
139
+ "attributes": {
140
+ "id": params.idPrefix + "-last"
141
+ }
142
+ }) | trim | indent(4) }}
143
+ {% endif %}
111
144
  </nav>
112
145
  {% else %}
113
146
  <nav {{- commonAttributes | safe }}>
@@ -23,22 +23,54 @@ params:
23
23
  type: string
24
24
  required: true
25
25
  description: Number of items per each page.
26
- - name: hasPrevious
26
+ - name: showPrevious
27
27
  type: boolean
28
28
  required: false
29
- description: If true, shows the previous button if hasSelect is true.
30
- - name: hasNext
29
+ description: If true, shows the Previous button if hasSelect is true. Defaults to true.
30
+ - name: hasPrevious
31
31
  type: boolean
32
32
  required: false
33
- description: If true, shows the next button if hasSelect is true.
33
+ description: If false, the Previous button is disabled. Defaults to true.
34
34
  - name: previousText
35
35
  type: string
36
36
  required: false
37
37
  description: Text for the previous button. Defaults to "Anterior".
38
+ - name: showNext
39
+ type: boolean
40
+ required: false
41
+ description: If true, shows the Next button if hasSelect is true. Defaults to true.
42
+ - name: hasNext
43
+ type: boolean
44
+ required: false
45
+ description: If false, the Next button is disabled. Defaults to true.
38
46
  - name: nextText
39
47
  type: string
40
48
  required: false
41
49
  description: Text for the previous button. Defaults to "Siguiente".
50
+ - name: showFirst
51
+ type: boolean
52
+ required: false
53
+ description: If true, shows the First button if hasSelect is true. Defaults to false.
54
+ - name: hasFirst
55
+ type: boolean
56
+ required: false
57
+ description: If false, the First button is disabled. Defaults to true.
58
+ - name: firstText
59
+ type: string
60
+ required: false
61
+ description: Text for the first button. Defaults to "Anterior".
62
+ - name: showLast
63
+ type: boolean
64
+ required: false
65
+ description: If true, shows the Last button if hasSelect is true. Defaults to false.
66
+ - name: hasLast
67
+ type: boolean
68
+ required: false
69
+ description: If false, the Last button is disabled. Defaults to true.
70
+ - name: lastText
71
+ type: string
72
+ required: false
73
+ description: Text for the last button. Defaults to "Siguiente".
42
74
  - name: itemsListbox
43
75
  type: object
44
76
  required: false
@@ -7,7 +7,7 @@
7
7
  "title": {
8
8
  "text": "Título"
9
9
  },
10
- "caller": '<button class="c-button c-button--transparent" data-module="c-button">Acción</button>'
10
+ "caller": '<button class="c-button c-button--transparent">Modificar<span class="sr-only"> item del Título</span></button>'
11
11
  }
12
12
  },
13
13
  {
@@ -46,7 +46,7 @@
46
46
  "type": "success"
47
47
  }
48
48
  },
49
- "caller": '<button class="c-button c-button--transparent" data-module="c-button">Acción</button>'
49
+ "caller": '<button class="c-button c-button--transparent">Modificar<span class="sr-only"> los datos de término y definición y el resto</span></button>'
50
50
  }
51
51
  },
52
52
  {
@@ -56,7 +56,7 @@
56
56
  "title": {
57
57
  "html": 'Autorización para la consulta de datos de las personas de la unidad familiar. <span class="text-neutral-dark">(Documento condicionado)</span>'
58
58
  },
59
- "caller": '<button class="c-button c-button--transparent" data-module="c-button">Aportar</button>'
59
+ "caller": '<button class="c-button c-button--transparent">Aportar<span class="sr-only"> Autorización para la consulta de datos de las personas de la unidad familiar</span></button>'
60
60
  }
61
61
  },
62
62
  {
@@ -75,7 +75,7 @@
75
75
  "type": "success"
76
76
  }
77
77
  },
78
- "caller": '<button class="c-button c-button--transparent" data-module="c-button">Modificar</button>'
78
+ "caller": '<button class="c-button c-button--transparent">Modificar<span class="sr-only"> personas de la unidad familiar</span></button>'
79
79
  }
80
80
  },
81
81
  {
@@ -88,7 +88,7 @@
88
88
  "hint": {
89
89
  "html": '<a href="#" class="c-link"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" width="1em" height="1em" class="inline-block self-center w-4 h-4 mr-sm no-underline" role="img" aria-hidden="true"><path d="M100.3 52.2a7.49 7.49 0 00-10.6 0L77.5 64.39V7.5a7.5 7.5 0 00-15 0v56.89L50.3 52.2a7.5 7.5 0 10-10.6 10.6l25 25a7.49 7.49 0 0010.6 0l25-25a7.49 7.49 0 000-10.6zM130 95a10 10 0 00-10 10v12.5a2.5 2.5 0 01-2.5 2.5h-95a2.5 2.5 0 01-2.5-2.5V105a10 10 0 00-20 0v15a20 20 0 0020 20h100a20 20 0 0020-20v-15a10 10 0 00-10-10z" fill="currentColor"/></svg>Descargar modelo</a>'
90
90
  },
91
- "caller": '<button class="c-button c-button--transparent" data-module="c-button">Aportar</button>'
91
+ "caller": '<button class="c-button c-button--transparent">Aportar<span class="sr-only"> Autorización para la consulta de datos de las personas de la unidad familiar</span></button>'
92
92
  }
93
93
  },
94
94
  {
@@ -101,7 +101,7 @@
101
101
  "status": {
102
102
  "text": "Iniciado"
103
103
  },
104
- "caller": '<button class="c-button c-button--transparent" data-module="c-button">Rellenar</button>'
104
+ "caller": '<button class="c-button c-button--transparent">Rellenar<span class="sr-only"> datos adicionales del solicitante</span></button>'
105
105
  }
106
106
  },
107
107
  {
@@ -117,7 +117,7 @@
117
117
  "type": "success"
118
118
  }
119
119
  },
120
- "caller": '<button class="c-button c-button--transparent" data-module="c-button">Modificar</button>'
120
+ "caller": '<button class="c-button c-button--transparent">Modificar<span class="sr-only"> datos adicionales del solicitante</span></button>'
121
121
  }
122
122
  },
123
123
  {
@@ -138,7 +138,7 @@
138
138
  },
139
139
  "classes": "text-alert-base"
140
140
  },
141
- "caller": '<button class="c-button c-button--transparent" data-module="c-button">Modificar</button>',
141
+ "caller": '<button class="c-button c-button--transparent">Modificar<span class="sr-only"> datos adicionales del solicitante</span></button>',
142
142
  "classes": "border-l-4 border-alert-base"
143
143
  }
144
144
  },
@@ -155,7 +155,7 @@
155
155
  "type": "loading"
156
156
  }
157
157
  },
158
- "caller": '<button class="c-button c-button--transparent" data-module="c-button">Modificar</button>'
158
+ "caller": '<button class="c-button c-button--transparent">Modificar<span class="sr-only"> datos adicionales del solicitante</span></button>'
159
159
  }
160
160
  },
161
161
  {
@@ -176,7 +176,7 @@
176
176
  },
177
177
  "classes": "text-alert-base"
178
178
  },
179
- "caller": '<button class="c-button c-button--transparent" data-module="c-button">Ver</button>',
179
+ "caller": '<button class="c-button c-button--transparent">Ver<span class="sr-only"> datos adicionales del solicitante</span></button>',
180
180
  "classes": "border-l-4 border-alert-base"
181
181
  }
182
182
  },
@@ -200,13 +200,13 @@
200
200
  "type": "success"
201
201
  }
202
202
  },
203
- "caller": '<button class="c-button c-button--transparent" data-module="c-button">Modificar</button>'
203
+ "caller": '<button class="c-button c-button--transparent">Modificar<span class="sr-only"> acreditación</span></button>'
204
204
  }
205
205
  },
206
206
  {
207
207
  "name": "incompleto",
208
208
  "data": {
209
- "id": "incompleto",
209
+ "id": "incompleto-status-item",
210
210
  "items": [
211
211
  {
212
212
  "term": {
@@ -239,7 +239,7 @@
239
239
  "type": "alert"
240
240
  }
241
241
  },
242
- "caller": '<button class="c-button c-button--transparent" data-module="c-button">Rellenar</button>',
242
+ "caller": '<button class="c-button c-button--transparent">Rellenar<span class="sr-only"> datos adicionales del solicitante</span></button>',
243
243
  "classes": "border-l-4 border-alert-base"
244
244
  }
245
245
  }
@@ -61,6 +61,81 @@
61
61
  ]
62
62
  }
63
63
  },
64
+ {
65
+ "name": "tabla con tfoot",
66
+ "data": {
67
+ "caption": "Caption de la tabla",
68
+ "captionClasses": "sr-only mb-base font-bold text-left text-lg",
69
+ "head": [
70
+ {
71
+ "text": "Mes de pago"
72
+ },
73
+ {
74
+ "text": "Primer pago",
75
+ "classes": "text-right"
76
+ },
77
+ {
78
+ "text": "Segundo pago",
79
+ "classes": "text-right"
80
+ }
81
+ ],
82
+ "rows": [
83
+ [
84
+ {
85
+ "text": "Enero"
86
+ },
87
+ {
88
+ "text": "85€",
89
+ "classes": "text-right"
90
+ },
91
+ {
92
+ "text": "95€",
93
+ "classes": "text-right"
94
+ }
95
+ ],
96
+ [
97
+ {
98
+ "text": "Febrero"
99
+ },
100
+ {
101
+ "text": "75€",
102
+ "classes": "text-right"
103
+ },
104
+ {
105
+ "text": "55€",
106
+ "classes": "text-right"
107
+ }
108
+ ],
109
+ [
110
+ {
111
+ "text": "Marzo"
112
+ },
113
+ {
114
+ "text": "165€",
115
+ "classes": "text-right"
116
+ },
117
+ {
118
+ "text": "125€",
119
+ "classes": "text-right"
120
+ }
121
+ ]
122
+ ],
123
+ "foot": [
124
+ {
125
+ "text": "Suma",
126
+ "classes": "uppercase"
127
+ },
128
+ {
129
+ "text": "325€",
130
+ "classes": "text-right"
131
+ },
132
+ {
133
+ "text": "275€",
134
+ "classes": "text-right"
135
+ }
136
+ ]
137
+ }
138
+ },
64
139
  {
65
140
  "name": "tabla con caption visible",
66
141
  "data": {
@@ -39,6 +39,17 @@
39
39
  {% endif %}
40
40
  {% endfor %}
41
41
  </tbody>
42
+ {% if params.foot %}
43
+ <tfoot>
44
+ <tr class="border-t-2 border-b border-neutral-base">
45
+ {% for item in params.foot %}
46
+ <td scope="col" class="px-base py-sm {%- if item.classes %} {{ item.classes }}{% endif %}"
47
+ {%- if item.colspan %} colspan="{{ item.colspan }}"{% endif %}
48
+ {%- if item.rowspan %} rowspan="{{ item.rowspan }}"{% endif %}{% for attribute, value in item.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>{{ item.html |safe if item.html else item.text }}</td>
49
+ {% endfor %}
50
+ </tr>
51
+ </tfoot>
52
+ {% endif %}
42
53
  </table>
43
54
  {% endset %}
44
55
 
@@ -57,6 +57,35 @@ params:
57
57
  type: object
58
58
  required: false
59
59
  description: HTML attributes (for example data attributes) to add to the table cell.
60
+ - name: foot
61
+ type: array
62
+ required: false
63
+ description: Array of table tfoot cells.
64
+ params:
65
+ - name: text
66
+ type: string
67
+ required: false
68
+ description: If `html` is set, this is not required. Text for table tfoot cells. If `html` is provided, the `text` argument will be ignored.
69
+ - name: html
70
+ type: string
71
+ required: false
72
+ description: If `text` is set, this is not required. HTML for table tfoot cells. If `html` is provided, the `text` argument will be ignore
73
+ - name: classes
74
+ type: string
75
+ required: false
76
+ description: Classes to add to the table tfoot cell.
77
+ - name: colspan
78
+ type: integer
79
+ required: false
80
+ description: Specify how many columns a cell extends.
81
+ - name: rowspan
82
+ type: integer
83
+ required: false
84
+ description: Specify how many rows a cell extends.
85
+ - name: attributes
86
+ type: object
87
+ required: false
88
+ description: HTML attributes (for example data attributes) to add to the table cell.
60
89
  - name: caption
61
90
  type: string
62
91
  required: false