desy-html 8.4.0 → 8.5.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 (77) hide show
  1. package/docs/_include.template-header.njk +3 -1
  2. package/docs/ds/_ds.section.textos.njk +6 -6
  3. package/docs/examples-accordion-history.html +1 -0
  4. package/docs/examples-accordion.html +1 -0
  5. package/docs/examples-alert.html +1 -0
  6. package/docs/examples-breadcrumbs.html +1 -0
  7. package/docs/examples-button-loader.html +1 -0
  8. package/docs/examples-button.html +1 -0
  9. package/docs/examples-card.html +1 -0
  10. package/docs/examples-character-count.html +1 -0
  11. package/docs/examples-checkboxes.html +1 -0
  12. package/docs/examples-collapsible.html +1 -0
  13. package/docs/examples-date-input.html +1 -0
  14. package/docs/examples-description-list.html +1 -0
  15. package/docs/examples-details.html +1 -0
  16. package/docs/examples-dialog.html +1 -0
  17. package/docs/examples-dropdown.html +1 -0
  18. package/docs/examples-error-message.html +1 -0
  19. package/docs/examples-error-summary.html +1 -0
  20. package/docs/examples-fieldset.html +1 -0
  21. package/docs/examples-file-upload.html +1 -0
  22. package/docs/examples-footer.html +1 -0
  23. package/docs/examples-header-advanced.html +1 -0
  24. package/docs/examples-header-mini.html +1 -0
  25. package/docs/examples-header.html +1 -0
  26. package/docs/examples-hint.html +1 -0
  27. package/docs/examples-input-group.html +1 -0
  28. package/docs/examples-input.html +1 -0
  29. package/docs/examples-item.html +1 -0
  30. package/docs/examples-label.html +1 -0
  31. package/docs/examples-links-list.html +1 -0
  32. package/docs/examples-listbox.html +1 -0
  33. package/docs/examples-media-object.html +1 -0
  34. package/docs/examples-menu-horizontal.html +1 -0
  35. package/docs/examples-menu-navigation.html +1 -0
  36. package/docs/examples-menu-vertical.html +1 -0
  37. package/docs/examples-menubar.html +1 -0
  38. package/docs/examples-modal.html +1 -0
  39. package/docs/examples-nav.html +1 -0
  40. package/docs/examples-notification.html +1 -0
  41. package/docs/examples-pagination.html +1 -0
  42. package/docs/examples-pill.html +1 -0
  43. package/docs/examples-radios.html +1 -0
  44. package/docs/examples-searchbar.html +1 -0
  45. package/docs/examples-select.html +1 -0
  46. package/docs/examples-skip-link.html +1 -0
  47. package/docs/examples-spinner.html +1 -0
  48. package/docs/examples-status-item.html +1 -0
  49. package/docs/examples-status.html +1 -0
  50. package/docs/examples-table-advanced.html +1 -0
  51. package/docs/examples-table.html +1 -0
  52. package/docs/examples-tabs.html +1 -0
  53. package/docs/examples-textarea.html +1 -0
  54. package/docs/examples-toggle.html +1 -0
  55. package/docs/examples-tooltip.html +1 -0
  56. package/docs/examples-tree.html +1 -0
  57. package/docs/index.html +12 -0
  58. package/package.json +1 -1
  59. package/src/js/aria/MenuVertical.js +2 -2
  60. package/src/js/aria/Nav.js +2 -2
  61. package/src/js/aria/tabs.js +41 -4
  62. package/src/js/desy-html.js +33 -61
  63. package/src/templates/components/breadcrumbs/_examples.breadcrumbs.njk +33 -0
  64. package/src/templates/components/breadcrumbs/_styles.breadcrumbs.css +10 -0
  65. package/src/templates/components/breadcrumbs/_template.breadcrumbs.njk +4 -0
  66. package/src/templates/components/breadcrumbs/params.breadcrumbs.yaml +4 -0
  67. package/src/templates/components/footer/_examples.footer.njk +1 -1
  68. package/src/templates/components/header/_examples.header.njk +1 -1
  69. package/src/templates/components/header-advanced/_examples.header-advanced.njk +1 -1
  70. package/src/templates/components/links-list/_template.links-list.njk +2 -2
  71. package/src/templates/components/menu-horizontal/_styles.menu-horizontal.css +15 -0
  72. package/src/templates/components/menu-horizontal/_template.menu-horizontal.njk +4 -3
  73. package/src/templates/components/menu-navigation/_template.menu-navigation.njk +3 -3
  74. package/src/templates/components/menu-vertical/_template.menu-vertical.njk +4 -4
  75. package/src/templates/components/nav/_template.nav.njk +2 -2
  76. package/src/templates/components/tabs/_examples.tabs.njk +9 -2
  77. package/src/templates/components/tree/_examples.tree.njk +94 -0
