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.
Files changed (60) hide show
  1. package/docs/_include.template-header.njk +5 -0
  2. package/docs/_macro.example-render.njk +5 -0
  3. package/docs/componentes.html +3 -0
  4. package/docs/ds/_ds.example.checkboxes.njk +1 -1
  5. package/docs/ds/_ds.example.date-input.njk +3 -3
  6. package/docs/ds/_ds.example.file-upload.njk +1 -1
  7. package/docs/ds/_ds.example.input-group.njk +1 -1
  8. package/docs/ds/_ds.example.input.njk +5 -5
  9. package/docs/ds/_ds.example.radios.njk +1 -1
  10. package/docs/ds/_ds.example.searchbar.njk +1 -1
  11. package/docs/ds/_ds.example.select.njk +5 -5
  12. package/docs/ds/_ds.example.textarea.njk +7 -7
  13. package/docs/examples-treegrid.html +8 -0
  14. package/docs/index.html +8 -0
  15. package/gulpfile.js +15 -1
  16. package/package.json +2 -1
  17. package/src/css/styles.css +1 -0
  18. package/src/js/aria/MenuNavigation.js +12 -3
  19. package/src/js/aria/tree.js +320 -31
  20. package/src/js/aria/treegrid.js +508 -0
  21. package/src/js/aria/treeitem.js +25 -19
  22. package/src/js/desy-html.js +37 -31
  23. package/src/js/index.js +12 -10
  24. package/src/templates/components/character-count/_examples.character-count.njk +3 -15
  25. package/src/templates/components/checkboxes/_examples.checkboxes.njk +67 -86
  26. package/src/templates/components/date-input/_examples.date-input.njk +15 -15
  27. package/src/templates/components/datepicker/_examples.datepicker.njk +7 -6
  28. package/src/templates/components/datepicker/_template.datepicker.njk +0 -1
  29. package/src/templates/components/description-list/_examples.description-list.njk +2 -2
  30. package/src/templates/components/dialog/_examples.dialog.njk +2 -2
  31. package/src/templates/components/dropdown/_examples.dropdown.njk +3 -3
  32. package/src/templates/components/error-message/_examples.error-message.njk +4 -2
  33. package/src/templates/components/error-summary/params.error-summary.yaml +0 -3
  34. package/src/templates/components/fieldset/_examples.fieldset.njk +2 -29
  35. package/src/templates/components/file-upload/_examples.file-upload.njk +4 -15
  36. package/src/templates/components/header-advanced/_template.header-advanced.njk +1 -0
  37. package/src/templates/components/hint/params.hint.yaml +0 -14
  38. package/src/templates/components/input/_examples.input.njk +9 -45
  39. package/src/templates/components/input-group/_examples.input-group.njk +19 -18
  40. package/src/templates/components/item/_examples.item.njk +1 -0
  41. package/src/templates/components/media-object/_examples.media-object.njk +6 -5
  42. package/src/templates/components/menubar/_template.menubar.njk +2 -2
  43. package/src/templates/components/menubar/params.menubar.yaml +0 -10
  44. package/src/templates/components/modal/_examples.modal.njk +1 -1
  45. package/src/templates/components/notification/_examples.notification.njk +8 -2
  46. package/src/templates/components/pill/_examples.pill.njk +2 -1
  47. package/src/templates/components/radios/_examples.radios.njk +56 -91
  48. package/src/templates/components/searchbar/_examples.searchbar.njk +2 -1
  49. package/src/templates/components/select/_examples.select.njk +3 -29
  50. package/src/templates/components/status-item/_examples.status-item.njk +1 -0
  51. package/src/templates/components/table-advanced/params.table-advanced.yaml +1 -1
  52. package/src/templates/components/textarea/_examples.textarea.njk +3 -14
  53. package/src/templates/components/tree/_examples.tree.njk +157 -3
  54. package/src/templates/components/tree/_template.tree.njk +112 -101
  55. package/src/templates/components/tree/params.tree.yaml +4 -0
  56. package/src/templates/components/treegrid/_examples.treegrid.njk +1240 -0
  57. package/src/templates/components/treegrid/_macro.treegrid.njk +3 -0
  58. package/src/templates/components/treegrid/_styles.treegrid.css +39 -0
  59. package/src/templates/components/treegrid/_template.treegrid.njk +91 -0
  60. package/src/templates/components/treegrid/params.treegrid.yaml +132 -0
