desy-html 13.0.1 → 14.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 +5 -0
- package/docs/_macro.example-render.njk +5 -0
- package/docs/componentes.html +3 -0
- package/docs/ds/_ds.example.checkboxes.njk +1 -1
- package/docs/ds/_ds.example.date-input.njk +3 -3
- package/docs/ds/_ds.example.file-upload.njk +1 -1
- package/docs/ds/_ds.example.input-group.njk +1 -1
- package/docs/ds/_ds.example.input.njk +5 -5
- package/docs/ds/_ds.example.radios.njk +1 -1
- package/docs/ds/_ds.example.searchbar.njk +1 -1
- package/docs/ds/_ds.example.select.njk +5 -5
- package/docs/ds/_ds.example.textarea.njk +7 -7
- package/docs/examples-treegrid.html +8 -0
- package/docs/index.html +8 -0
- package/gulpfile.js +15 -1
- package/package.json +2 -1
- package/src/css/styles.css +1 -0
- package/src/js/aria/MenuNavigation.js +12 -3
- package/src/js/aria/tree.js +320 -31
- package/src/js/aria/treegrid.js +508 -0
- package/src/js/aria/treeitem.js +25 -19
- package/src/js/desy-html.js +37 -31
- package/src/js/index.js +12 -10
- package/src/templates/components/character-count/_examples.character-count.njk +3 -15
- package/src/templates/components/checkboxes/_examples.checkboxes.njk +67 -86
- package/src/templates/components/date-input/_examples.date-input.njk +15 -15
- package/src/templates/components/datepicker/_examples.datepicker.njk +7 -6
- package/src/templates/components/datepicker/_template.datepicker.njk +0 -1
- package/src/templates/components/description-list/_examples.description-list.njk +2 -2
- package/src/templates/components/dialog/_examples.dialog.njk +2 -2
- package/src/templates/components/dropdown/_examples.dropdown.njk +3 -3
- package/src/templates/components/error-message/_examples.error-message.njk +4 -2
- package/src/templates/components/error-summary/params.error-summary.yaml +0 -3
- package/src/templates/components/fieldset/_examples.fieldset.njk +2 -29
- package/src/templates/components/file-upload/_examples.file-upload.njk +4 -15
- package/src/templates/components/header-advanced/_template.header-advanced.njk +1 -0
- package/src/templates/components/hint/params.hint.yaml +0 -14
- package/src/templates/components/input/_examples.input.njk +9 -45
- package/src/templates/components/input-group/_examples.input-group.njk +19 -18
- package/src/templates/components/item/_examples.item.njk +1 -0
- package/src/templates/components/media-object/_examples.media-object.njk +6 -5
- package/src/templates/components/menubar/_template.menubar.njk +2 -2
- package/src/templates/components/menubar/params.menubar.yaml +0 -10
- package/src/templates/components/modal/_examples.modal.njk +1 -1
- package/src/templates/components/notification/_examples.notification.njk +8 -2
- package/src/templates/components/pill/_examples.pill.njk +2 -1
- package/src/templates/components/radios/_examples.radios.njk +56 -91
- package/src/templates/components/searchbar/_examples.searchbar.njk +2 -1
- package/src/templates/components/select/_examples.select.njk +3 -29
- package/src/templates/components/status-item/_examples.status-item.njk +1 -0
- package/src/templates/components/table-advanced/params.table-advanced.yaml +1 -1
- package/src/templates/components/textarea/_examples.textarea.njk +3 -14
- package/src/templates/components/tree/_examples.tree.njk +157 -3
- package/src/templates/components/tree/_template.tree.njk +112 -101
- package/src/templates/components/tree/params.tree.yaml +4 -0
- package/src/templates/components/treegrid/_examples.treegrid.njk +1240 -0
- package/src/templates/components/treegrid/_macro.treegrid.njk +3 -0
- package/src/templates/components/treegrid/_styles.treegrid.css +39 -0
- package/src/templates/components/treegrid/_template.treegrid.njk +91 -0
- package/src/templates/components/treegrid/params.treegrid.yaml +132 -0
package/src/js/desy-html.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { utils, formatDateToDDMMYYYY, convertToISOFormat } from './aria/utils.js';
|
|
2
1
|
import { accordion } from './aria/accordion.js';
|
|
2
|
+
import { alert } from './aria/alert.js';
|
|
3
|
+
import { CheckBox } from './aria/checkBoxes.js';
|
|
4
|
+
import { Collapsible } from './aria/collapsible.js';
|
|
3
5
|
import { dataGrid } from './aria/dataGrid.js';
|
|
4
6
|
import { dialog } from './aria/dialog.js';
|
|
5
|
-
import { tabs } from './aria/tabs.js';
|
|
6
|
-
import { PopupMenuItemAction } from './aria/PopupMenuItemAction.js';
|
|
7
|
-
import { PopupMenuAction } from './aria/PopupMenuAction.js';
|
|
8
|
-
import { MenubarItemAction } from './aria/MenubarItemAction.js';
|
|
9
|
-
import { MenubarAction } from './aria/MenubarAction.js';
|
|
10
|
-
import { listbox } from './aria/listbox.js';
|
|
11
7
|
import { LinksList } from './aria/linksList.js';
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { Toggle } from './aria/toggle.js';
|
|
16
|
-
import { Collapsible } from './aria/collapsible.js';
|
|
17
|
-
import { Notification } from './aria/notification.js';
|
|
18
|
-
import { RadioButton } from './aria/radioButton.js';
|
|
19
|
-
import { CheckBox } from './aria/checkBoxes.js';
|
|
20
|
-
import { MenuVertical } from './aria/MenuVertical.js';
|
|
8
|
+
import { listbox } from './aria/listbox.js';
|
|
9
|
+
import { MenubarAction } from './aria/MenubarAction.js';
|
|
10
|
+
import { MenubarItemAction } from './aria/MenubarItemAction.js';
|
|
21
11
|
import { MenuHorizontal } from './aria/MenuHorizontal.js';
|
|
22
12
|
import { MenuNavigation } from './aria/MenuNavigation.js';
|
|
13
|
+
import { MenuVertical } from './aria/MenuVertical.js';
|
|
23
14
|
import { Nav } from './aria/Nav.js';
|
|
24
|
-
|
|
15
|
+
import { Notification } from './aria/notification.js';
|
|
16
|
+
import { PopupMenuAction } from './aria/PopupMenuAction.js';
|
|
17
|
+
import { PopupMenuItemAction } from './aria/PopupMenuItemAction.js';
|
|
18
|
+
import { RadioButton } from './aria/radioButton.js';
|
|
19
|
+
import { tabs } from './aria/tabs.js';
|
|
20
|
+
import { Toggle } from './aria/toggle.js';
|
|
21
|
+
import { Tree } from './aria/tree.js';
|
|
22
|
+
import { TreeGrid } from './aria/treegrid.js';
|
|
23
|
+
import { Treeitem } from './aria/treeitem.js';
|
|
24
|
+
import { convertToISOFormat, formatDateToDDMMYYYY, utils } from './aria/utils.js';
|
|
25
25
|
export function accordionComponent(aria) {
|
|
26
26
|
accordion(aria);
|
|
27
27
|
}
|
|
@@ -54,14 +54,14 @@ export function dropdownComponent(aria) {
|
|
|
54
54
|
const moduleValue = modules[item].getAttribute('data-module');
|
|
55
55
|
|
|
56
56
|
|
|
57
|
-
if (moduleValue == 'c-dropdown'){
|
|
57
|
+
if (moduleValue == 'c-dropdown') {
|
|
58
58
|
const buttonDropdown = modules[item].querySelector('[data-module = "c-dropdown-button"]');
|
|
59
59
|
const tooltip = modules[item].querySelector('[data-module = "c-dropdown-tooltip"]');
|
|
60
60
|
const roleCustom = buttonDropdown.getAttribute('data-role');
|
|
61
61
|
const ariaLabel = buttonDropdown.getAttribute('data-aria-label');
|
|
62
62
|
const ariaModal = buttonDropdown.getAttribute('data-aria-modal');
|
|
63
63
|
const ariaHasPopup = buttonDropdown.getAttribute('data-aria-haspopup');
|
|
64
|
-
if(buttonDropdown && tooltip) {
|
|
64
|
+
if (buttonDropdown && tooltip) {
|
|
65
65
|
const hideOnPopperBlur = {
|
|
66
66
|
/* https://atomiks.github.io/tippyjs/v6/plugins/#hideonpopperblur */
|
|
67
67
|
name: 'hideOnPopperBlur',
|
|
@@ -73,7 +73,7 @@ export function dropdownComponent(aria) {
|
|
|
73
73
|
if (
|
|
74
74
|
instance.props.hideOnPopperBlur &&
|
|
75
75
|
event.relatedTarget &&
|
|
76
|
-
!instance.popper.contains(event.relatedTarget)
|
|
76
|
+
!instance.popper.contains(event.relatedTarget) &&
|
|
77
77
|
event.relatedTarget !== instance.reference
|
|
78
78
|
) {
|
|
79
79
|
instance.hide();
|
|
@@ -87,7 +87,7 @@ export function dropdownComponent(aria) {
|
|
|
87
87
|
/* https://atomiks.github.io/tippyjs/v6/plugins/#hideonesc */
|
|
88
88
|
name: 'hideOnEsc',
|
|
89
89
|
defaultValue: true,
|
|
90
|
-
fn({hide}) {
|
|
90
|
+
fn({ hide }) {
|
|
91
91
|
function onKeyDown(event) {
|
|
92
92
|
if (event.keyCode === 27) {
|
|
93
93
|
hide();
|
|
@@ -117,22 +117,22 @@ export function dropdownComponent(aria) {
|
|
|
117
117
|
arrow: false,
|
|
118
118
|
offset: [0, -10],
|
|
119
119
|
theme: '',
|
|
120
|
-
plugins: [hideOnEsc,hideOnPopperBlur],
|
|
120
|
+
plugins: [hideOnEsc, hideOnPopperBlur],
|
|
121
121
|
role: roleCustom ? roleCustom : false,
|
|
122
122
|
aria: {
|
|
123
123
|
content: 'auto'
|
|
124
124
|
},
|
|
125
125
|
onCreate(instance) {
|
|
126
|
-
if(ariaHasPopup){
|
|
126
|
+
if (ariaHasPopup) {
|
|
127
127
|
instance.reference.setAttribute('aria-haspopup', ariaHasPopup);
|
|
128
128
|
}
|
|
129
129
|
},
|
|
130
130
|
onShown(instance) {
|
|
131
131
|
aria.Utils.focusFirstDescendant(tooltip);
|
|
132
|
-
if(ariaLabel){
|
|
132
|
+
if (ariaLabel) {
|
|
133
133
|
instance.popper.firstElementChild.setAttribute('aria-label', ariaLabel);
|
|
134
134
|
}
|
|
135
|
-
if(ariaModal){
|
|
135
|
+
if (ariaModal) {
|
|
136
136
|
instance.popper.firstElementChild.setAttribute('aria-modal', ariaModal);
|
|
137
137
|
}
|
|
138
138
|
}
|
|
@@ -244,7 +244,7 @@ export function listboxComponent(aria) {
|
|
|
244
244
|
}
|
|
245
245
|
});
|
|
246
246
|
|
|
247
|
-
listbox.setHandleFocusChange(function(evt) {
|
|
247
|
+
listbox.setHandleFocusChange(function (evt) {
|
|
248
248
|
if ((!list.hasAttribute('aria-multiselectable')) && (buttonListbox.getAttribute('data-change') == 'change')) {
|
|
249
249
|
buttonListbox.firstElementChild.innerHTML = evt.innerHTML;
|
|
250
250
|
}
|
|
@@ -390,7 +390,7 @@ export function treeComponent(aria) {
|
|
|
390
390
|
}
|
|
391
391
|
|
|
392
392
|
if (moduleValue == 'c-tree__item') {
|
|
393
|
-
modules[item].addEventListener('click', function(event) {
|
|
393
|
+
modules[item].addEventListener('click', function (event) {
|
|
394
394
|
event.stopPropagation();
|
|
395
395
|
});
|
|
396
396
|
}
|
|
@@ -485,7 +485,7 @@ export function DatepickerComponent(aria) {
|
|
|
485
485
|
}
|
|
486
486
|
|
|
487
487
|
if (datepickerSelect != undefined) {
|
|
488
|
-
datepickerSelect.addEventListener('change', function() {
|
|
488
|
+
datepickerSelect.addEventListener('change', function () {
|
|
489
489
|
const selectedValue = this.value;
|
|
490
490
|
datepickerCalendar.min = selectedValue + "-01-01";
|
|
491
491
|
datepickerCalendar.max = selectedValue + "-12-31";
|
|
@@ -498,7 +498,7 @@ export function DatepickerComponent(aria) {
|
|
|
498
498
|
const datepickerSubmit = module.querySelector('#' + dropdownId + '-submit');
|
|
499
499
|
|
|
500
500
|
if (datepickerCancel != undefined) {
|
|
501
|
-
datepickerCancel.onclick = function() {
|
|
501
|
+
datepickerCancel.onclick = function () {
|
|
502
502
|
// Restore values according to original format
|
|
503
503
|
if (storedInitialFormat === 'iso') {
|
|
504
504
|
datepickerCalendar.value = storedInitialValue;
|
|
@@ -514,7 +514,7 @@ export function DatepickerComponent(aria) {
|
|
|
514
514
|
}
|
|
515
515
|
|
|
516
516
|
if (datepickerSubmit != undefined) {
|
|
517
|
-
datepickerSubmit.onclick = function() {
|
|
517
|
+
datepickerSubmit.onclick = function () {
|
|
518
518
|
// On submit, clear stored value for next opening
|
|
519
519
|
storedInitialValue = '';
|
|
520
520
|
storedInitialFormat = '';
|
|
@@ -552,7 +552,7 @@ export function DatepickerComponent(aria) {
|
|
|
552
552
|
const datepickerSelect = module.querySelector(':is(select)');
|
|
553
553
|
const datepickerCalendar = module.querySelector(':is(calendar-date, calendar-multi, calendar-range)');
|
|
554
554
|
if (datepickerSelect != undefined) {
|
|
555
|
-
datepickerSelect.addEventListener('change', function() {
|
|
555
|
+
datepickerSelect.addEventListener('change', function () {
|
|
556
556
|
const selectedValue = this.value;
|
|
557
557
|
datepickerCalendar.min = selectedValue + "-01-01";
|
|
558
558
|
datepickerCalendar.max = selectedValue + "-12-31";
|
|
@@ -561,4 +561,10 @@ export function DatepickerComponent(aria) {
|
|
|
561
561
|
}
|
|
562
562
|
}
|
|
563
563
|
});
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
export function TreegridComponent(aria) {
|
|
567
|
+
const doAllowRowFocus = true;
|
|
568
|
+
const doStartRowFocus = true;
|
|
569
|
+
document.querySelectorAll('[data-module="c-treegrid"]').forEach((treegridEl) => TreeGrid(treegridEl, doAllowRowFocus, doStartRowFocus));
|
|
564
570
|
}
|
package/src/js/index.js
CHANGED
|
@@ -6,25 +6,26 @@
|
|
|
6
6
|
import {
|
|
7
7
|
accordionComponent,
|
|
8
8
|
alertComponent,
|
|
9
|
+
checkBoxComponent,
|
|
9
10
|
collapsibleComponent,
|
|
11
|
+
DatepickerComponent,
|
|
10
12
|
dialogComponent,
|
|
11
13
|
dropdownComponent,
|
|
12
|
-
listboxComponent,
|
|
13
14
|
linksListComponent,
|
|
15
|
+
listboxComponent,
|
|
14
16
|
menubarComponent,
|
|
17
|
+
MenuHorizontalComponent,
|
|
18
|
+
MenuNavigationComponent,
|
|
19
|
+
MenuVerticalComponent,
|
|
20
|
+
NavComponent,
|
|
21
|
+
notificationComponent,
|
|
22
|
+
radioButtonComponent,
|
|
15
23
|
tableAdvancedComponent,
|
|
16
24
|
tabsComponent,
|
|
17
|
-
tooltipComponent,
|
|
18
25
|
toggleComponent,
|
|
26
|
+
tooltipComponent,
|
|
19
27
|
treeComponent,
|
|
20
|
-
|
|
21
|
-
radioButtonComponent,
|
|
22
|
-
checkBoxComponent,
|
|
23
|
-
MenuVerticalComponent,
|
|
24
|
-
MenuHorizontalComponent,
|
|
25
|
-
MenuNavigationComponent,
|
|
26
|
-
NavComponent,
|
|
27
|
-
DatepickerComponent
|
|
28
|
+
TreegridComponent
|
|
28
29
|
} from './desy-html.js';
|
|
29
30
|
|
|
30
31
|
var aria = aria || {};
|
|
@@ -50,6 +51,7 @@ MenuHorizontalComponent(aria);
|
|
|
50
51
|
MenuNavigationComponent(aria);
|
|
51
52
|
NavComponent(aria);
|
|
52
53
|
DatepickerComponent(aria);
|
|
54
|
+
TreegridComponent(aria);
|
|
53
55
|
|
|
54
56
|
//Using the browser API to copy code to the clipboard
|
|
55
57
|
const copyButtons = document.querySelectorAll('[data-module = "c-button-copy"]');
|
|
@@ -63,6 +63,7 @@
|
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
65
|
"name": "con valor por defecto excediendo el límite",
|
|
66
|
+
"description": "Por accesibilidad, los mensajes de error deben incluir la palabra \"error\", para que no recaiga tan sólo en el color el hecho de que es un mensaje de error.",
|
|
66
67
|
"data": {
|
|
67
68
|
"id": "exceeding-characters",
|
|
68
69
|
"name": "exceeding",
|
|
@@ -72,7 +73,7 @@
|
|
|
72
73
|
"text": "Dirección completa"
|
|
73
74
|
},
|
|
74
75
|
"errorMessage": {
|
|
75
|
-
"text": "
|
|
76
|
+
"text": "Por favor, no exceder el límite máximo. Error en el campo."
|
|
76
77
|
}
|
|
77
78
|
}
|
|
78
79
|
},
|
|
@@ -88,19 +89,6 @@
|
|
|
88
89
|
"rows": 8
|
|
89
90
|
}
|
|
90
91
|
},
|
|
91
|
-
{
|
|
92
|
-
"name": "con label como encabezado",
|
|
93
|
-
"description": "Utiliza el parámetro <code>'isPageheading': true</code> para que el label esté dentro de un encabezado. Usa el parámetro <code>'headingLevel'</code> para establecer el nivel del encabezado. Por ejemplo: <code>'headingLevel': 3</code> creará un encabezado <code><h3></code>. Si no se establece un <code>'headingLevel'</code>, por defecto usará un <code><h1></code>.",
|
|
94
|
-
"data": {
|
|
95
|
-
"id": "textarea-with-page-heading",
|
|
96
|
-
"name": "address",
|
|
97
|
-
"maxlength": 250,
|
|
98
|
-
"label": {
|
|
99
|
-
"text": "Esto es un label dentro de un encabezado <h1>",
|
|
100
|
-
"isPageHeading": true
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
92
|
{
|
|
105
93
|
"name": "con contador de palabras",
|
|
106
94
|
"data": {
|
|
@@ -139,7 +127,7 @@
|
|
|
139
127
|
"name": "classes-applied-b",
|
|
140
128
|
"maxlength": 250,
|
|
141
129
|
"errorMessage": {
|
|
142
|
-
"text": "
|
|
130
|
+
"text": "Esto es un mensaje de error",
|
|
143
131
|
"classes": "order-1 w-full pt-sm"
|
|
144
132
|
},
|
|
145
133
|
"classes": "lg:flex-1"
|
|
@@ -1,37 +1,65 @@
|
|
|
1
1
|
{% from "components/checkboxes/_macro.checkboxes.njk" import componentCheckboxes %}
|
|
2
|
+
{% from "components/fieldset/_macro.fieldset.njk" import componentFieldset %}
|
|
2
3
|
{% from "components/input/_macro.input.njk" import componentInput %}
|
|
3
4
|
|
|
4
5
|
{% macro telefonoContent(id='id') %}
|
|
5
|
-
{
|
|
6
|
-
"
|
|
7
|
-
"text": "
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
{% call componentFieldset({
|
|
7
|
+
"legend": {
|
|
8
|
+
"text": "¿Cuál es tu número de teléfono fijo?",
|
|
9
|
+
"classes": "mb-sm sr-only"
|
|
10
|
+
}
|
|
11
|
+
}) %}
|
|
12
|
+
<div class="c-form-group">
|
|
13
|
+
{{ componentInput({
|
|
14
|
+
"label": {
|
|
15
|
+
"text": "Número de teléfono fijo"
|
|
16
|
+
},
|
|
17
|
+
"id": "telefono-" + id,
|
|
18
|
+
"name": "telefono-name-" + id
|
|
19
|
+
}) }}
|
|
20
|
+
</div>
|
|
21
|
+
{% endcall %}
|
|
12
22
|
{% endmacro %}
|
|
13
23
|
|
|
14
24
|
{% macro mobileContent(id='id') %}
|
|
15
|
-
{
|
|
16
|
-
"
|
|
17
|
-
"text": "
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
25
|
+
{% call componentFieldset({
|
|
26
|
+
"legend": {
|
|
27
|
+
"text": "¿Cuál es tu número de teléfono móvil?",
|
|
28
|
+
"classes": "mb-sm sr-only"
|
|
29
|
+
}
|
|
30
|
+
}) %}
|
|
31
|
+
<div class="c-form-group">
|
|
32
|
+
{{ componentInput({
|
|
33
|
+
"label": {
|
|
34
|
+
"text": "Número de teléfono móvil"
|
|
35
|
+
},
|
|
36
|
+
"id": "mobile-" + id,
|
|
37
|
+
"name": "mobile-name-" + id
|
|
38
|
+
}) }}
|
|
39
|
+
</div>
|
|
40
|
+
{% endcall %}
|
|
22
41
|
{% endmacro %}
|
|
23
42
|
|
|
24
43
|
{% macro mobileErrorContent(id='id') %}
|
|
25
|
-
{
|
|
26
|
-
"
|
|
27
|
-
"text": "
|
|
28
|
-
|
|
29
|
-
"id": "input-with-error-message-" + id,
|
|
30
|
-
"name": "test-name-" + id,
|
|
31
|
-
"errorMessage": {
|
|
32
|
-
"text": "Error: Este campo no puede estar vacío"
|
|
44
|
+
{% call componentFieldset({
|
|
45
|
+
"legend": {
|
|
46
|
+
"text": "¿Cuál es tu número de teléfono móvil?",
|
|
47
|
+
"classes": "mb-sm sr-only"
|
|
33
48
|
}
|
|
34
|
-
|
|
49
|
+
}) %}
|
|
50
|
+
<div class="c-form-group">
|
|
51
|
+
{{ componentInput({
|
|
52
|
+
"label": {
|
|
53
|
+
"text": "Número de teléfono móvil"
|
|
54
|
+
},
|
|
55
|
+
"id": "input-with-error-message-" + id,
|
|
56
|
+
"name": "test-name-" + id,
|
|
57
|
+
"errorMessage": {
|
|
58
|
+
"text": "Este campo no puede estar vacío"
|
|
59
|
+
}
|
|
60
|
+
}) }}
|
|
61
|
+
</div>
|
|
62
|
+
{% endcall %}
|
|
35
63
|
{% endmacro %}
|
|
36
64
|
|
|
37
65
|
{% macro grandchildContent(id='id') %}
|
|
@@ -274,39 +302,6 @@
|
|
|
274
302
|
]
|
|
275
303
|
}
|
|
276
304
|
},
|
|
277
|
-
{
|
|
278
|
-
"name": "con un legend como encabezado",
|
|
279
|
-
"description": "Usa el parámetro <code>'heading'</code> para añadir un encabezado asociado al componente. Usa el parámetro <code>'headingLevel'</code> para establecer el nivel del encabezado. Por ejemplo: <code>'headingLevel': 3</code> creará un encabezado <code><h3></code>.",
|
|
280
|
-
"data": {
|
|
281
|
-
"idPrefix": "legend-as-page-heading",
|
|
282
|
-
"name": "legend-as-page-heading",
|
|
283
|
-
"fieldset": {
|
|
284
|
-
"legend": {
|
|
285
|
-
"text": "¿Cómo prefieres que te contactemos?",
|
|
286
|
-
"classes": "c-h2",
|
|
287
|
-
"isPageHeading": true
|
|
288
|
-
},
|
|
289
|
-
"headingLevel": 2
|
|
290
|
-
},
|
|
291
|
-
"hint": {
|
|
292
|
-
"text": "Si lo deseas puedes seleccionar varios elementos."
|
|
293
|
-
},
|
|
294
|
-
"items": [
|
|
295
|
-
{
|
|
296
|
-
"value": "correo-electronico",
|
|
297
|
-
"text": "Correo electrónico"
|
|
298
|
-
},
|
|
299
|
-
{
|
|
300
|
-
"value": "correp-postal",
|
|
301
|
-
"text": "Correo postal"
|
|
302
|
-
},
|
|
303
|
-
{
|
|
304
|
-
"value": "telefono",
|
|
305
|
-
"text": "Teléfono"
|
|
306
|
-
}
|
|
307
|
-
]
|
|
308
|
-
}
|
|
309
|
-
},
|
|
310
305
|
{
|
|
311
306
|
"name": "con un legend del tamaño de un encabezado h2",
|
|
312
307
|
"data": {
|
|
@@ -322,7 +317,7 @@
|
|
|
322
317
|
"text": "Si lo deseas puedes seleccionar varios elementos."
|
|
323
318
|
},
|
|
324
319
|
"errorMessage": {
|
|
325
|
-
"text": "
|
|
320
|
+
"text": "Tienes que seleccionar al menos una opción. Soluciona el error."
|
|
326
321
|
},
|
|
327
322
|
"items": [
|
|
328
323
|
{
|
|
@@ -342,6 +337,7 @@
|
|
|
342
337
|
},
|
|
343
338
|
{
|
|
344
339
|
"name": "sin fieldset",
|
|
340
|
+
"description": "Usa este ejemplo si vas a escribir tú mismo un fieldset, rodeándolo. Recuerda que el uso de fieldset es necesario por accesibilidad.",
|
|
345
341
|
"data": {
|
|
346
342
|
"idPrefix": "without-fieldset",
|
|
347
343
|
"name": "without-fieldset",
|
|
@@ -363,11 +359,12 @@
|
|
|
363
359
|
},
|
|
364
360
|
{
|
|
365
361
|
"name": "con una sóla opción usando 'aria-describedby' en el input",
|
|
362
|
+
"description": "Por accesibilidad, los mensajes de error deben incluir la palabra \"error\", para que no recaiga tan sólo en el color el hecho de que es un mensaje de error.",
|
|
366
363
|
"data": {
|
|
367
364
|
"idPrefix": "describedby",
|
|
368
365
|
"name": "describedby",
|
|
369
366
|
"errorMessage": {
|
|
370
|
-
"text": "
|
|
367
|
+
"text": "Por favor, debes aceptar los términos y condiciones. Soluciona el error."
|
|
371
368
|
},
|
|
372
369
|
"items": [
|
|
373
370
|
{
|
|
@@ -379,10 +376,11 @@
|
|
|
379
376
|
},
|
|
380
377
|
{
|
|
381
378
|
"name": "con una sóla opción (y pista) usando 'aria-describedby' en el input",
|
|
379
|
+
"description": "Por accesibilidad, los mensajes de error deben incluir la palabra \"error\", para que no recaiga tan sólo en el color el hecho de que es un mensaje de error.",
|
|
382
380
|
"data": {
|
|
383
381
|
"name": "t-and-c-with-hint",
|
|
384
382
|
"errorMessage": {
|
|
385
|
-
"text": "
|
|
383
|
+
"text": "Por favor, debes aceptar los términos y condiciones. Soluciona el error."
|
|
386
384
|
},
|
|
387
385
|
"items": [
|
|
388
386
|
{
|
|
@@ -397,10 +395,11 @@
|
|
|
397
395
|
},
|
|
398
396
|
{
|
|
399
397
|
"name": "con fieldset y mensaje de error",
|
|
398
|
+
"description": "Por accesibilidad, los mensajes de error deben incluir la palabra \"error\", para que no recaiga tan sólo en el color el hecho de que es un mensaje de error.",
|
|
400
399
|
"data": {
|
|
401
400
|
"name": "colours",
|
|
402
401
|
"errorMessage": {
|
|
403
|
-
"text": "
|
|
402
|
+
"text": "Tienes que seleccionar al menos una opción. Soluciona el error."
|
|
404
403
|
},
|
|
405
404
|
"fieldset": {
|
|
406
405
|
"legend": {
|
|
@@ -425,11 +424,12 @@
|
|
|
425
424
|
},
|
|
426
425
|
{
|
|
427
426
|
"name": "con mensaje de error",
|
|
427
|
+
"description": "Por accesibilidad, los mensajes de error deben incluir la palabra \"error\", para que no recaiga tan sólo en el color el hecho de que es un mensaje de error.",
|
|
428
428
|
"data": {
|
|
429
429
|
"idPrefix": "error-message",
|
|
430
430
|
"name": "error-message",
|
|
431
431
|
"errorMessage": {
|
|
432
|
-
"text": "
|
|
432
|
+
"text": "Tienes que seleccionar al menos una opción. Soluciona el error."
|
|
433
433
|
},
|
|
434
434
|
"fieldset": {
|
|
435
435
|
"legend": {
|
|
@@ -454,11 +454,12 @@
|
|
|
454
454
|
},
|
|
455
455
|
{
|
|
456
456
|
"name": "con mensaje de error y pistas en los items",
|
|
457
|
+
"description": "Por accesibilidad, los mensajes de error deben incluir la palabra \"error\", para que no recaiga tan sólo en el color el hecho de que es un mensaje de error.",
|
|
457
458
|
"data": {
|
|
458
459
|
"idPrefix": "error-and-hints",
|
|
459
460
|
"name": "error-and-hints",
|
|
460
461
|
"errorMessage": {
|
|
461
|
-
"text": "
|
|
462
|
+
"text": "Tienes que seleccionar al menos una opción. Soluciona el error."
|
|
462
463
|
},
|
|
463
464
|
"fieldset": {
|
|
464
465
|
"legend": {
|
|
@@ -492,6 +493,7 @@
|
|
|
492
493
|
},
|
|
493
494
|
{
|
|
494
495
|
"name": "con un texto de item muy largo",
|
|
496
|
+
"description": "Por accesibilidad, los mensajes de error deben incluir la palabra \"error\", para que no recaiga tan sólo en el color el hecho de que es un mensaje de error.",
|
|
495
497
|
"data": {
|
|
496
498
|
"idPrefix": "long-option",
|
|
497
499
|
"name": "long-option",
|
|
@@ -499,7 +501,7 @@
|
|
|
499
501
|
"text": "Nullam id dolor id nibh ultricies vehicula ut id elit."
|
|
500
502
|
},
|
|
501
503
|
"errorMessage": {
|
|
502
|
-
"text": "
|
|
504
|
+
"text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Soluciona el error."
|
|
503
505
|
},
|
|
504
506
|
"fieldset": {
|
|
505
507
|
"legend": {
|
|
@@ -524,6 +526,7 @@
|
|
|
524
526
|
},
|
|
525
527
|
{
|
|
526
528
|
"name": "con items condicionales",
|
|
529
|
+
"description": "El contenido de cada condicional es una agrupación, y como tal, se deben agrupar con una etiqueta <code><fieldset></code> o bien de una etiqueta <code><div></code> con <code>role=\"group\"</code> que tenga un <code>aria-label</code> o <code>aria-labelledby</code>.",
|
|
527
530
|
"data": {
|
|
528
531
|
"idPrefix": "with-conditional-items",
|
|
529
532
|
"name": "with-conditional-items",
|
|
@@ -558,31 +561,9 @@
|
|
|
558
561
|
]
|
|
559
562
|
}
|
|
560
563
|
},
|
|
561
|
-
{
|
|
562
|
-
"name": "con items condicionales anidados",
|
|
563
|
-
"data": {
|
|
564
|
-
"idPrefix": "with-conditional-nested-items",
|
|
565
|
-
"name": "with-conditional-nested-items",
|
|
566
|
-
"idPrefix": "how-contacted-nested",
|
|
567
|
-
"fieldset": {
|
|
568
|
-
"legend": {
|
|
569
|
-
"text": "¿Cómo quieres que te contactemos?"
|
|
570
|
-
}
|
|
571
|
-
},
|
|
572
|
-
"items": [
|
|
573
|
-
{
|
|
574
|
-
"value": "presencial",
|
|
575
|
-
"text": "Presencial",
|
|
576
|
-
"checked": true,
|
|
577
|
-
"conditional": {
|
|
578
|
-
"html": nestedContent('1').val
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
]
|
|
582
|
-
}
|
|
583
|
-
},
|
|
584
564
|
{
|
|
585
565
|
"name": "con item condicional seleccionado",
|
|
566
|
+
"description": "Usa el parámetro <code>'checked': true</code> para mostrar un item condicional seleccionado. El contenido de cada condicional es una agrupación, y como tal, se deben agrupar con una etiqueta <code><fieldset></code> o bien de una etiqueta <code><div></code> con <code>role=\"group\"</code> que tenga un <code>aria-label</code> o <code>aria-labelledby</code>.",
|
|
586
567
|
"data": {
|
|
587
568
|
"idPrefix": "with-conditional-items-checked",
|
|
588
569
|
"name": "with-conditional-items-checked",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
13
|
"hint": {
|
|
14
|
-
"text": "Por ejemplo, 31 3 1980"
|
|
14
|
+
"text": "Por ejemplo, día: 31 mes: 3 año: 1980"
|
|
15
15
|
},
|
|
16
16
|
"items": [
|
|
17
17
|
{
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
"errorMessage": {
|
|
51
|
-
"text": "
|
|
51
|
+
"text": "Aqui va un mensaje de error"
|
|
52
52
|
},
|
|
53
53
|
"items": [
|
|
54
54
|
{
|
|
@@ -88,10 +88,10 @@
|
|
|
88
88
|
}
|
|
89
89
|
},
|
|
90
90
|
"hint": {
|
|
91
|
-
"text": "Por ejemplo, 31 3 1980"
|
|
91
|
+
"text": "Por ejemplo, día: 31 mes: 3 año: 1980"
|
|
92
92
|
},
|
|
93
93
|
"errorMessage": {
|
|
94
|
-
"text": "
|
|
94
|
+
"text": "Aqui va un mensaje de error"
|
|
95
95
|
},
|
|
96
96
|
"items": [
|
|
97
97
|
{
|
|
@@ -132,10 +132,10 @@
|
|
|
132
132
|
}
|
|
133
133
|
},
|
|
134
134
|
"hint": {
|
|
135
|
-
"text": "Por ejemplo, 31 3 1980"
|
|
135
|
+
"text": "Por ejemplo, día: 31 mes: 3 año: 1980"
|
|
136
136
|
},
|
|
137
137
|
"errorMessage": {
|
|
138
|
-
"text": "
|
|
138
|
+
"text": "Aqui va un mensaje de error"
|
|
139
139
|
},
|
|
140
140
|
"items": [
|
|
141
141
|
{
|
|
@@ -174,10 +174,10 @@
|
|
|
174
174
|
}
|
|
175
175
|
},
|
|
176
176
|
"hint": {
|
|
177
|
-
"text": "Por ejemplo, 31 3 1980"
|
|
177
|
+
"text": "Por ejemplo, día: 31 mes: 3 año: 1980"
|
|
178
178
|
},
|
|
179
179
|
"errorMessage": {
|
|
180
|
-
"text": "
|
|
180
|
+
"text": "Aqui va un mensaje de error"
|
|
181
181
|
},
|
|
182
182
|
"items": [
|
|
183
183
|
{
|
|
@@ -216,10 +216,10 @@
|
|
|
216
216
|
}
|
|
217
217
|
},
|
|
218
218
|
"hint": {
|
|
219
|
-
"text": "Por ejemplo, 31 3 1980"
|
|
219
|
+
"text": "Por ejemplo, día: 31 mes: 3 año: 1980"
|
|
220
220
|
},
|
|
221
221
|
"errorMessage": {
|
|
222
|
-
"text": "
|
|
222
|
+
"text": "Aqui va un mensaje de error"
|
|
223
223
|
},
|
|
224
224
|
"items": [
|
|
225
225
|
{
|
|
@@ -258,7 +258,7 @@
|
|
|
258
258
|
}
|
|
259
259
|
},
|
|
260
260
|
"hint": {
|
|
261
|
-
"text": "Por ejemplo, 31 3 1980"
|
|
261
|
+
"text": "Por ejemplo, día: 31 mes: 3 año: 1980"
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
264
|
},
|
|
@@ -310,7 +310,7 @@
|
|
|
310
310
|
}
|
|
311
311
|
},
|
|
312
312
|
"hint": {
|
|
313
|
-
"text": "Por ejemplo, 31 3 1980"
|
|
313
|
+
"text": "Por ejemplo, día: 31 mes: 3 año: 1980"
|
|
314
314
|
},
|
|
315
315
|
"formGroup": {
|
|
316
316
|
"classes": "p-base bg-primary-light"
|
|
@@ -328,7 +328,7 @@
|
|
|
328
328
|
}
|
|
329
329
|
},
|
|
330
330
|
"hint": {
|
|
331
|
-
"text": "Por ejemplo, 31 3 1980"
|
|
331
|
+
"text": "Por ejemplo, día: 31 mes: 3 año: 1980"
|
|
332
332
|
},
|
|
333
333
|
"items": [
|
|
334
334
|
{
|
|
@@ -369,7 +369,7 @@
|
|
|
369
369
|
}
|
|
370
370
|
},
|
|
371
371
|
"hint": {
|
|
372
|
-
"text": "Por ejemplo, 31 3 1980"
|
|
372
|
+
"text": "Por ejemplo, día: 31 mes: 3 año: 1980"
|
|
373
373
|
},
|
|
374
374
|
"items": [
|
|
375
375
|
{
|
|
@@ -411,7 +411,7 @@
|
|
|
411
411
|
}
|
|
412
412
|
},
|
|
413
413
|
"hint": {
|
|
414
|
-
"text": "Por ejemplo, 31 3 1980",
|
|
414
|
+
"text": "Por ejemplo, día: 31 mes: 3 año: 1980",
|
|
415
415
|
"classes": "text-sm"
|
|
416
416
|
},
|
|
417
417
|
"items": [
|