@@ -80,8 +80,9 @@ export function tabs(aria) {
80
80
 
81
81
  // When a tab is clicked, activateTab is fired to activate it
82
82
  function clickEventListener (event) {
83
- var tab = event.target;
84
- activateTab(tab, false);
83
+ if(!event.target.matches('.c-tabs__link--is-active, .c-tabs__link--is-active strong')) {
84
+ activateTab(event.target, false);
85
+ }
85
86
  };
86
87
 
87
88
  // Handle keydown on tabs
@@ -279,12 +280,48 @@ export function tabs(aria) {
279
280
  function addActiveClass(element) {
280
281
  //Add active class to current tab
281
282
  element.classList.add("c-tabs__link--is-active");
282
- element.firstElementChild.classList.add("text-black");
283
+ element.setAttribute('role', 'tab');
284
+ element.innerHTML = `<strong class="font-bold">${element.textContent}</strong>`;
283
285
  }
284
286
 
285
287
  function removeActiveClass(element) {
286
288
  element.classList.remove("c-tabs__link--is-active");
287
- element.firstElementChild.classList.remove("text-black");
289
+ element.removeAttribute('role');
290
+ element.innerHTML = element.textContent;
288
291
  }
292
+
293
+ window.activateItemTabs = function (menuId, tabItemId) {
294
+ const menu = document.getElementById(menuId);
295
+ if (menu) {
296
+ const activeItemTab = document.querySelector(`#${menuId} #${tabItemId}`);
297
+ const activeItemPanel = document.querySelector(`[aria-labelledby="${tabItemId}"]`);
298
+ if (activeItemTab) {
299
+ document.querySelectorAll('.c-tabs__link').forEach((tab) => {
300
+ tab.classList.remove("c-tabs__link--is-active");
301
+ tab.innerHTML = tab.textContent;
302
+ })
303
+
304
+ activeItemTab.classList.add("c-tabs__link--is-active");
305
+ activeItemTab.setAttribute('role', 'tab');
306
+ activeItemTab.innerHTML = `<strong class="font-bold">${activeItemTab.textContent}</strong>`;
307
+
308
+ document.querySelectorAll('.c-tabs__panel').forEach((panel) => {
309
+ panel.setAttribute('hidden', 'hidden')
310
+ })
311
+
312
+ activeItemPanel.removeAttribute('hidden');
313
+
314
+ return [menu, activeItemTab, activeItemPanel];
315
+
316
+ } else {
317
+ console.log('There is no element with this id in the menu.');
318
+ return null;
319
+ }
320
+ } else {
321
+ console.log('There is no menu with this id in the document.');
322
+ return null;
323
+ }
324
+ };
289
325
  }
326
+
290
327
  }
@@ -221,53 +221,37 @@ export function menubarComponent(aria) {
221
221
  PopupMenuAction(aria);
222
222
  MenubarItemAction(aria);
223
223
  MenubarAction(aria);
224
- const modules = document.querySelectorAll('[data-module]');
225
- for (const item in modules) if (modules.hasOwnProperty(item)) {
226
- const moduleValue = modules[item].getAttribute('data-module');
227
-
228
- if (moduleValue == 'c-menubar'){
229
- const menubar = new aria.MenubarAction(modules[item]);
230
- menubar.init(null);
231
- }
232
- }
224
+ const modules = document.querySelectorAll('[data-module="c-menubar"]');
225
+ [...modules].forEach((module) => {
226
+ const menubar = new aria.MenubarAction(module);
227
+ menubar.init(null);
228
+ });
233
229
  }
234
230
 
235
231
  export function menuNavigationComponent(aria) {
236
232
  DisclosureNav(aria);
237
- const modules = document.querySelectorAll('[data-module]');
238
- for (const item in modules) if (modules.hasOwnProperty(item)) {
239
- const moduleValue = modules[item].getAttribute('data-module');
240
-
241
- if (moduleValue == 'c-menu-navigation'){
242
- const menuNavigation = new aria.DisclosureNav(modules[item]);
243
- menuNavigation.init();
244
- }
245
- }
233
+ const modules = document.querySelectorAll('[data-module="c-menu-navigation"]');
234
+ [...modules].forEach((module) => {
235
+ const menuNavigation = new aria.DisclosureNav(module);
236
+ menuNavigation.init();
237
+ });
246
238
  }