@@ -6,80 +6,80 @@
6
6
 
7
7
  {#- If an id 'prefix' is not passed, fall back to using the name attribute
8
8
  instead. We need this for error messages and hints as well -#}
9
- {% set idPrefix = params.idPrefix if params.idPrefix else params.name %}
9
+ {% set idPrefix = params.idPrefix if params.idPrefix else
10
+ params.name %}
10
11
 
11
12
  {#- a record of other elements that we need to associate with the input using
12
13
  aria-describedby – for example hints or error messages -#}
13
- {% set describedBy = params.describedBy if params.describedBy else "" %}
14
+ {% set describedBy = params.describedBy if params.describedBy else
15
+ "" %}
14
16
  {% if params.fieldset.describedBy %}
15
- {% set describedBy = params.fieldset.describedBy %}
17
+ {% set describedBy = params.fieldset.describedBy %}
16
18
  {% endif %}
17
19
 
18
20
  {% set subLevel = "" %}
19
21
 
20
22
  {#- fieldset is false by default -#}
21
- {% set hasFieldset = true if params.fieldset else false %}
23
+ {% set hasFieldset = true if params.fieldset else
24
+ false %}
22
25
 
23
26
  {#- fieldset is false by default -#}
24
- {% set hasUnderline = true if params.hasUnderline else false %}
25
-
26
-
27
-
28
- {% set ariaLabel = params.ariaLabel if params.ariaLabel %}
29
-
27
+ {% set hasUnderline = true if params.hasUnderline else
28
+ false %}
30
29
 
31
30
  {#- macro to generate checkboxes -#}
32
31
  {% macro checkboxItem(item, id, name, type) %}
33
32
  {% set hasHint = true if item.hint.text or item.hint.html %}
34
33
  {% set itemHintId = id + "-item-hint" if hasHint else "" %}
35
- {% set itemDescribedBy = describedBy if not hasFieldset else "" %}
34
+ {% set itemDescribedBy = describedBy if not hasFieldset else
35
+ "" %}
36
36
  {% set itemDescribedBy = (itemDescribedBy + " " + itemHintId) | trim %}
37
37
  <div {%- if params.hasDividers or item.classes %} class="{%- if params.hasDividers %} border-t border-b border-neutral-base -mb-px{% endif %} {%- if item.classes %} {{ item.classes }}{% endif %}"{% endif %}>
38
38
  <div class="relative flex items-start py-xs">
39
39
  {% if type == 'checkbox' or type == 'radio' or type == undefined %}
40
- <div class="flex items-center mx-sm">
41
- <input class="w-6 h-6 transition duration-150 ease-in-out border-black focus:border-black focus:shadow-outline-focus-input focus:ring-4 focus:ring-offset-0 focus:ring-warning-base disabled:bg-neutral-base disabled:border-neutral-base text-primary-base {%- if item.isIndeterminate and item.indeterminateChecked %} c-checkboxes__indeterminate-active {% endif %}" id="{{ id }}-input" name="{{ name }}" {%- if type == 'checkbox' %} type="checkbox"{% else %} type="radio"{% endif %} value="{{ item.value }}"
40
+ <div class="flex items-center mx-sm">
41
+ <input class="w-6 h-6 transition duration-150 ease-in-out border-black focus:border-black focus:shadow-outline-focus-input focus:ring-4 focus:ring-offset-0 focus:ring-warning-base disabled:bg-neutral-base disabled:border-neutral-base text-primary-base {%- if item.isIndeterminate and item.indeterminateChecked %} c-checkboxes__indeterminate-active {% endif %}" id="{{ id }}-input" name="{{ name }}" {%- if type == 'checkbox' %} type="checkbox" {% else %} type="radio"{% endif %} value="{{ item.value }}"
42
42
  {{-" checked" if item.checked }}
43
43
  {{-" disabled" if item.disabled }}
44
44
  {%- if itemDescribedBy %} aria-describedby="{{ itemDescribedBy }}"{% endif -%}
45
45
  {%- if params.errorMessage %} aria-invalid="true"{% endif -%}
46
46
  {%- for attribute, value in item.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}
47
47
  {%- if item.isIndeterminate or item.indeterminateChecked %} onclick="if (this.readOnly) this.checked=this.readOnly=false; else if (!this.checked) this.readOnly=this.indeterminate=true;"{% endif %}>
48
- </div>
49
- <div class="flex-1 pt-0.5 leading-5">
50
- {{ componentLabel({
48
+ </div>
49
+ <div class="flex-1 pt-0.5 leading-5">
50
+ {{ componentLabel({
51
51
  html: item.html,
52
52
  text: item.text,
53
53
  classes: item.label.classes if item.label.classes else 'block relative -top-xs -left-8 pl-8 py-xs',
54
54
  attributes: item.label.attributes,
55
55
  for: id + '-input'
56
56
  }) | indent(8) | trim }}
57
- {% if hasHint %}
58
- {{ componentHint({
57
+ {% if hasHint %}
58
+ {{ componentHint({
59
59
  id: itemHintId,
60
60
  classes: (item.hint.classes if item.hint.classes),
61
61
  attributes: item.hint.attributes,
62
62
  html: item.hint.html,
63
63
  text: item.hint.text
64
64
  }) | indent(8) | trim }}
65
- {% endif %}
66
- </div>
65
+ {% endif %}
66
+ </div>
67
67
  {% endif %}
68
68
  {% if type == 'navigation' %}
69
69
  {% if item.href %}
70
70
  <a {%- if id %} id="{{ id }}-link"{% endif %} href="{{ item.href }}" class="block px-xs focus:bg-warning-base focus:outline-none focus:shadow-outline-focus focus:text-black {%- if hasUnderline %} underline{% endif %} {%- if item.classes %} {{ item.classes }}{% endif %} {%- if not item.disabled %} hover:text-primary-base hover:underline{% endif %} {%- if item.disabled %} no-underline pointer-events-none{% endif %}" {%- if item.title %} title="{{ item.title }}"{% endif %}{%- if item.active %} aria-current="page"{% endif %} {% if item.disabled %} aria-disabled="true" tabindex="-1"{% endif %} {% if item.target %} target="{{ item.target }}"{% endif %}{%- for attribute, value in item.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>
71
71
  {% if item.active %}
72
- <strong class="font-bold">{{ item.html | filterquotes | safe if item.html else item.text }}</strong>
72
+ <strong class="font-bold">{{ item.html | filterquotes | safe if item.html else item.text }}</strong>
73
73
  {% else %}
74
- {{ item.html | filterquotes | safe if item.html else item.text }}
74
+ {{ item.html | filterquotes | safe if item.html else item.text }}
75
75
  {% endif %}
76
76
  </a>
77
77
  {% else %}
78
78
  <span {%- if id %} id="{{ id }}-link"{% endif %} class="block px-xs {%- if item.classes %} {{ item.classes }}{% endif %}" {%- if item.title %} title="{{ item.title }}"{% endif %} {%- for attribute, value in item.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>
79
79
  {% if item.active %}
80
- <strong class="font-bold">{{ item.html | filterquotes | safe if item.html else item.text }}</strong>
80
+ <strong class="font-bold">{{ item.html | filterquotes | safe if item.html else item.text }}</strong>
81
81
  {% else %}
82
- {{ item.html | filterquotes | safe if item.html else item.text }}
82
+ {{ item.html | filterquotes | safe if item.html else item.text }}
83
83
  {% endif %}
84
84
  </span>
85
85
  {% endif %}
@@ -89,24 +89,25 @@
89
89
  {% endmacro %}
90
90
 
91
91
  {#- macro to generate children -#}
92
- {% macro childrenTree(itemNode, id, name, type) %}
93
- {% if itemNode.sub %}
94
- <div class="w-full h-full">
95
- <div class="w-full flex items-center relative focus:bg-warning-base focus:outline-none focus:shadow-outline-focus focus:text-black text-left {%- if itemNode.classes %} {{ itemNode.classes }}{% endif %}"
92
+ {% macro childrenTree(itemNode, id, name, type, lazyRendering) %}
93
+ {% if itemNode.sub %}
94
+ <div class="w-full h-full">
95
+ <div class="flex items-center relative focus:bg-warning-base focus:outline-none focus:shadow-outline-focus focus:text-black text-left {%- if itemNode.classes %} {{ itemNode.classes }}{% endif %}"
96
96
  {%- for attribute, value in itemNode.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>
97
- <span class="absolute top-3 -left-4 flex items-center w-4 h-2.5 text-primary-base font-bold after:content-[''] after:absolute after:-left-2 after:p-4">
98
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10" width="10" height="10" aria-hidden="true" class="c-tree__minus"><path fill="currentColor" d="M9.286 5.714H.714a.714.714 0 010-1.428h8.572a.714.714 0 010 1.428z"/></svg>
99
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10" width="10" height="10" aria-hidden="true" class="c-tree__plus"><path fill="currentColor" d="M9.286 4.286H5.893a.179.179 0 01-.179-.179V.714a.714.714 0 00-1.428 0v3.393a.179.179 0 01-.179.179H.714a.714.714 0 000 1.428h3.393a.179.179 0 01.179.179v3.393a.714.714 0 001.428 0V5.893a.179.179 0 01.179-.179h3.393a.714.714 0 000-1.428z"/></svg>
100
- </span>
101
- {{ checkboxItem(itemNode, id, name, type) | trim | indent(8) }}
102
- </div>
97
+ <span class="c-tree__icon absolute top-3 -left-4 flex items-center w-4 h-2.5 text-primary-base font-bold after:content-[''] after:absolute after:-left-2 after:p-4">
98
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10" width="10" height="10" aria-hidden="true" class="c-tree__minus"><path fill="currentColor" d="M9.286 5.714H.714a.714.714 0 010-1.428h8.572a.714.714 0 010 1.428z"/></svg>
99
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10" width="10" height="10" aria-hidden="true" class="c-tree__plus"><path fill="currentColor" d="M9.286 4.286H5.893a.179.179 0 01-.179-.179V.714a.714.714 0 00-1.428 0v3.393a.179.179 0 01-.179.179H.714a.714.714 0 000 1.428h3.393a.179.179 0 01.179.179v3.393a.714.714 0 001.428 0V5.893a.179.179 0 01.179-.179h3.393a.714.714 0 000-1.428z"/></svg>
100
+ </span>
101
+ {{ checkboxItem(itemNode, id, name, type) | trim | indent(8) }}
103
102
  </div>
104
- {% else %}
105
- {{ checkboxItem(itemNode, id, name, type) | trim | indent(4)}}
106
- {% endif %}
107
- {% if itemNode.sub.items %}
108
- {% set subLevel = subLevel + "sub-" %}
109
- <ul role="group" class='c-tree__itemgroup {%- if itemNode.sub.classes %} {{ itemNode.sub.classes }}{% endif %}' {%- for attribute, value in itemNode.sub.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>
103
+ </div>
104
+ {% else %}
105
+ {{ checkboxItem(itemNode, id, name, type) | trim | indent(4)}}
106
+ {% endif %}
107
+ {% if itemNode.sub.items %}
108
+ {% set subLevel = subLevel + "sub-" %}
109
+ <ul role="group" class='c-tree__itemgroup {%- if itemNode.sub.classes %} {{ itemNode.sub.classes }}{% endif %}' {%- for attribute, value in itemNode.sub.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>
110
+ {% if lazyRendering != true %}
110
111
  {% for subitem in itemNode.sub.items %}
111
112
  {% if subitem %}
112
113
  {#- If the user explicitly sets an id, use this instead of the regular idPrefix -#}
@@ -115,37 +116,39 @@
115
116
  {%- else -%}
116
117
  {%- set subId = subLevel + id + "-" + loop.index0 -%}
117
118
  {%- endif %}
118
- {% if type == 'navigation' %}
119
- <li class="c-tree__item ml-5 my-sm origin-top-left focus:outline-none" id="{{ subId }}" role="treeitem" data-module="c-tree__item" {%- if subitem.sub%}{% if subitem.expanded %} aria-expanded="true"{% else %} aria-expanded="false"{% endif %}{% endif %}>
120
- {% else %}
121
- <li class="c-tree__item ml-8 origin-top-left focus:outline-none" id="{{ subId }}" role="treeitem" data-module="c-tree__item" {%- if subitem.sub%}{% if subitem.expanded %} aria-expanded="true"{% else %} aria-expanded="false"{% endif %}{% endif %}>
122
- {%- endif %}
119
+ {% if type == 'navigation' %}
120
+ <li class="c-tree__item ml-5 my-sm origin-top-left focus:outline-none" id="{{ subId }}" role="treeitem" data-module="c-tree__item" {%- if subitem.sub%}{% if subitem.expanded %} aria-expanded="true"{% else %} aria-expanded="false"{% endif %}{% endif %}>
121
+ {% else %}
122
+ <li class="c-tree__item ml-8 origin-top-left focus:outline-none" id="{{ subId }}" role="treeitem" data-module="c-tree__item" {%- if subitem.sub%}{% if subitem.expanded %} aria-expanded="true"{% else %} aria-expanded="false"{% endif %}{% endif %}>
123
+ {%- endif %}
123
124
 
124
- {% if subitem.sub %}
125
- {{ childrenTree(subitem, subId, name, type) | trim | indent(12) }}
126
- {% else %}
127
- <div class="block {%- if subitem.classes %} {{ subitem.classes }}{% endif %} {%- if subitem.active %} font-bold{% endif %}" {%- if subitem.title %} title="{{ subitem.title }}"{% endif %} {%- if subitem.active %} aria-current="page"{% endif %} {%- for attribute, value in subitem.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>
128
- {% if subitem.active %}
129
- <div class="font-bold">
130
- {{ checkboxItem(subitem, subId, name, type) | trim | indent(10) }}
131
- </div>
132
- {% else %}
133
- {{ checkboxItem(subitem, subId, name, type) | trim | indent(10) }}
134
- {% endif %}
135
- </div>
125
+ {% if subitem.sub %}
126
+ {{ childrenTree(subitem, subId, name, type, lazyRendering) | trim | indent(12) }}
127
+ {% else %}
128
+ <div class="block {%- if subitem.classes %} {{ subitem.classes }}{% endif %} {%- if subitem.active %} font-bold{% endif %}" {%- if subitem.title %} title="{{ subitem.title }}"{% endif %} {%- if subitem.active %} aria-current="page"{% endif %} {%- for attribute, value in subitem.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>
129
+ {% if subitem.active %}
130
+ <div class="font-bold">
131
+ {{ checkboxItem(subitem, subId, name, type) | trim | indent(10) }}
132
+ </div>
133
+ {% else %}
134
+ {{ checkboxItem(subitem, subId, name, type) | trim | indent(10) }}
135
+ {% endif %}
136
+ </div>
137
+ {% endif %}
138
+ </li>
139
+ {% endif %}
140
+ {% endfor %}
136
141
  {% endif %}
137
- </li>
138
- {% endif %}
139
- {% endfor %}
140
- </ul>
141
- {% endif %}
142
- {% endmacro %}
142
+ </ul>
143
+ {% endif %}
144
+ {% endmacro %}
143
145
 
144
- {#- Capture the HTML so we can optionally nest it in a fieldset -#}
145
- {% set innerHtml %}
146
+ {#- Capture the HTML so we can optionally nest it in a fieldset -#}
147
+ {% set innerHtml %}
146
148
  {% if params.hint %}
147
149
  {% set hintId = idPrefix + '-hint' %}
148
- {% set describedBy = describedBy + ' ' + hintId if describedBy else hintId %}
150
+ {% set describedBy = describedBy + ' ' + hintId if describedBy else
151
+ hintId %}
149
152
  {{ componentHint({
150
153
  id: hintId,
151
154
  classes: params.hint.classes,
@@ -156,7 +159,8 @@
156
159
  {% endif %}
157
160
  {% if params.errorMessage %}
158
161
  {% set errorId = idPrefix + '-error' %}
159
- {% set describedBy = describedBy + ' ' + errorId if describedBy else errorId %}
162
+ {% set describedBy = describedBy + ' ' + errorId if describedBy else
163
+ errorId %}
160
164
  {{ componentErrorMessage({
161
165
  id: errorId,
162
166
  classes: params.errorMessage.classes,
@@ -169,7 +173,12 @@
169
173
  {% if params.searchbar %}
170
174
  {{ componentSearchbar(params.searchbar) }}
171
175
  {% endif %}
172
- <ul class="c-tree {%- if params.classes %} {{ params.classes }}{% endif %}" id="{% if params.id %}{{ params.id }}{% else %}{{ idPrefix }}{% endif %}" role="tree" {%- if params.type=='navigation' %} data-tree-navigation{% endif %} {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %} data-module="c-tree">
176
+ <ul class="c-tree {%- if params.classes %} {{ params.classes }}{% endif %}" id="{% if params.id %}{{ params.id }}{% else %}{{ idPrefix }}{% endif %}" role="tree" {%- if params.type=='navigation' %} data-tree-navigation="true"{% endif %} {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %} data-module="c-tree"
177
+ {% if params.lazyRendering %}
178
+ data-tree='{{ params.items | dump | safe }}'
179
+ data-params='{{ params | dump | safe }}'
180
+ {% endif %}
181
+ >
173
182
  {% for item in params.items %}
174
183
  {% if item %}
175
184
  {#- If the user explicitly sets an id, use this instead of the regular idPrefix -#}
@@ -179,44 +188,46 @@
179
188
  {%- set id = idPrefix + "-" + loop.index0 -%}
180
189
  {%- endif -%}
181
190
  {% set subId = "sub-" + id %}
182
- {% set name = item.name if item.name else params.name %}
191
+ {% set name = item.name if item.name else
192
+ params.name %}
183
193
  {% set hasHint = true if item.hint.text or item.hint.html %}
184
194
  {% set itemHintId = id + "-item-hint" if hasHint else "" %}
185
- {% set itemDescribedBy = describedBy if not hasFieldset else "" %}
195
+ {% set itemDescribedBy = describedBy if not hasFieldset else
196
+ "" %}
186
197
  {% set itemDescribedBy = (itemDescribedBy + " " + itemHintId) | trim %}
187
- <li id="{{ id }}" class="c-tree__item ml-4 {%- if params.type=='navigation' %} my-sm {% endif %} focus:outline-none {%- if item.active %} font-bold{% endif %}" role="treeitem" data-module="c-tree__item" {%- if item.sub%}{% if item.expanded %} aria-expanded="true"{% else %} aria-expanded="false"{% endif %}{% endif %}>
188
- {{ childrenTree(item, id, name, params.type) | trim }}
189
- </li>
198
+ <li id="{{ id }}" class="c-tree__item ml-4 {%- if params.type=='navigation' %} my-sm {% endif %} focus:outline-none {%- if item.active %} font-bold{% endif %}" role="treeitem" data-module="c-tree__item" {%- if item.sub%}{% if item.expanded %} aria-expanded="true"{% else %} aria-expanded="false"{% endif %}{% endif %}>
199
+ {{ childrenTree(item, id, name, params.type, params.lazyRendering) | trim }}
200
+ </li>
190
201
  {% endif %}
191
202
  {% endfor %}
192
203
  </ul>
193
- {% endset -%}
204
+ {% endset -%}
194
205
 
195
- {% set treeContent %}
196
- {% if params.type == 'navigation' %}
197
- <nav {%- if params.ariaLabel%} aria-label= "{{params.ariaLabel}}" {% else %} aria-label= "Árbol de navegación" {% endif -%} >
198
- {{ innerHtml | safe }}
199
- </nav>
200
- {% elseif params.type == 'checkbox' or params.type == 'radio' or params.type == undefined %}
201
- {% if params.fieldset %}
202
- {% call componentFieldset({
203
- describedBy: describedBy,
204
- errorId: errorId,
205
- classes: params.fieldset.classes,
206
- attributes: params.fieldset.attributes,
207
- legend: params.fieldset.legend,
208
- headingLevel: params.fieldset.headingLevel
209
- }) %}
210
- {{ innerHtml | safe }}
211
- {% endcall %}
212
- {% else %}
213
- {{ innerHtml | safe }}
214
- {% endif %}
215
- {% endif %}
216
- {% endset %}
206
+ {% set treeContent %}
207
+ {% if params.type == 'navigation' %}
208
+ <nav {%- if params.ariaLabel%} aria-label= "{{params.ariaLabel}}" {% else %} aria-label= "Árbol de navegación" {% endif -%} >
209
+ {{ innerHtml | safe }}
210
+ </nav>
211
+ {% elseif params.type == 'checkbox' or params.type == 'radio' or params.type == undefined %}
212
+ {% if params.fieldset %}
213
+ {% call componentFieldset({
214
+ describedBy: describedBy,
215
+ errorId: errorId,
216
+ classes: params.fieldset.classes,
217
+ attributes: params.fieldset.attributes,
218
+ legend: params.fieldset.legend,
219
+ headingLevel: params.fieldset.headingLevel
220
+ }) %}
221
+ {{ innerHtml | safe }}
222
+ {% endcall %}
223
+ {% else %}
224
+ {{ innerHtml | safe }}
225
+ {% endif %}
226
+ {% endif %}
227
+ {% endset %}
217
228
 
218
- <!-- tree -->
219
- <div class="c-form-group {%- if params.errorMessage %} c-form-group--error{% endif %} {%- if params.formGroup.classes %} {{ params.formGroup.classes }}{% endif %}">
220
- {{ treeContent | indent(2) | safe }}
221
- </div>
222
- <!-- /tree -->
229
+ <!-- tree -->
230
+ <div class="c-form-group {%- if params.errorMessage %} c-form-group--error{% endif %} {%- if params.formGroup.classes %} {{ params.formGroup.classes }}{% endif %}">
231
+ {{ treeContent | indent(2) | safe }}
232
+ </div>
233
+ <!-- /tree -->
@@ -7,6 +7,10 @@ params:
7
7
  type: component
8
8
  required: false
9
9
  description: A searchbar component to filter the items. Inherits all the searchbar component params.
10
+ - name: lazyRendering
11
+ type: boolean
12
+ required: false
13
+ description: If true, the tree enables lazy rendering mode (doesn't paint children nodes until the user unfolds a parent). Defaults to false.
10
14
  - name: ariaLabel
11
15
  type: text
12
16
  required: false