desy-html 12.0.1 → 13.0.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.
- package/docs/_include.template-header.njk +320 -326
- package/docs/_macro.example-render.njk +8 -8
- package/docs/ds/_ds.example.textos.njk +1 -1
- package/docs/ds/_ds.section.espaciado.njk +2 -2
- package/docs/ds/_ds.section.textos.njk +1 -1
- package/docs/ds/_ds.section.typography.njk +1 -1
- package/docs/index.html +14 -0
- package/docs/pagina-accesibilidad.html +1 -1
- package/docs/pagina-mapa-web.html +1 -1
- package/docs/plantilla-con-header-advanced.html +1 -1
- package/docs/plantilla-editar-con-cabecera-fija-y-sidebar-sticky.html +1 -1
- package/docs/plantilla-editar-con-cabecera-fija.html +1 -1
- package/docs/plantilla-logueado-con-cabecera-fija-headroom.html +1 -1
- package/docs/plantilla-logueado-con-cabecera-fija.html +1 -1
- package/docs/plantilla-logueado-con-selector-de-app-y-sidebar.html +1 -1
- package/docs/plantilla-logueado-con-selector-de-app-y-subheader.html +1 -1
- package/docs/plantilla-logueado-con-selector-de-app.html +1 -1
- package/docs/plantilla-logueado-con-titulo-de-app.html +1 -1
- package/docs/plantilla-sin-loguear.html +1 -1
- package/package.json +1 -1
- package/src/js/aria/MenuNavigation.js +4 -1
- package/src/js/aria/MenubarAction.js +100 -25
- package/src/js/aria/listbox.js +1 -1
- package/src/js/aria/tabs.js +0 -2
- package/src/js/desy-html.js +3 -11
- package/src/js/index.js +0 -2
- package/src/templates/components/accordion/_template.accordion.njk +7 -7
- package/src/templates/components/accordion-history/_template.accordion-history.njk +17 -17
- package/src/templates/components/alert/_examples.alert.njk +3 -3
- package/src/templates/components/breadcrumbs/_examples.breadcrumbs.njk +27 -27
- package/src/templates/components/breadcrumbs/_styles.breadcrumbs.css +7 -4
- package/src/templates/components/breadcrumbs/_template.breadcrumbs.njk +1 -1
- package/src/templates/components/button/_examples.button.njk +12 -13
- package/src/templates/components/button-loader/_examples.button-loader.njk +5 -5
- package/src/templates/components/button-loader/_template.button-loader.njk +1 -1
- package/src/templates/components/card/_examples.card.njk +25 -22
- package/src/templates/components/card/_template.card.njk +10 -10
- package/src/templates/components/character-count/_examples.character-count.njk +1 -1
- package/src/templates/components/checkboxes/_template.checkboxes.njk +2 -3
- package/src/templates/components/date-input/_template.date-input.njk +0 -1
- package/src/templates/components/datepicker/_template.datepicker.njk +1 -2
- package/src/templates/components/dropdown/_template.dropdown.njk +1 -1
- package/src/templates/components/error-summary/_template.error-summary.njk +1 -1
- package/src/templates/components/file-upload/_examples.file-upload.njk +6 -6
- package/src/templates/components/file-upload/_template.file-upload.njk +0 -1
- package/src/templates/components/footer/_template.footer.njk +2 -1
- package/src/templates/components/header/_examples.header.njk +5 -4
- package/src/templates/components/header/_template.header.header__navigation.njk +24 -26
- package/src/templates/components/header/_template.header.njk +1 -0
- package/src/templates/components/header-advanced/_examples.header-advanced.njk +63 -52
- package/src/templates/components/header-mini/_examples.header-mini.njk +1 -1
- package/src/templates/components/input/_template.input.njk +1 -2
- package/src/templates/components/input-group/_examples.input-group.njk +2 -2
- package/src/templates/components/input-group/_template.input-group.njk +1 -2
- package/src/templates/components/item/_examples.item.njk +13 -2
- package/src/templates/components/item/_template.item.njk +3 -3
- package/src/templates/components/links-list/_examples.links-list.njk +32 -0
- package/src/templates/components/listbox/_template.listbox.njk +3 -3
- package/src/templates/components/menu-horizontal/_examples.menu-horizontal.njk +34 -19
- package/src/templates/components/menu-horizontal/_styles.menu-horizontal.css +2 -1
- package/src/templates/components/menu-horizontal/_template.menu-horizontal.njk +4 -4
- package/src/templates/components/menu-navigation/_examples.menu-navigation.njk +0 -23
- package/src/templates/components/menu-navigation/_template.menu-navigation.njk +3 -5
- package/src/templates/components/menu-vertical/_template.menu-vertical.njk +2 -2
- package/src/templates/components/menubar/_styles.menubar.css +10 -0
- package/src/templates/components/menubar/_template.menubar.njk +2 -1
- package/src/templates/components/nav/_template.nav.njk +1 -1
- package/src/templates/components/notification/_template.notification.njk +2 -2
- package/src/templates/components/pagination/_template.pagination.njk +6 -6
- package/src/templates/components/pill/_examples.pill.njk +6 -6
- package/src/templates/components/radios/_template.radios.njk +1 -2
- package/src/templates/components/searchbar/_template.searchbar.njk +0 -1
- package/src/templates/components/select/_template.select.njk +0 -3
- package/src/templates/components/spinner/_template.spinner.njk +4 -0
- package/src/templates/components/status-item/_examples.status-item.njk +1 -1
- package/src/templates/components/table/_examples.table.njk +21 -298
- package/src/templates/components/table/_template.table.njk +2 -2
- package/src/templates/components/table/params.table.yaml +4 -0
- package/src/templates/components/table-advanced/_examples.table-advanced.njk +4 -184
- package/src/templates/components/table-advanced/_template.table-advanced.njk +5 -2
- package/src/templates/components/textarea/_template.textarea.njk +0 -1
- package/src/templates/components/toggle/_examples.toggle.njk +12 -12
- package/src/templates/components/tooltip/_template.tooltip.njk +1 -1
- package/src/js/aria/HeaderNavigation.js +0 -55
|
@@ -68,10 +68,10 @@
|
|
|
68
68
|
{% endset %}
|
|
69
69
|
<div id="{{ params.id }}" class="lg:flex lg:flex-wrap lg:items-center lg:gap-base{%- if params.containerClasses %} {{ params.containerClasses }}{% endif %}">
|
|
70
70
|
{% if params.hasSelect %}
|
|
71
|
-
<p id="{{ params.id }}-label" class="w-full mb-xs text-sm text-neutral-dark">
|
|
72
|
-
Selecciona para cargar datos automáticamente
|
|
73
|
-
</p>
|
|
74
71
|
<nav {{- commonAttributes | safe }}>
|
|
72
|
+
<p id="{{ params.id }}-label" class="w-full mb-xs text-sm text-neutral-dark">
|
|
73
|
+
Selecciona para cargar datos automáticamente
|
|
74
|
+
</p>
|
|
75
75
|
{% if params.showFirst %}
|
|
76
76
|
{{ componentButton({
|
|
77
77
|
"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,
|
|
@@ -141,7 +141,7 @@
|
|
|
141
141
|
</nav>
|
|
142
142
|
{% endif %}
|
|
143
143
|
{% if params.itemsPerPageSelector %}
|
|
144
|
-
<div class="block relative -top-xs lg:ml-auto text-sm text-neutral-dark">
|
|
144
|
+
<div class="block relative -top-xs {%- if params.hasSelect %} lg:mt-8{% endif %} lg:ml-auto text-sm text-neutral-dark">
|
|
145
145
|
{{ componentSelect({
|
|
146
146
|
"id": "items-listbox-" + idPrefix,
|
|
147
147
|
"name": "items-listbox-" + idPrefix,
|
|
@@ -156,8 +156,8 @@
|
|
|
156
156
|
}) | indent(4) }}
|
|
157
157
|
</div>
|
|
158
158
|
{% endif %}
|
|
159
|
-
<p id="{{ params.idPrefix }}-status" class="block relative -top-xs lg:ml-auto text-sm text-neutral-dark" role="status" aria-live="polite">
|
|
160
|
-
<span class="sr-only">Posición de paginación: </span>{{ activePosition | int * params.itemsPerPage | int }} - {{ (activePosition | int + 1) * params.itemsPerPage | int }} de {{ params.totalItems }}
|
|
159
|
+
<p id="{{ params.idPrefix }}-status" class="block relative -top-xs {%- if params.hasSelect %} lg:mt-8{% endif %} lg:ml-auto text-sm text-neutral-dark" role="status" aria-live="polite">
|
|
160
|
+
<span class="sr-only">Posición de paginación: </span><span class="sr-only">resultados del </span>{{ activePosition | int * params.itemsPerPage | int }} <span aria-label="al">-</span> {{ (activePosition | int + 1) * params.itemsPerPage | int }} de {{ params.totalItems }}
|
|
161
161
|
</p>
|
|
162
162
|
</div>
|
|
163
163
|
<!-- /pagination -->
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"name": "con icono a la derecha",
|
|
60
60
|
"data": {
|
|
61
61
|
"type": "button",
|
|
62
|
-
"html": "Icono derecha pill <svg viewBox='0 0 140 140' class='self-center ml-2' role='img' aria-label='Eliminar' width='
|
|
62
|
+
"html": "Icono derecha pill <svg viewBox='0 0 140 140' class='self-center ml-2' role='img' aria-label='Eliminar' width='.75em ' height='.75em '><path fill='currentColor' d='M85.91 71.77a2.5 2.5 0 010-3.54l46.16-46.16a10 10 0 10-14.14-14.14L71.77 54.09a2.5 2.5 0 01-3.54 0L22.07 7.93A10 10 0 007.93 22.07l46.16 46.16a2.5 2.5 0 010 3.54L7.93 117.93a10 10 0 0014.14 14.14l46.16-46.16a2.5 2.5 0 013.54 0l46.16 46.16a10 10 0 0014.14-14.14z'/></svg>",
|
|
63
63
|
"classes": "cursor-pointer"
|
|
64
64
|
}
|
|
65
65
|
},
|
|
@@ -67,35 +67,35 @@
|
|
|
67
67
|
"name": "con icono a la izquierda",
|
|
68
68
|
"data": {
|
|
69
69
|
"type": "button",
|
|
70
|
-
"html": "<svg viewBox='0 0 140 140' class='
|
|
70
|
+
"html": "<svg viewBox='0 0 140 140' class='self-center mr-2' aria-hidden='true' width='.75em ' height='.75em '><path fill='currentColor' d='M35 35a35 35 0 1070 0 35 35 0 10-70 0zM132.78 133.33a66.59 66.59 0 00-125.56 0 5 5 0 004.71 6.67h116.14a5 5 0 004.71-6.67z' /></svg> Icono izquierda pill",
|
|
71
71
|
"classes": "cursor-pointer"
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
75
|
"name": "primario",
|
|
76
76
|
"data": {
|
|
77
|
-
"html": "<svg viewBox='0 0 140 140' class='
|
|
77
|
+
"html": "<svg viewBox='0 0 140 140' class='self-center mr-2' aria-hidden='true' width='.75em ' height='.75em '><path fill='currentColor' d='M43.7 140a17.42 17.42 0 01-12.36-5.12L5.13 108.66a17.49 17.49 0 010-24.75l24.61-24.25a7.5 7.5 0 0110.52 10.68L15.69 94.56a2.5 2.5 0 000 3.49l26.21 26.22a2.51 2.51 0 003.54 0l24.22-24.53a7.5 7.5 0 1110.68 10.52l-24.21 24.57A17.53 17.53 0 0143.7 140zM99.66 80.26a7.49 7.49 0 01.08-10.6l24.57-24.22a2.5 2.5 0 000-3.49L98.06 15.73a2.51 2.51 0 00-3.54 0L70.34 40.26a7.5 7.5 0 01-10.68-10.52L83.87 5.17a17.52 17.52 0 0124.79 0l26.21 26.21a17.49 17.49 0 010 24.75l-24.61 24.21a7.49 7.49 0 01-10.6-.08z'/><path fill='currentColor' d='M55 92.5a7.5 7.5 0 01-5.3-12.8l30-30a7.5 7.5 0 1110.6 10.6l-30 30a7.44 7.44 0 01-5.3 2.2z'/></svg> Primario",
|
|
78
78
|
"classes": "c-pill--primary"
|
|
79
79
|
}
|
|
80
80
|
},
|
|
81
81
|
{
|
|
82
82
|
"name": "Aviso",
|
|
83
83
|
"data": {
|
|
84
|
-
"html": "<svg viewBox='0 0 140 140' class='
|
|
84
|
+
"html": "<svg viewBox='0 0 140 140' class='self-center mr-2' aria-hidden='true' width='.75em' height='.75em '><path fill='currentColor' d='M138.42 118.29l-55-110a15 15 0 00-26.84 0l-55 110A15 15 0 0015 140h110a15 15 0 0013.42-21.71zM62.5 50a7.5 7.5 0 0115 0v30a7.5 7.5 0 01-15 0zm7.5 70a10 10 0 1110-10 10 10 0 01-10 10z'/></svg> Aviso",
|
|
85
85
|
"classes": "c-pill--warning"
|
|
86
86
|
}
|
|
87
87
|
},
|
|
88
88
|
{
|
|
89
89
|
"name": "Éxito",
|
|
90
90
|
"data": {
|
|
91
|
-
"html": "<svg viewBox='0 0 140 140' class='
|
|
91
|
+
"html": "<svg viewBox='0 0 140 140' class='self-center mr-2' aria-hidden='true' width='.75em ' height='.75em '><path fill='currentColor' d='M39.94 125a19.88 19.88 0 01-15.53-7.81L2.48 92.26a10 10 0 0115-13.2l20.55 23.39a2.5 2.5 0 003.68.08l81-84.42a10.002 10.002 0 1114.5 13.78l-82.02 86.33A19.41 19.41 0 0139.94 125z'/></svg> Éxito",
|
|
92
92
|
"classes": "c-pill--success"
|
|
93
93
|
}
|
|
94
94
|
},
|
|
95
95
|
{
|
|
96
96
|
"name": "alerta",
|
|
97
97
|
"data": {
|
|
98
|
-
"html": "<svg viewBox='0 0 140 140' class='
|
|
98
|
+
"html": "<svg viewBox='0 0 140 140' class='self-center mr-2' aria-hidden='true' width='.75em ' height='.75em '><path fill='currentColor' d='M70 0a70 70 0 1070 70A70.08 70.08 0 0070 0zm-7.5 35a7.5 7.5 0 0115 0v30a7.5 7.5 0 01-15 0zm7.5 75a10 10 0 1110-10 10 10 0 01-10 10z'/></svg> Alerta",
|
|
99
99
|
"classes": "c-pill--alert"
|
|
100
100
|
}
|
|
101
101
|
}
|
|
@@ -33,7 +33,6 @@
|
|
|
33
33
|
{% endif %}
|
|
34
34
|
{% if params.errorMessage %}
|
|
35
35
|
{% set errorId = idPrefix + '-error' %}
|
|
36
|
-
{% set describedBy = describedBy + ' ' + errorId if describedBy else errorId %}
|
|
37
36
|
{{ componentErrorMessage({
|
|
38
37
|
id: errorId,
|
|
39
38
|
classes: params.errorMessage.classes,
|
|
@@ -70,7 +69,7 @@
|
|
|
70
69
|
<div>
|
|
71
70
|
<div class="relative flex items-start py-base">
|
|
72
71
|
<div class="flex items-center mx-sm">
|
|
73
|
-
<input class="w-6 h-6 text-primary-base transition duration-150 ease-in-out border-black focus:border-black focus:
|
|
72
|
+
<input class="w-6 h-6 text-primary-base transition duration-150 ease-in-out border-black focus:border-black focus:outline-black focus:outline-1 focus:outline-offset-2 focus:ring-4 focus:ring-offset-0 focus:ring-warning-base disabled:bg-neutral-base disabled:border-neutral-base text-primary-base" id="{{ id }}" name="{{ params.name }}" type="radio" value="{{ item.value }}"
|
|
74
73
|
{{-" checked" if item.checked }}
|
|
75
74
|
{{-" disabled" if item.disabled }}
|
|
76
75
|
{%- if item.conditional.html %} data-aria-controls="{{ conditionalId }}"{% endif -%}
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
{% set describedBy = params.describedBy if params.describedBy else "" %}
|
|
6
6
|
{% if params.errorMessage %}
|
|
7
7
|
{% set errorId = params.id + '-error' %}
|
|
8
|
-
{% set describedBy = describedBy + " " + errorId if describedBy else errorId %}
|
|
9
8
|
{% endif %}
|
|
10
9
|
|
|
11
10
|
<!-- searchbar -->
|
|
@@ -27,9 +27,6 @@
|
|
|
27
27
|
text: params.hint.text
|
|
28
28
|
}) | indent(2) | trim }}
|
|
29
29
|
{% endif %}
|
|
30
|
-
{% if params.errorMessage %}
|
|
31
|
-
{% set describedBy = describedBy + ' ' + errorId if describedBy else errorId %}
|
|
32
|
-
{% endif %}
|
|
33
30
|
{% if params.errorMessage %}
|
|
34
31
|
{{ componentErrorMessage({
|
|
35
32
|
id: errorId,
|
|
@@ -138,6 +138,7 @@
|
|
|
138
138
|
},
|
|
139
139
|
{
|
|
140
140
|
"name": "tabla con caption visible",
|
|
141
|
+
"description": "Este ejemplo con caption visible se considera tabla compleja a nivel de accesibilidad. Así que tendría que tener una descripción con un details asociado a la tabla con el atributo aria-describedby.",
|
|
141
142
|
"data": {
|
|
142
143
|
"caption": "Caption 1: Meses y pagos",
|
|
143
144
|
"captionClasses": "mb-base font-bold text-left text-lg",
|
|
@@ -200,7 +201,7 @@
|
|
|
200
201
|
},
|
|
201
202
|
{
|
|
202
203
|
"name": "tabla con wrapper",
|
|
203
|
-
"description": "Usa el parámetro <code>wrapper</code> para rodear la tabla con un <code><div></code> y poder añadir clases, normalmente para hacer scroll horizontal en la tabla en anchuras pequeñas.",
|
|
204
|
+
"description": "Usa el parámetro <code>wrapper</code> para rodear la tabla con un <code><div></code> y poder añadir clases, normalmente para hacer scroll horizontal en la tabla en anchuras pequeñas. Por accesibilidad, parámetro wrapper necesitará los atributos: tabindex=0, role=section y un aria-label o aria-labelledby.",
|
|
204
205
|
"data": {
|
|
205
206
|
"caption": "Caption 1: Meses y pagos",
|
|
206
207
|
"captionClasses": "sticky left-0 top-0 w-0 mb-base font-bold text-left text-lg lg:whitespace-nowrap",
|
|
@@ -389,7 +390,12 @@
|
|
|
389
390
|
]
|
|
390
391
|
],
|
|
391
392
|
"wrapper": {
|
|
392
|
-
"classes": "relative overflow-x-auto pb-base"
|
|
393
|
+
"classes": "relative overflow-x-auto pb-base focus:outline-none focus:shadow-outline-black",
|
|
394
|
+
"attributes": {
|
|
395
|
+
"tabindex": "0",
|
|
396
|
+
"role": "region",
|
|
397
|
+
"aria-label": "Tabla con scroll del ejemplo Tabla con wrapper"
|
|
398
|
+
}
|
|
393
399
|
}
|
|
394
400
|
}
|
|
395
401
|
},
|
|
@@ -447,12 +453,17 @@
|
|
|
447
453
|
]
|
|
448
454
|
],
|
|
449
455
|
"wrapper": {
|
|
450
|
-
"classes": "relative overflow-x-auto pb-base"
|
|
456
|
+
"classes": "relative overflow-x-auto pb-base focus:outline-none focus:shadow-outline-black",
|
|
457
|
+
"attributes": {
|
|
458
|
+
"tabindex": "0",
|
|
459
|
+
"role": "region",
|
|
460
|
+
"aria-label": "Tabla con scroll del ejemplo Tabla no responsive"
|
|
461
|
+
}
|
|
451
462
|
}
|
|
452
463
|
}
|
|
453
464
|
},
|
|
454
465
|
{
|
|
455
|
-
"name": "
|
|
466
|
+
"name": "tabla con columnas sticky",
|
|
456
467
|
"description": "En este ejemplo la primera y última columna se mantienen fijas y el resto hacen scroll horizontal si la anchura es pequeña.",
|
|
457
468
|
"data": {
|
|
458
469
|
"caption": "Caption 1: Meses y pagos",
|
|
@@ -645,302 +656,14 @@
|
|
|
645
656
|
]
|
|
646
657
|
],
|
|
647
658
|
"wrapper": {
|
|
648
|
-
"classes": "overflow-x-auto pb-base"
|
|
659
|
+
"classes": "overflow-x-auto pb-base focus:outline-none focus:shadow-outline-black",
|
|
660
|
+
"attributes": {
|
|
661
|
+
"tabindex": "0",
|
|
662
|
+
"role": "region",
|
|
663
|
+
"aria-label": "Tabla con scroll del ejemplo Tabla con columnas sticky"
|
|
664
|
+
}
|
|
649
665
|
},
|
|
650
666
|
"classes": "relative lg:whitespace-nowrap"
|
|
651
667
|
}
|
|
652
|
-
},
|
|
653
|
-
{
|
|
654
|
-
"name": "classes",
|
|
655
|
-
"hidden": true,
|
|
656
|
-
"data": {
|
|
657
|
-
"classes": "bg-primary-light"
|
|
658
|
-
}
|
|
659
|
-
},
|
|
660
|
-
{
|
|
661
|
-
"name": "atributos",
|
|
662
|
-
"hidden": true,
|
|
663
|
-
"data": {
|
|
664
|
-
"attributes": {
|
|
665
|
-
"data-foo": "bar"
|
|
666
|
-
}
|
|
667
|
-
}
|
|
668
|
-
},
|
|
669
|
-
{
|
|
670
|
-
"name": "html como texto",
|
|
671
|
-
"hidden": true,
|
|
672
|
-
"data": {
|
|
673
|
-
"head": [
|
|
674
|
-
{
|
|
675
|
-
"text": "Foo <strong>bar</strong>"
|
|
676
|
-
}
|
|
677
|
-
],
|
|
678
|
-
"rows": [
|
|
679
|
-
[
|
|
680
|
-
{
|
|
681
|
-
"text": "Foo <strong>bar</strong>"
|
|
682
|
-
}
|
|
683
|
-
]
|
|
684
|
-
]
|
|
685
|
-
}
|
|
686
|
-
},
|
|
687
|
-
{
|
|
688
|
-
"name": "html",
|
|
689
|
-
"hidden": true,
|
|
690
|
-
"data": {
|
|
691
|
-
"head": [
|
|
692
|
-
{
|
|
693
|
-
"html": "Foo <strong>bar</strong>"
|
|
694
|
-
}
|
|
695
|
-
],
|
|
696
|
-
"rows": [
|
|
697
|
-
[
|
|
698
|
-
{
|
|
699
|
-
"html": "Foo <strong>bar</strong>"
|
|
700
|
-
}
|
|
701
|
-
]
|
|
702
|
-
]
|
|
703
|
-
}
|
|
704
|
-
},
|
|
705
|
-
{
|
|
706
|
-
"name": "head con clases",
|
|
707
|
-
"hidden": true,
|
|
708
|
-
"data": {
|
|
709
|
-
"head": [
|
|
710
|
-
{
|
|
711
|
-
"text": "Foo",
|
|
712
|
-
"classes": "bg-primary-light"
|
|
713
|
-
}
|
|
714
|
-
]
|
|
715
|
-
}
|
|
716
|
-
},
|
|
717
|
-
{
|
|
718
|
-
"name": "head con rowspan y colspan",
|
|
719
|
-
"hidden": true,
|
|
720
|
-
"data": {
|
|
721
|
-
"head": [
|
|
722
|
-
{
|
|
723
|
-
"text": "Foo",
|
|
724
|
-
"rowspan": 1,
|
|
725
|
-
"colspan": 1
|
|
726
|
-
}
|
|
727
|
-
]
|
|
728
|
-
}
|
|
729
|
-
},
|
|
730
|
-
{
|
|
731
|
-
"name": "head con atributos",
|
|
732
|
-
"hidden": true,
|
|
733
|
-
"data": {
|
|
734
|
-
"head": [
|
|
735
|
-
{
|
|
736
|
-
"attributes": {
|
|
737
|
-
"data-fizz": "buzz"
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
]
|
|
741
|
-
}
|
|
742
|
-
},
|
|
743
|
-
{
|
|
744
|
-
"name": "con firstCellIsHeader true",
|
|
745
|
-
"hidden": true,
|
|
746
|
-
"data": {
|
|
747
|
-
"firstCellIsHeader": true,
|
|
748
|
-
"rows": [
|
|
749
|
-
[
|
|
750
|
-
{
|
|
751
|
-
"text": "Enero"
|
|
752
|
-
},
|
|
753
|
-
{
|
|
754
|
-
"text": "85€",
|
|
755
|
-
"classes": "lg:text-right"
|
|
756
|
-
},
|
|
757
|
-
{
|
|
758
|
-
"text": "95€",
|
|
759
|
-
"classes": "lg:text-right"
|
|
760
|
-
}
|
|
761
|
-
],
|
|
762
|
-
[
|
|
763
|
-
{
|
|
764
|
-
"text": "Febrero"
|
|
765
|
-
},
|
|
766
|
-
{
|
|
767
|
-
"text": "75€",
|
|
768
|
-
"classes": "lg:text-right"
|
|
769
|
-
},
|
|
770
|
-
{
|
|
771
|
-
"text": "55€",
|
|
772
|
-
"classes": "lg:text-right"
|
|
773
|
-
}
|
|
774
|
-
],
|
|
775
|
-
[
|
|
776
|
-
{
|
|
777
|
-
"text": "Marzo"
|
|
778
|
-
},
|
|
779
|
-
{
|
|
780
|
-
"text": "165€",
|
|
781
|
-
"classes": "lg:text-right"
|
|
782
|
-
},
|
|
783
|
-
{
|
|
784
|
-
"text": "125€",
|
|
785
|
-
"classes": "lg:text-right"
|
|
786
|
-
}
|
|
787
|
-
]
|
|
788
|
-
]
|
|
789
|
-
}
|
|
790
|
-
},
|
|
791
|
-
{
|
|
792
|
-
"name": "firstCellIsHeader con clases",
|
|
793
|
-
"hidden": true,
|
|
794
|
-
"data": {
|
|
795
|
-
"firstCellIsHeader": true,
|
|
796
|
-
"rows": [
|
|
797
|
-
[
|
|
798
|
-
{
|
|
799
|
-
"text": "Foo",
|
|
800
|
-
"classes": "bg-primary-light"
|
|
801
|
-
}
|
|
802
|
-
]
|
|
803
|
-
]
|
|
804
|
-
}
|
|
805
|
-
},
|
|
806
|
-
{
|
|
807
|
-
"name": "firstCellIsHeader con html",
|
|
808
|
-
"hidden": true,
|
|
809
|
-
"data": {
|
|
810
|
-
"firstCellIsHeader": true,
|
|
811
|
-
"rows": [
|
|
812
|
-
[
|
|
813
|
-
{
|
|
814
|
-
"html": "Foo <strong>bar</strong>"
|
|
815
|
-
}
|
|
816
|
-
]
|
|
817
|
-
]
|
|
818
|
-
}
|
|
819
|
-
},
|
|
820
|
-
{
|
|
821
|
-
"name": "firstCellIsHeader con html como texto",
|
|
822
|
-
"hidden": true,
|
|
823
|
-
"data": {
|
|
824
|
-
"firstCellIsHeader": true,
|
|
825
|
-
"rows": [
|
|
826
|
-
[
|
|
827
|
-
{
|
|
828
|
-
"text": "Foo <strong>bar</strong>"
|
|
829
|
-
}
|
|
830
|
-
]
|
|
831
|
-
]
|
|
832
|
-
}
|
|
833
|
-
},
|
|
834
|
-
{
|
|
835
|
-
"name": "firstCellIsHeader con rowspan y colspan",
|
|
836
|
-
"hidden": true,
|
|
837
|
-
"data": {
|
|
838
|
-
"firstCellIsHeader": true,
|
|
839
|
-
"rows": [
|
|
840
|
-
[
|
|
841
|
-
{
|
|
842
|
-
"text": "Foo",
|
|
843
|
-
"rowspan": 1,
|
|
844
|
-
"colspan": 1
|
|
845
|
-
}
|
|
846
|
-
]
|
|
847
|
-
]
|
|
848
|
-
}
|
|
849
|
-
},
|
|
850
|
-
{
|
|
851
|
-
"name": "firstCellIsHeader con atributos",
|
|
852
|
-
"hidden": true,
|
|
853
|
-
"data": {
|
|
854
|
-
"firstCellIsHeader": true,
|
|
855
|
-
"rows": [
|
|
856
|
-
[
|
|
857
|
-
{
|
|
858
|
-
"text": "Foo",
|
|
859
|
-
"attributes": {
|
|
860
|
-
"data-fizz": "buzz"
|
|
861
|
-
}
|
|
862
|
-
}
|
|
863
|
-
]
|
|
864
|
-
]
|
|
865
|
-
}
|
|
866
|
-
},
|
|
867
|
-
{
|
|
868
|
-
"name": "con items falsos",
|
|
869
|
-
"hidden": true,
|
|
870
|
-
"data": {
|
|
871
|
-
"rows": [
|
|
872
|
-
[
|
|
873
|
-
{
|
|
874
|
-
"text": "A"
|
|
875
|
-
},
|
|
876
|
-
{
|
|
877
|
-
"text": 1
|
|
878
|
-
}
|
|
879
|
-
],
|
|
880
|
-
false,
|
|
881
|
-
null,
|
|
882
|
-
[
|
|
883
|
-
{
|
|
884
|
-
"text": "B"
|
|
885
|
-
},
|
|
886
|
-
{
|
|
887
|
-
"text": 2
|
|
888
|
-
}
|
|
889
|
-
],
|
|
890
|
-
[
|
|
891
|
-
{
|
|
892
|
-
"text": "C"
|
|
893
|
-
},
|
|
894
|
-
{
|
|
895
|
-
"text": 3
|
|
896
|
-
}
|
|
897
|
-
]
|
|
898
|
-
]
|
|
899
|
-
}
|
|
900
|
-
},
|
|
901
|
-
{
|
|
902
|
-
"name": "filas con clases",
|
|
903
|
-
"hidden": true,
|
|
904
|
-
"data": {
|
|
905
|
-
"rows": [
|
|
906
|
-
[
|
|
907
|
-
{
|
|
908
|
-
"text": "Foo",
|
|
909
|
-
"classes": "bg-primary-light"
|
|
910
|
-
}
|
|
911
|
-
]
|
|
912
|
-
]
|
|
913
|
-
}
|
|
914
|
-
},
|
|
915
|
-
{
|
|
916
|
-
"name": "filas con rowspan y colspan",
|
|
917
|
-
"hidden": true,
|
|
918
|
-
"data": {
|
|
919
|
-
"rows": [
|
|
920
|
-
[
|
|
921
|
-
{
|
|
922
|
-
"text": "Foo",
|
|
923
|
-
"rowspan": 1,
|
|
924
|
-
"colspan": 1
|
|
925
|
-
}
|
|
926
|
-
]
|
|
927
|
-
]
|
|
928
|
-
}
|
|
929
|
-
},
|
|
930
|
-
{
|
|
931
|
-
"name": "filas con atributos",
|
|
932
|
-
"hidden": true,
|
|
933
|
-
"data": {
|
|
934
|
-
"rows": [
|
|
935
|
-
[
|
|
936
|
-
{
|
|
937
|
-
"text": "Foo",
|
|
938
|
-
"attributes": {
|
|
939
|
-
"data-fizz": "buzz"
|
|
940
|
-
}
|
|
941
|
-
}
|
|
942
|
-
]
|
|
943
|
-
]
|
|
944
|
-
}
|
|
945
668
|
}
|
|
946
669
|
] %}
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
<tfoot>
|
|
48
48
|
<tr class="border-t-2 border-b border-neutral-base">
|
|
49
49
|
{% for item in params.foot %}
|
|
50
|
-
<td
|
|
50
|
+
<td class="block lg:table-cell text-left before:block before:text-neutral-dark before:lg:hidden before:content-[attr(data-label)] before:text-sm px-base py-sm {%- if item.classes %} {{ item.classes }}{% endif %}"
|
|
51
51
|
{%- if item.colspan %} colspan="{{ item.colspan }}"{% endif %}
|
|
52
52
|
{%- if item.rowspan %} rowspan="{{ item.rowspan }}"{% endif %}{% for attribute, value in item.attributes %} {{ attribute }}="{{ value }}"{% endfor %} data-label="{{ headArray[loop.index0] }}">{{ item.html |safe if item.html else item.text }}</td>
|
|
53
53
|
{% endfor %}
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
|
|
61
61
|
<!-- table -->
|
|
62
62
|
{% if params.wrapper %}
|
|
63
|
-
<div {%- if params.wrapper.classes %} class="{{ params.wrapper.classes }}"{% endif %}>
|
|
63
|
+
<div {%- if params.wrapper.classes %} class="{{ params.wrapper.classes }}"{% endif %} {% for attribute, value in params.wrapper.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>
|
|
64
64
|
{{ innerHtml | trim | safe }}
|
|
65
65
|
</div>
|
|
66
66
|
{% else %}
|
|
@@ -107,6 +107,10 @@ params:
|
|
|
107
107
|
type: string
|
|
108
108
|
required: false
|
|
109
109
|
description: Classes to add to the wrapper (e.g. to show an horizontal scrollbar it there are many columns or in mobile)
|
|
110
|
+
- name: attributes
|
|
111
|
+
type: object
|
|
112
|
+
required: false
|
|
113
|
+
description: HTML attributes to add to the wrapper div. For accessibility it needs tabindex=0, role=section and aria-label or aria-labelledby.
|
|
110
114
|
- name: classes
|
|
111
115
|
type: string
|
|
112
116
|
required: false
|