247
239
 
248
240
  export function tableAdvancedComponent(aria) {
249
241
  utils(aria);
250
242
  dataGrid(aria);
251
- const modules = document.querySelectorAll('[data-module]');
252
- for (const item in modules) if (modules.hasOwnProperty(item)) {
253
- const moduleValue = modules[item].getAttribute('data-module');
254
-
255
- if (moduleValue == 'c-table-advanced'){
256
- const grid = new aria.Grid(modules[item]);
257
- }
258
- }
243
+ const modules = document.querySelectorAll('[data-module="c-table-advanced"]');
244
+ [...modules].forEach((module) => {
245
+ const grid = new aria.Grid(module);
246
+ });
259
247
  }
260
248
 
261
249
  export function tabsComponent(aria) {
262
250
  tabs(aria);
263
- const modules = document.querySelectorAll('[data-module]');
264
- for (const item in modules) if (modules.hasOwnProperty(item)) {
265
- const moduleValue = modules[item].getAttribute('data-module');
266
-
267
- if (moduleValue == 'c-tabs'){
268
- aria.tabsInit(modules[item]);
269
- }
270
- }
251
+ const modules = document.querySelectorAll('[data-module="c-tabs"]');
252
+ [...modules].forEach((module) => {
253
+ aria.tabsInit(module);
254
+ });
271
255
  }
272
256
 
273
257
  export function tooltipComponent(aria) {
@@ -383,39 +367,27 @@ export function checkBoxComponent(aria) {
383
367
 
384
368
  export function MenuVerticalComponent(aria) {
385
369
  MenuVertical(aria);
386
- const modules = document.querySelectorAll('[data-module]');
387
- for (const item in modules) if (modules.hasOwnProperty(item)) {
388
- const moduleValue = modules[item].getAttribute('data-module');
389
-
390
- if (moduleValue == 'c-menu-vertical'){
391
- const menuVertical = new aria.MenuVertical(modules[item]);
392
- menuVertical.init(null);
393
- }
394
- }
370
+ const modules = document.querySelectorAll('[data-module="c-menu-vertical"]');
371
+ [...modules].forEach((module) => {
372
+ const menuVertical = new aria.MenuVertical(module);
373
+ menuVertical.init(null);
374
+ });
395
375
  }
396
376
 
397
377
  export function HeaderNavigationComponent(aria) {
398
378
  HeaderNavigation(aria);
399
- const modules = document.querySelectorAll('[data-module]');
400
- for (const item in modules) if (modules.hasOwnProperty(item)) {
401
- const moduleValue = modules[item].getAttribute('data-module');
402
-
403
- if (moduleValue == 'c-header-navigation'){
404
- const headerNavigation = new aria.HeaderNavigation(modules[item]);
405
- headerNavigation.init(null);
406
- }
407
- }
379
+ const modules = document.querySelectorAll('[data-module="c-header-navigation"]');
380
+ [...modules].forEach((module) => {
381
+ const headerNavigation = new aria.HeaderNavigation(module);
382
+ headerNavigation.init(null);
383
+ });
408
384
  }
409
385
 
410
386
  export function NavComponent(aria) {
411
387
  Nav(aria);
412
- const modules = document.querySelectorAll('[data-module]');
413
- for (const item in modules) if (modules.hasOwnProperty(item)) {
414
- const moduleValue = modules[item].getAttribute('data-module');
415
-
416
- if (moduleValue == 'c-nav'){
417
- const nav = new aria.Nav(modules[item]);
418
- nav.init(null);
419
- }
420
- }
388
+ const modules = document.querySelectorAll('[data-module="c-nav"]');
389
+ [...modules].forEach((module) => {
390
+ const nav = new aria.Nav(module);
391
+ nav.init(null);
392
+ });
421
393
  }
@@ -152,6 +152,39 @@
152
152
  ]
153
153
  }
154
154
  },
155
+ {
156
+ "name": "con inline en móvil",
157
+ "description": "Mirar en anchuras pequeñas para ver cómo se genera un salto de línea si el texto no cabe.",
158
+ "data": {
159
+ "inlineOnMobile": true,
160
+ "items": [
161
+ {
162
+ "text": "Inicio",
163
+ "href": "/"
164
+ },
165
+ {
166
+ "text": "Trámites",
167
+ "href": "/tramites/"
168
+ },
169
+ {
170
+ "text": "Trámites por tema",
171
+ "href": "/tramites/tema/"
172
+ },
173
+ {
174
+ "text": "Actividades industriales y energía",
175
+ "href": "/tramites/tema/actividades-industriales-y-energia/"
176
+ },
177
+ {
178
+ "text": "Actividades industriales",
179
+ "href": "/tramites/tema/actividades-industriales/"
180
+ },
181
+ {
182
+ "text": "Comunicaciones de servicios",
183
+ "href": "/tramites/tema/actividades-industriales/comunicaciones-de-servicios/"
184
+ }
185
+ ]
186
+ }
187
+ },
155
188
  {
156
189
  "name": "con botón atrás",
157
190
  "data": {
@@ -41,6 +41,16 @@
41
41
  }
42
42
 
43
43
 
44
+ .c-breadcrumbs--inline-on-mobile {
45
+ li {
46
+ @apply inline;
47
+ @apply lg:inline-flex;
48
+ @apply leading-loose;
49
+ @apply lg:leading-tight;
50
+ }
51
+ }
52
+
53
+
44
54
  .c-breadcrumbs__backbutton {
45
55
  @apply mr-sm;
46
56
 
@@ -9,6 +9,10 @@
9
9
  {% set classNames = classNames + " c-breadcrumbs--collapse-on-mobile" %}
10
10
  {% endif -%}
11
11
 
12
+ {% if params.inlineOnMobile %}
13
+ {% set classNames = classNames + " c-breadcrumbs--inline-on-mobile" %}
14
+ {% endif -%}
15
+
12
16
  {# This verbose statement is for Purgecss to match the classnames needed. Purgecss needs explicit entire classnames appear in code, a string concatenation will fail. Eg. lg:grid-cols-max-content-{{ params.items.length if not params.hasBackButton else (params.items.length + 1)}} doesn't compile lg:grid-cols-max-content-1,2,3... #}
13
17
 
14
18
  {% set gridClass %}
@@ -27,6 +27,10 @@ params:
27
27
  type: boolean
28
28
  required: false
29
29
  description: When true, the breadcrumbs will collapse to the first and last item only on tablet breakpoint and below.
30
+ - name: inlineOnMobile
31
+ type: boolean
32
+ required: false
33
+ description: When true, the breadcrumbs will linebreak if there is needed only on tablet breakpoint and below.
30
34
  - name: hasBackButton
31
35
  type: boolean
32
36
  required: false
@@ -87,7 +87,7 @@
87
87
  "meta": {
88
88
  "html": 'Creado por <a href="https://sda.aragon.es/" class="c-link c-link--neutral">SDA Servicios Digitales de Aragón</a>'
89
89
  },
90
- "urlFeder": "https://www.aragon.es/-/fondo-europeo-de-desarrollo-regional-feder",
90
+ "urlFeder": "https://www.aragon.es/-/fondos-europeos-aragon",
91
91
  "classes": "lg:mt-48"
92
92
  }
93
93
  },
@@ -200,7 +200,7 @@
200
200
  {% set examples = [
201
201
  {
202
202
  "name": "por defecto",
203
- "description": 'El menú por defecto de las aplicaciones de la administración digital tiene un logo que enlaza a la página de inicio y un menu principal de navegación. El menu de navegación se oculta en mobile si no se añaden clases a navigation. El logotipo es simple, sin letras, si la app está diseñada para funcionarios. Junto al logo hay un texto que da nombre a la app en la que estamos. Puedes usar con javascript la función global <code>activateItemHeaderNavigation(elementMenu, idItemSeleccionado)</code> para seleccionar un item de un menú, usando sus ids. Ej: Abre la consola del navegador y escribe <code>activateItemHeaderNavigation("header-nav-item", "header-nav-item-3")</code> para desactivar el item actual y activar el tercer item del header de la página.',
203
+ "description": 'El menú por defecto de las aplicaciones de la administración digital tiene un logo que enlaza a la página de inicio y un menu principal de navegación. El menu de navegación se oculta en mobile si no se añaden clases a navigation. El logotipo es simple, sin letras, si la app está diseñada para funcionarios. Junto al logo hay un texto que da nombre a la app en la que estamos. Puedes usar con javascript la función global <code>activateItemHeaderNavigation(elementMenu, idItemSeleccionado)</code> para seleccionar un item de un menú, usando sus ids. Ej: Abre la consola del navegador y escribe <code>activateItemHeaderNavigation("header-nav-item", "page-catalogo")</code> para desactivar el item actual y activar el tercer item del header de la página.',
204
204
  "data": {
205
205
  "homepageUrl": "/",
206
206
  "idPrefix": "mi-menu",
@@ -627,7 +627,7 @@
627
627
  {% set examples = [
628
628
  {
629
629
  "name": "por defecto",
630
- "description": 'Esta es la cabecera por defecto para sitios web de submarcas del Gobierno de Aragón. Tiene un título que enlaza a la página de inicio. Puedes usar con javascript la función global <code>activateItemHeaderNavigation(elementMenu, idItemSeleccionado)</code> para seleccionar un item de un menú, usando sus ids. Ej: Abre la consola del navegador y escribe <code>activateItemHeaderNavigation("header-nav-item", "header-nav-item-3")</code> para desactivar el item actual y activar el tercer item del header de la página.',
630
+ "description": 'Esta es la cabecera por defecto para sitios web de submarcas del Gobierno de Aragón. Tiene un título que enlaza a la página de inicio. Puedes usar con javascript la función global <code>activateItemHeaderNavigation(elementMenu, idItemSeleccionado)</code> para seleccionar un item de un menú, usando sus ids. Ej: Abre la consola del navegador y escribe <code>activateItemHeaderNavigation("header-nav-item", "page-catalogo")</code> para desactivar el item actual y activar el tercer item del header de la página.',
631
631
  "data": {
632
632
  "title": {
633
633
  "homepageUrl": "/",
@@ -31,7 +31,7 @@
31
31
  {% endif %}
32
32
  <div class="flex-1">
33
33
  {% if item.active %}
34
- <strong>{{ item.html | safe if item.html else item.text }}</strong>
34
+ <strong class="font-bold">{{ item.html | safe if item.html else item.text }}</strong>
35
35
  {% else %}
36
36
  {{ item.html | safe if item.html else item.text }}
37
37
  {% endif %}
@@ -51,7 +51,7 @@
51
51
  {% endif %}
52
52
  <div class="flex-1">
53
53
  {% if item.active %}
54
- <strong>{{ item.html | safe if item.html else item.text }}</strong>
54
+ <strong class="font-bold">{{ item.html | safe if item.html else item.text }}</strong>
55
55
  {% else %}
56
56
  {{ item.html | safe if item.html else item.text }}
57
57
  {% endif %}
@@ -17,6 +17,10 @@
17
17
  @apply lg:border-b-0;
18
18
  @apply lg:rounded-t;
19
19
  @apply no-underline;
20
+
21
+ strong {
22
+ @apply font-normal;
23
+ }
20
24
  }
21
25
  }
22
26
 
@@ -38,6 +42,10 @@
38
42
  @apply border-b-0;
39
43
  @apply rounded-t;
40
44
  @apply no-underline;
45
+
46
+ strong {
47
+ @apply font-normal;
48
+ }
41
49
  }
42
50
 
43
51
  .c-menu-horizontal__link {
@@ -53,6 +61,13 @@
53
61
  @apply text-black;
54
62
  @apply outline-none;
55
63
  }
64
+
65
+ &.c-menu-horizontal__active {
66
+ @apply no-underline;
67
+ &:hover {
68
+ @apply underline;
69
+ }
70
+ }
56
71
  }
57
72
 
58
73
  .c-menu-horizontal--scroll {
@@ -16,9 +16,10 @@
16
16
  {% endif %}
17
17
  <li>
18
18
  {% if item.active %}
19
- <span {%- if id %} id="{{ id }}"{% endif %} class="c-menu-horizontal__active flex items-center relative py-sm lg:px-lg lg:py-base border border-transparent truncate font-semibold {%- if item.classes %} {{ item.classes }}{% endif -%}" {%- if item.title %} title="{{ item.title }}"{% endif %} aria-current="page" {%- for attribute, value in item.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>
20
- <strong>{{ item.html | safe if item.html else item.text }}</strong>
21
- </span>
19
+ <a {%- if id %} id="{{ id }}"{% endif %} href="{{ item.href }}" class="c-menu-horizontal__link c-menu-horizontal__active relative flex items-center py-sm lg:px-lg lg:py-base border border-transparent text-black hover:text-primary-base underline truncate focus:outline-none
20
+ {%- if item.disabled %} no-underline pointer-events-none{% endif -%} {%- if item.classes %} {{ item.classes }}{% endif -%}" {%- if item.title %} title="{{ item.title }}"{% endif -%} {%- if item.disabled %} disabled="disabled" aria-disabled="true" tabindex="-1"{% endif -%} {%- if item.target %} target="{{ item.target }}"{% endif %} aria-current="page" {%- for attribute, value in item.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>
21
+ <strong class="font-bold">{{ item.html | safe if item.html else item.text }}</strong>
22
+ </a>
22
23
  {% else %}
23
24
  <a {%- if id %} id="{{ id }}"{% endif %} href="{{ item.href }}" class="c-menu-horizontal__link relative flex items-center py-sm lg:px-lg lg:py-base border border-transparent text-black hover:text-primary-base underline truncate focus:outline-none
24
25
  {%- if item.disabled %} no-underline pointer-events-none{% endif -%} {%- if item.classes %} {{ item.classes }}{% endif -%}" {%- if item.title %} title="{{ item.title }}"{% endif -%} {%- if item.disabled %} disabled="disabled" aria-disabled="true" tabindex="-1"{% endif -%} {%- if item.target %} target="{{ item.target }}"{% endif %} {%- for attribute, value in item.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>
@@ -51,8 +51,8 @@
51
51
  <li>
52
52
  {% if subitem.href %}
53
53
  {% if subitem.active %}
54
- <span {%- if subitem.id %} id="{{ subId }}"{% endif %} class="flex items-center px-base py-sm text-sm font-semibold {%- if subitem.classes %} {{ subitem.classes }}{% endif -%}" aria-current="page" {{- commonSubItemAttributes | safe }}>
55
- <strong>{{ subitem.html | safe if subitem.html else subitem.text }}</strong>
54
+ <span {%- if subitem.id %} id="{{ subId }}"{% endif %} class="flex items-center px-base py-sm text-sm {%- if subitem.classes %} {{ subitem.classes }}{% endif -%}" aria-current="page" {{- commonSubItemAttributes | safe }}>
55
+ <strong class="font-bold">{{ subitem.html | safe if subitem.html else subitem.text }}</strong>
56
56
  </span>
57
57
  {% else %}
58
58
  <a {%- if subitem.id %} id="{{ subId }}"{% endif %} href="{{ subitem.href }}" class="flex items-center px-base py-sm text-sm hover:bg-primary-base hover:text-white focus:bg-warning-base focus:outline-none focus:shadow-outline-focus focus:text-black{%- if subitem.classes %} {{ subitem.classes }}{% endif -%} {%- if subitem.disabled %} pointer-events-none{% endif -%}" {%- if subitem.disabled %} tabindex="-1"{% endif -%} {%- if subitem.target %} target="{{ subitem.target }}"{% endif %} {{- commonSubItemAttributes | safe }}>
@@ -65,7 +65,7 @@
65
65
  {% else %}
66
66
  <span {%- if subitem.id %} id="{{ subId }}"{% endif %} class="flex items-center px-base py-sm text-sm {%- if subitem.classes %} {{ subitem.classes }}{% endif %} {%- if subitem.active %} font-bold{% endif %} {%- if subitem.active %} font-bold{% endif %}" {%- if subitem.title %} title="{{ subitem.title }}"{% endif %} {%- if subitem.active %} aria-current="page"{% endif %} {%- if subitem.disabled %} aria-disabled="true" tabindex="-1"{% endif %} {%- for attribute, value in subitem.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>
67
67
  {% if subitem.active %}
68
- <strong>{{ subitem.html | safe if subitem.html else subitem.text }}</strong>
68
+ <strong class="font-bold">{{ subitem.html | safe if subitem.html else subitem.text }}</strong>
69
69
  {% else %}
70
70
  {{ subitem.html | safe if subitem.html else subitem.text }}
71
71
  {% endif %}
@@ -17,7 +17,7 @@
17
17
  {% if item.href %}
18
18
  <a {%- if id %} id="{{ id }}"{% endif %} href="{{ item.href }}" class="block px-xs focus:bg-warning-base focus:outline-none focus:shadow-outline-focus focus:text-black {%- if params.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 -%}>
19
19
  {% if item.active %}
20
- <strong>{{ item.html | safe if item.html else item.text }}</strong>
20
+ <strong class="font-bold">{{ item.html | safe if item.html else item.text }}</strong>
21
21
  {% else %}
22
22
  {{ item.html | safe if item.html else item.text }}
23
23
  {% endif %}
@@ -25,7 +25,7 @@
25
25
  {% else %}
26
26
  <span {%- if id %} id="{{ id }}"{% endif %} class="block px-xs {%- if item.classes %} {{ item.classes }}{% endif %}" {%- if item.title %} title="{{ item.title }}"{% endif %}{%- if item.active %} aria-current="page"{% endif %} {% if item.disabled %} aria-disabled="true" tabindex="-1"{% endif %} {%- for attribute, value in item.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>
27
27
  {% if item.active %}
28
- <strong>{{ item.html | safe if item.html else item.text }}</strong>
28
+ <strong class="font-bold">{{ item.html | safe if item.html else item.text }}</strong>
29
29
  {% else %}
30
30
  {{ item.html | safe if item.html else item.text }}
31
31
  {% endif %}
@@ -45,7 +45,7 @@
45
45
  {% if subitem.href %}
46
46
  <a {%- if subId %} id="{{ subId }}"{% endif %} href="{{ subitem.href }}" class="block px-xs hover:text-primary-base hover:underline focus:bg-warning-base focus:outline-none focus:shadow-outline-focus focus:text-black {%- if params.hasUnderline %} underline{% endif %} {%- if subitem.classes %} {{ subitem.classes }}{% endif %} {%- if subitem.disabled %} no-underline pointer-events-none{% endif %}" {%- if subitem.title %} title="{{ subitem.title }}"{% endif %}{%- if subitem.active %} aria-current="page"{% endif %} {% if subitem.disabled %} aria-disabled="true" tabindex="-1"{% endif %} {% if subitem.target %} target="{{ subitem.target }}"{% endif %}{%- for attribute, value in subitem.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>
47
47
  {% if subitem.active %}
48
- <strong>{{ subitem.html | safe if subitem.html else subitem.text }}</strong>
48
+ <strong class="font-bold">{{ subitem.html | safe if subitem.html else subitem.text }}</strong>
49
49
  {% else %}
50
50
  {{ subitem.html | safe if subitem.html else subitem.text }}
51
51
  {% endif %}
@@ -53,7 +53,7 @@
53
53
  {% else %}
54
54
  <span {%- if subId %} id="{{ subId }}"{% endif %} class="block px-xs {%- if subitem.classes %} {{ subitem.classes }}{% endif %}" {%- if subitem.title %} title="{{ subitem.title }}"{% endif %} {%- if subitem.active %} aria-current="page"{% endif %} {%- if subitem.disabled %} aria-disabled="true" tabindex="-1"{% endif %} {%- for attribute, value in subitem.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>
55
55
  {% if subitem.active %}
56
- <strong>{{ subitem.html | safe if subitem.html else subitem.text }}</strong>
56
+ <strong class="font-bold">{{ subitem.html | safe if subitem.html else subitem.text }}</strong>
57
57
  {% else %}
58
58
  {{ subitem.html | safe if subitem.html else subitem.text }}
59
59
  {% endif %}
@@ -19,9 +19,9 @@
19
19
  {% endif %}
20
20
  {% set commonItemAttributes %} {% if id %} id="{{ id }}"{% endif %} {%- if item.title %} title="{{ item.title }}"{% endif %} {%- for attribute, value in item.attributes %} {{ attribute }}="{{ value }}"{% endfor %}{% endset %}
21
21
  <li>
22
- <a href="{{ item.href }}" class="flex items-center px-base py-sm hover:bg-primary-base hover:text-white focus:bg-warning-base focus:outline-none focus:shadow-outline-focus focus:text-black{%- if item.classes %} {{ item.classes }}{% endif -%} {%- if item.disabled %} pointer-events-none{% endif -%}" {%- if item.disabled %} aria-disabled="true" tabindex="-1"{% endif -%} {%- if item.target %} target="{{ item.target }}"{% endif %} {{- commonItemAttributes | safe }}>
22
+ <a href="{{ item.href }}" class="flex items-center px-base py-sm hover:bg-primary-base hover:text-white focus:bg-warning-base focus:outline-none focus:shadow-outline-focus focus:text-black{%- if item.classes %} {{ item.classes }}{% endif -%} {%- if item.disabled %} pointer-events-none{% endif -%}" {%- if item.disabled %} aria-disabled="true" tabindex="-1"{% endif -%} {%- if item.target %} target="{{ item.target }}"{% endif %} {% if item.active %} aria-current="page"{% endif %}{{- commonItemAttributes | safe }}>
23
23
  {% if item.active %}
24
- <strong>{{ item.html | safe if item.html else item.text }}</strong>
24
+ <strong class="font-bold">{{ item.html | safe if item.html else item.text }}</strong>
25
25
  {% else %}
26
26
  {{ item.html | safe if item.html else item.text }}
27
27
  {% endif %}
@@ -30,7 +30,10 @@
30
30
  "html": "<p><strong>Panel 4</strong>. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio? Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur.</p>"
31
31
  }
32
32
  }
33
- ]
33
+ ],
34
+ "attributes": {
35
+ "id": "tabs-default"
36
+ }
34
37
  }
35
38
  },
36
39
  {
@@ -138,6 +141,7 @@
138
141
  },
139
142
  {
140
143
  "name": "con item activo",
144
+ "description": 'Añade <code>active: true</code> a una tab para mostrarla activa inicialmente. También puedes usar con javascript la función global <code>activateItemTabs(elementMenu, idItemSeleccionado)</code> para seleccionar una tab y su panel, usando sus ids. Ej: Abre la consola del navegador y escribe <code>activateItemTabs("tabs-active", "tab-example-active-3")</code> para desactivar la tab actual y activar la tercera tab de este ejemplo.',
141
145
  "data": {
142
146
  "tablistAriaLabel": "Ejemplo de tab",
143
147
  "idPrefix": "tab-example-active",
@@ -167,7 +171,10 @@
167
171
  "html": "<p><strong>Panel 4</strong>. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio? Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur.</p>"
168
172
  }
169
173
  }
170
- ]
174
+ ],
175
+ "attributes": {
176
+ "id": "tabs-active"
177
+ }
171
178
  }
172
179
  },
173
180
  {
@@ -1450,6 +1450,100 @@
1450
1450
  ]
1451
1451
  }
1452
1452
  },
1453
+ {
1454
+ "name": "con searchbar y scroll en el contenedor de árbol",
1455
+ "description": 'Puedes usar las clases de CSS: <code>max-h-64</code> o <code>max-h-40</code> junto a <code>overflow-y-auto</code>, para poner barras de scroll al árbol en caso de que su altura sea muy grande o bien cuando la altura crezca debido a que los items sean expandidos por el usuario.',
1456
+ "data": {
1457
+ "name": "with-searchbar-scroll",
1458
+ "classes": "mt-base max-h-64 overflow-y-auto",
1459
+ "fieldset": {
1460
+ "legend": {
1461
+ "text": "Selecciona organismo"
1462
+ }
1463
+ },
1464
+ "searchbar": {
1465
+ "id": "with-searchbar-scroll-searchbar",
1466
+ "label": {
1467
+ "text": "Buscar"
1468
+ },
1469
+ "placeholder": "Buscar organismo"
1470
+ },
1471
+ "items": [
1472
+ {
1473
+ "text": "Item 1",
1474
+ "id": "with-searchbar-scroll-item-1",
1475
+ "expanded": true,
1476
+ "sub": {
1477
+ "items": [
1478
+ {
1479
+ "text": "Subitem 1",
1480
+ "value": "subitem-1"
1481
+ },
1482
+ {
1483
+ "text": "Subitem 2",
1484
+ "value": "subitem-2"
1485
+ },
1486
+ {
1487
+ "text": "Subitem 3",
1488
+ "value": "subitem-3"
1489
+ }
1490
+ ],
1491
+ "attributes": {
1492
+ "aria-labelledby": "with-searchbar-scroll-item-1"
1493
+ }
1494
+ }
1495
+ },
1496
+ {
1497
+ "text": "Item 2",
1498
+ "id": "with-searchbar-scroll-item-2",
1499
+ "expanded": true,
1500
+ "sub": {
1501
+ "items": [
1502
+ {
1503
+ "text": "Subitem 1",
1504
+ "value": "subitem-1"
1505
+ },
1506
+ {
1507
+ "text": "Subitem 2",
1508
+ "value": "subitem-2"
1509
+ },
1510
+ {
1511
+ "text": "Subitem 3",
1512
+ "value": "subitem-3"
1513
+ }
1514
+ ],
1515
+ "attributes": {
1516
+ "aria-labelledby": "with-searchbar-scroll-item-2"
1517
+ }
1518
+ }
1519
+ },
1520
+ {
1521
+ "text": "Item 3",
1522
+ "id": "with-searchbar-scroll-item-3",
1523
+ "expanded": true,
1524
+ "sub": {
1525
+ "items": [
1526
+ {
1527
+ "text": "Subitem 1",
1528
+ "value": "subitem-1"
1529
+ },
1530
+ {
1531
+ "text": "Subitem 2",
1532
+ "value": "subitem-2"
1533
+ },
1534
+ {
1535
+ "text": "Subitem 3",
1536
+ "value": "subitem-3"
1537
+ }
1538
+ ],
1539
+ "attributes": {
1540
+ "aria-labelledby": "with-searchbar-scroll-item-3"
1541
+ }
1542
+ }
1543
+ }
1544
+ ]
1545
+ }
1546
+ },
1453
1547
  {
1454
1548
  "name": "peque",
1455
1549
  "description": "Con clases aplicadas.",