desy-html 5.0.1 → 5.2.1

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 (30) hide show
  1. package/docs/_include.template-header.njk +8 -0
  2. package/docs/_macro.example-render.njk +8 -0
  3. package/docs/componentes.html +6 -0
  4. package/docs/ds/_ds.example.menu-vertical.njk +3 -3
  5. package/docs/ds/_ds.example.toggle.njk +56 -0
  6. package/docs/ds/_ds.example.tree.njk +457 -0
  7. package/docs/ds/_ds.section.forms.njk +5 -0
  8. package/docs/ds/_ds.section.mostrar-ocultar.njk +5 -0
  9. package/docs/examples-toggle.html +5 -0
  10. package/docs/examples-tree.html +5 -0
  11. package/docs/index.html +20 -1
  12. package/package.json +1 -1
  13. package/src/css/styles.css +1 -0
  14. package/src/js/aria/tree.js +245 -0
  15. package/src/js/aria/treeitem.js +260 -0
  16. package/src/js/desy-html.js +28 -0
  17. package/src/js/index.js +3 -1
  18. package/src/templates/components/checkboxes/_template.checkboxes.njk +1 -2
  19. package/src/templates/components/menubar/_examples.menubar.njk +169 -0
  20. package/src/templates/components/pagination/_examples.pagination.njk +32 -0
  21. package/src/templates/components/pagination/_template.pagination.njk +1 -0
  22. package/src/templates/components/toggle/_examples.toggle.njk +52 -0
  23. package/src/templates/components/toggle/_macro.toggle.njk +3 -0
  24. package/src/templates/components/toggle/_template.toggle.njk +37 -0
  25. package/src/templates/components/toggle/params.toggle.yaml +57 -0
  26. package/src/templates/components/tree/_examples.tree.njk +1171 -0
  27. package/src/templates/components/tree/_macro.tree.njk +3 -0
  28. package/src/templates/components/tree/_styles.tree.css +45 -0
  29. package/src/templates/components/tree/_template.tree.njk +178 -0
  30. package/src/templates/components/tree/params.tree.yaml +163 -0
@@ -0,0 +1,1171 @@
1
+ {% set exampleComponent = "tree" %}
2
+ {% set examples = [
3
+ {
4
+ "name": "default",
5
+ "data": {
6
+ "name": "default",
7
+ "classes": "mt-base",
8
+ "fieldset": {
9
+ "legend": {
10
+ "text": "Selecciona organismo"
11
+ }
12
+ },
13
+ "items": [
14
+ {
15
+ "text": "Item 1",
16
+ "value": "item-1"
17
+ },
18
+ {
19
+ "text": "Item 2",
20
+ "value": "item-2"
21
+ },
22
+ {
23
+ "text": "Item 3",
24
+ "value": "item-2"
25
+ }
26
+ ]
27
+ }
28
+ },
29
+ {
30
+ "name": "type checkbox",
31
+ "data": {
32
+ "name": "type-checkbox",
33
+ "classes": "mt-base",
34
+ "type": "checkbox",
35
+ "fieldset": {
36
+ "legend": {
37
+ "text": "Selecciona organismo"
38
+ }
39
+ },
40
+ "items": [
41
+ {
42
+ "text": "Item 1",
43
+ "value": "item-1"
44
+ },
45
+ {
46
+ "text": "Item 2",
47
+ "value": "item-2"
48
+ },
49
+ {
50
+ "text": "Item 3",
51
+ "value": "item-2"
52
+ }
53
+ ]
54
+ }
55
+ },
56
+ {
57
+ "name": "with hint and error",
58
+ "data": {
59
+ "name": "with-hint-and-error",
60
+ "classes": "mt-base",
61
+ "fieldset": {
62
+ "legend": {
63
+ "text": "Selecciona organismo"
64
+ }
65
+ },
66
+ "hint": {
67
+ "text": "Selecciona el organismo al que perteneces."
68
+ },
69
+ "errorMessage": {
70
+ "text": "Error: No tienes permiso para seleccionar ese organismo."
71
+ },
72
+ "items": [
73
+ {
74
+ "text": "Item 1",
75
+ "value": "item-1"
76
+ },
77
+ {
78
+ "text": "Item 2",
79
+ "value": "item-2",
80
+ "checked": true
81
+ },
82
+ {
83
+ "text": "Item 3",
84
+ "value": "item-2"
85
+ }
86
+ ]
87
+ }
88
+ },
89
+ {
90
+ "name": "with disabled item",
91
+ "data": {
92
+ "name": "with-disabled-item",
93
+ "classes": "mt-base",
94
+ "fieldset": {
95
+ "legend": {
96
+ "text": "Selecciona organismo"
97
+ }
98
+ },
99
+ "hint": {
100
+ "text": "Selecciona el organismo al que perteneces."
101
+ },
102
+ "items": [
103
+ {
104
+ "text": "Item 1",
105
+ "value": "item-1"
106
+ },
107
+ {
108
+ "text": "Item 2",
109
+ "value": "item-2"
110
+ },
111
+ {
112
+ "text": "Item 3",
113
+ "value": "item-3",
114
+ "disabled": true
115
+ }
116
+ ]
117
+ }
118
+ },
119
+ {
120
+ "name": "with active item",
121
+ "data": {
122
+ "name": "with-active-item",
123
+ "classes": "mt-base",
124
+ "fieldset": {
125
+ "legend": {
126
+ "text": "Selecciona organismo"
127
+ }
128
+ },
129
+ "hint": {
130
+ "text": "Selecciona el organismo al que perteneces."
131
+ },
132
+ "items": [
133
+ {
134
+ "text": "Item 1",
135
+ "value": "item-1"
136
+ },
137
+ {
138
+ "text": "Item 2",
139
+ "value": "item-2",
140
+ "active": true
141
+ },
142
+ {
143
+ "text": "Item 3",
144
+ "value": "item-3"
145
+ }
146
+ ]
147
+ }
148
+ },
149
+ {
150
+ "name": "with hints on items",
151
+ "data": {
152
+ "name": "with-hints-on-items",
153
+ "classes": "mt-base",
154
+ "fieldset": {
155
+ "legend": {
156
+ "text": "Selecciona organismo"
157
+ }
158
+ },
159
+ "items": [
160
+ {
161
+ "text": "Item 1",
162
+ "value": "item-1",
163
+ "hint": {
164
+ "text": "Hint on item"
165
+ }
166
+ },
167
+ {
168
+ "text": "Item 2",
169
+ "value": "item-2",
170
+ "hint": {
171
+ "text": "Hint on item"
172
+ }
173
+
174
+ },
175
+ {
176
+ "text": "Item 3",
177
+ "value": "item-2",
178
+ "hint": {
179
+ "text": "Hint on item"
180
+ }
181
+
182
+ }
183
+ ]
184
+ }
185
+ },
186
+ {
187
+ "name": "with very long option text",
188
+ "data": {
189
+ "name": "with-very-long-option-text",
190
+ "classes": "mt-base",
191
+ "fieldset": {
192
+ "legend": {
193
+ "text": "Selecciona organismo"
194
+ }
195
+ },
196
+ "hint": {
197
+ "text": "Selecciona el organismo al que perteneces."
198
+ },
199
+ "items": [
200
+ {
201
+ "text": "Nullam id dolor id nibh ultricies vehicula ut id elit. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Maecenas faucibus mollis interdum. Donec id elit non mi porta gravida at eget metus.",
202
+ "value": "item-1"
203
+ },
204
+ {
205
+ "text": "Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Donec sed odio dui. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Cras mattis consectetur purus sit amet fermentum.",
206
+ "value": "item-2"
207
+ },
208
+ {
209
+ "text": "Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Etiam porta sem malesuada magna mollis euismod. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. Sed posuere consectetur est at lobortis.",
210
+ "value": "item-3"
211
+ }
212
+ ]
213
+ }
214
+ },
215
+ {
216
+ "name": "with legend as page heading",
217
+ "data": {
218
+ "name": "with-legend-as-page-heading",
219
+ "fieldset": {
220
+ "legend": {
221
+ "text": "Selecciona organismo",
222
+ "classes": "c-h2",
223
+ "isPageHeading": true
224
+ },
225
+ "headingLevel": 2
226
+ },
227
+ "items": [
228
+ {
229
+ "text": "Item 1",
230
+ "value": "item-1"
231
+ },
232
+ {
233
+ "text": "Item 2",
234
+ "value": "item-2"
235
+ },
236
+ {
237
+ "text": "Item 3",
238
+ "value": "item-2"
239
+ }
240
+ ]
241
+ }
242
+ },
243
+ {
244
+ "name": "without fieldset",
245
+ "data": {
246
+ "name": "without-fieldset",
247
+ "items": [
248
+ {
249
+ "text": "Item 1",
250
+ "value": "item-1"
251
+ },
252
+ {
253
+ "text": "Item 2",
254
+ "value": "item-2"
255
+ },
256
+ {
257
+ "text": "Item 3",
258
+ "value": "item-2"
259
+ }
260
+ ]
261
+ }
262
+ },
263
+ {
264
+ "name": "with all parent items",
265
+ "data": {
266
+ "name": "with-all-parent-items",
267
+ "classes": "mt-base",
268
+ "type": "checkbox",
269
+ "fieldset": {
270
+ "legend": {
271
+ "text": "Selecciona organismo"
272
+ }
273
+ },
274
+ "hint": {
275
+ "text": "Selecciona el organismo al que perteneces."
276
+ },
277
+ "idPrefix": "parent-example",
278
+ "items": [
279
+ {
280
+ "text": "Item 1",
281
+ "id": "parent-example-item-1",
282
+ "sub": {
283
+ "items": [
284
+ {
285
+ "text": "Subitem 1",
286
+ "value": "subitem-1"
287
+ },
288
+ {
289
+ "text": "Subitem 2",
290
+ "value": "subitem-2"
291
+ },
292
+ {
293
+ "text": "Subitem 3",
294
+ "value": "subitem-3"
295
+ }
296
+ ],
297
+ "attributes": {
298
+ "aria-labelledby": "parent-example-item-1"
299
+ }
300
+ }
301
+ },
302
+ {
303
+ "text": "Item 2",
304
+ "id": "parent-example-item-2",
305
+ "sub": {
306
+ "items": [
307
+ {
308
+ "text": "Subitem 1",
309
+ "value": "subitem-1"
310
+ },
311
+ {
312
+ "text": "Subitem 2",
313
+ "value": "subitem-2"
314
+ },
315
+ {
316
+ "text": "Subitem 3",
317
+ "value": "subitem-3"
318
+ }
319
+ ],
320
+ "attributes": {
321
+ "aria-labelledby": "parent-example-item-2"
322
+ }
323
+ }
324
+ },
325
+ {
326
+ "text": "Item 3",
327
+ "id": "parent-example-item-3",
328
+ "sub": {
329
+ "items": [
330
+ {
331
+ "text": "Subitem 1",
332
+ "value": "subitem-1"
333
+ },
334
+ {
335
+ "text": "Subitem 2",
336
+ "value": "subitem-2"
337
+ },
338
+ {
339
+ "text": "Subitem 3",
340
+ "value": "subitem-3"
341
+ }
342
+ ],
343
+ "attributes": {
344
+ "aria-labelledby": "parent-example-item-3"
345
+ }
346
+ }
347
+ }
348
+ ]
349
+ }
350
+ },
351
+ {
352
+ "name": "with a parent item opened",
353
+ "description": "expanded: true",
354
+ "data": {
355
+ "name": "with-a-parent-item-opened",
356
+ "classes": "mt-base",
357
+ "fieldset": {
358
+ "legend": {
359
+ "text": "Selecciona organismo"
360
+ }
361
+ },
362
+ "hint": {
363
+ "text": "Selecciona el organismo al que perteneces."
364
+ },
365
+ "idPrefix": "tree-item",
366
+ "items": [
367
+ {
368
+ "text": "Item 1",
369
+ "id": "tree-item-item-1",
370
+ "sub": {
371
+ "items": [
372
+ {
373
+ "text": "Subitem 1",
374
+ "value": "subitem-1"
375
+ },
376
+ {
377
+ "text": "Subitem 2",
378
+ "value": "subitem-2"
379
+ },
380
+ {
381
+ "text": "Subitem 3",
382
+ "value": "subitem-3"
383
+ }
384
+ ],
385
+ "attributes": {
386
+ "aria-labelledby": "tree-item-item-1"
387
+ }
388
+ }
389
+ },
390
+ {
391
+ "text": "Item 2",
392
+ "id": "tree-item-item-2",
393
+ "expanded": true,
394
+ "sub": {
395
+ "items": [
396
+ {
397
+ "text": "Subitem 1",
398
+ "value": "subitem-1"
399
+ },
400
+ {
401
+ "text": "Subitem 2",
402
+ "value": "subitem-2"
403
+ },
404
+ {
405
+ "text": "Subitem 3",
406
+ "value": "subitem-3"
407
+ }
408
+ ],
409
+ "attributes": {
410
+ "aria-labelledby": "tree-item-item-2"
411
+ }
412
+ }
413
+ },
414
+ {
415
+ "text": "Item 3",
416
+ "id": "tree-item-item-3",
417
+ "sub": {
418
+ "items": [
419
+ {
420
+ "text": "Subitem 1",
421
+ "value": "subitem-1"
422
+ },
423
+ {
424
+ "text": "Subitem 2",
425
+ "value": "subitem-2"
426
+ },
427
+ {
428
+ "text": "Subitem 3",
429
+ "value": "subitem-3"
430
+ }
431
+ ],
432
+ "attributes": {
433
+ "aria-labelledby": "tree-item-item-3"
434
+ }
435
+ }
436
+ }
437
+ ]
438
+ }
439
+ },
440
+ {
441
+ "name": "with many depth levels",
442
+ "data": {
443
+ "name": "with-many-depth-levels",
444
+ "classes": "mt-base",
445
+ "fieldset": {
446
+ "legend": {
447
+ "text": "Selecciona organismo"
448
+ }
449
+ },
450
+ "hint": {
451
+ "text": "Selecciona el organismo al que perteneces."
452
+ },
453
+ "idPrefix": "tree-item-nodes",
454
+ "items": [
455
+ {
456
+ "text": "Item 1",
457
+ "sub": {
458
+ "items": [
459
+ {
460
+ "text": "Subitem 1",
461
+ "value": "subitem-1"
462
+ },
463
+ {
464
+ "text": "Subitem 2",
465
+ "value": "subitem-2"
466
+ },
467
+ {
468
+ "text": "Subitem 3",
469
+ "value": "subitem-3"
470
+ }
471
+ ]
472
+ }
473
+ },
474
+ {
475
+ "text": "Item 2",
476
+ "sub": {
477
+ "items": [
478
+ {
479
+ "text": "Subitem 1",
480
+ "value": "subitem-1"
481
+ },
482
+ {
483
+ "text": "Subitem 2",
484
+ "value": "subitem-2"
485
+ },
486
+ {
487
+ "text": "Subitem 3",
488
+ "value": "subitem-3"
489
+ }
490
+ ]
491
+ }
492
+ },
493
+ {
494
+ "text": "Item 3",
495
+ "expanded": true,
496
+ "sub": {
497
+ "items": [
498
+ {
499
+ "text": "Subitem 1",
500
+ "sub": {
501
+ "items": [
502
+ {
503
+ "text": "Subitem 1",
504
+ "value": "subitem-1"
505
+ },
506
+ {
507
+ "text": "Subitem 2",
508
+ "value": "subitem-2"
509
+ },
510
+ {
511
+ "text": "Subitem 3",
512
+ "value": "subitem-3"
513
+ }
514
+ ]
515
+ }
516
+ },
517
+ {
518
+ "text": "Subitem 2",
519
+ "sub": {
520
+ "items": [
521
+ {
522
+ "text": "Subitem 1",
523
+ "value": "subitem-1"
524
+ },
525
+ {
526
+ "text": "Subitem 2",
527
+ "value": "subitem-2"
528
+ },
529
+ {
530
+ "text": "Subitem 3",
531
+ "value": "subitem-3"
532
+ }
533
+ ]
534
+ }
535
+ },
536
+ {
537
+ "text": "Subitem 3",
538
+ "expanded": true,
539
+ "sub": {
540
+ "items": [
541
+ {
542
+ "text": "Subitem 1",
543
+ "value": "subitem-1"
544
+ },
545
+ {
546
+ "text": "Subitem 2",
547
+ "value": "subitem-2"
548
+ },
549
+ {
550
+ "text": "Subitem 3",
551
+ "value": "subitem-3",
552
+ "expanded": true,
553
+ "sub": {
554
+ "items": [
555
+ {
556
+ "text": "Subitem 1",
557
+ "sub": {
558
+ "items": [
559
+ {
560
+ "text": "Subitem 1",
561
+ "value": "subitem-1"
562
+ },
563
+ {
564
+ "text": "Subitem 2",
565
+ "value": "subitem-2"
566
+ },
567
+ {
568
+ "text": "Subitem 3",
569
+ "value": "subitem-3"
570
+ }
571
+ ]
572
+ }
573
+ },
574
+ {
575
+ "text": "Subitem 2",
576
+ "sub": {
577
+ "items": [
578
+ {
579
+ "text": "Subitem 1",
580
+ "value": "subitem-1"
581
+ },
582
+ {
583
+ "text": "Subitem 2",
584
+ "value": "subitem-2"
585
+ },
586
+ {
587
+ "text": "Subitem 3",
588
+ "value": "subitem-3"
589
+ }
590
+ ]
591
+ }
592
+ },
593
+ {
594
+ "text": "Subitem 3",
595
+ "expanded": true,
596
+ "sub": {
597
+ "items": [
598
+ {
599
+ "text": "Subitem 1",
600
+ "value": "subitem-1"
601
+ },
602
+ {
603
+ "text": "Subitem 2",
604
+ "value": "subitem-2"
605
+ },
606
+ {
607
+ "text": "Subitem 3",
608
+ "value": "subitem-3"
609
+ }
610
+ ]
611
+ }
612
+ }
613
+ ]
614
+ }
615
+ }
616
+ ]
617
+ }
618
+ }
619
+ ]
620
+ }
621
+ }
622
+ ]
623
+ }
624
+ },
625
+ {
626
+ "name": "indeterminate",
627
+ "data": {
628
+ "name": "indeterminate",
629
+ "classes": "mt-base",
630
+ "type": "checkbox",
631
+ "fieldset": {
632
+ "legend": {
633
+ "text": "Selecciona organismo"
634
+ }
635
+ },
636
+ "hint": {
637
+ "text": "Selecciona el organismo al que perteneces."
638
+ },
639
+ "idPrefix": "indeterminate-example",
640
+ "items": [
641
+ {
642
+ "text": "Item 1",
643
+ "id": "indeterminate-example-item-1",
644
+ "isIndeterminate": true,
645
+ "sub": {
646
+ "items": [
647
+ {
648
+ "text": "Subitem 1",
649
+ "value": "subitem-1"
650
+ },
651
+ {
652
+ "text": "Subitem 2",
653
+ "value": "subitem-2"
654
+ },
655
+ {
656
+ "text": "Subitem 3",
657
+ "value": "subitem-3"
658
+ }
659
+ ],
660
+ "attributes": {
661
+ "aria-labelledby": "indeterminate-example-item-1"
662
+ }
663
+ }
664
+ },
665
+ {
666
+ "text": "Item 2",
667
+ "id": "indeterminate-example-item-2",
668
+ "isIndeterminate": true,
669
+ "indeterminateChecked": true,
670
+ "checked": false,
671
+ "expanded": true,
672
+ "sub": {
673
+ "items": [
674
+ {
675
+ "text": "Subitem 1",
676
+ "value": "subitem-1"
677
+ },
678
+ {
679
+ "text": "Subitem 2",
680
+ "value": "subitem-2",
681
+ "checked": true
682
+ },
683
+ {
684
+ "text": "Subitem 3",
685
+ "value": "subitem-3"
686
+ }
687
+ ],
688
+ "attributes": {
689
+ "aria-labelledby": "indeterminate-example-item-2"
690
+ }
691
+ }
692
+ },
693
+ {
694
+ "text": "Item 3",
695
+ "id": "indeterminate-example-item-3",
696
+ "isIndeterminate": true,
697
+ "sub": {
698
+ "items": [
699
+ {
700
+ "text": "Subitem 1",
701
+ "value": "subitem-1"
702
+ },
703
+ {
704
+ "text": "Subitem 2",
705
+ "value": "subitem-2"
706
+ },
707
+ {
708
+ "text": "Subitem 3",
709
+ "value": "subitem-3"
710
+ }
711
+ ],
712
+ "attributes": {
713
+ "aria-labelledby": "indeterminate-example-item-3"
714
+ }
715
+ }
716
+ }
717
+ ]
718
+ }
719
+ },
720
+ {
721
+ "name": "with searchbar",
722
+ "data": {
723
+ "name": "with-searchbar",
724
+ "classes": "mt-base",
725
+ "fieldset": {
726
+ "legend": {
727
+ "text": "Selecciona organismo"
728
+ }
729
+ },
730
+ "searchbar": {
731
+ "id": "with-searchbar-searchbar",
732
+ "label": {
733
+ "text": "Buscar"
734
+ },
735
+ "placeholder": "Buscar organismo"
736
+ },
737
+ "items": [
738
+ {
739
+ "text": "Item 1",
740
+ "id": "with-searchbar-item-1",
741
+ "sub": {
742
+ "items": [
743
+ {
744
+ "text": "Subitem 1",
745
+ "value": "subitem-1"
746
+ },
747
+ {
748
+ "text": "Subitem 2",
749
+ "value": "subitem-2"
750
+ },
751
+ {
752
+ "text": "Subitem 3",
753
+ "value": "subitem-3"
754
+ }
755
+ ],
756
+ "attributes": {
757
+ "aria-labelledby": "with-searchbar-item-1"
758
+ }
759
+ }
760
+ },
761
+ {
762
+ "text": "Item 2",
763
+ "id": "with-searchbar-item-2",
764
+ "sub": {
765
+ "items": [
766
+ {
767
+ "text": "Subitem 1",
768
+ "value": "subitem-1"
769
+ },
770
+ {
771
+ "text": "Subitem 2",
772
+ "value": "subitem-2"
773
+ },
774
+ {
775
+ "text": "Subitem 3",
776
+ "value": "subitem-3"
777
+ }
778
+ ],
779
+ "attributes": {
780
+ "aria-labelledby": "with-searchbar-item-2"
781
+ }
782
+ }
783
+ },
784
+ {
785
+ "text": "Item 3",
786
+ "id": "with-searchbar-item-3",
787
+ "sub": {
788
+ "items": [
789
+ {
790
+ "text": "Subitem 1",
791
+ "value": "subitem-1"
792
+ },
793
+ {
794
+ "text": "Subitem 2",
795
+ "value": "subitem-2"
796
+ },
797
+ {
798
+ "text": "Subitem 3",
799
+ "value": "subitem-3"
800
+ }
801
+ ],
802
+ "attributes": {
803
+ "aria-labelledby": "with-searchbar-item-3"
804
+ }
805
+ }
806
+ }
807
+ ]
808
+ }
809
+ },
810
+ {
811
+ "name": "with searchbar error",
812
+ "data": {
813
+ "name": "with-searchbar-error",
814
+ "classes": "mt-base",
815
+ "fieldset": {
816
+ "legend": {
817
+ "text": "Selecciona organismo"
818
+ }
819
+ },
820
+ "searchbar": {
821
+ "id": "with-searchbar-error-searchbar",
822
+ "label": {
823
+ "text": "Buscar"
824
+ },
825
+ "placeholder": "Buscar organismo",
826
+ "errorMessage": {
827
+ "text": "Error: Introduce al menos un carácter",
828
+ "classes": "mt-xs"
829
+ }
830
+ },
831
+ "items": [
832
+ {
833
+ "text": "Item 1",
834
+ "id": "with-searchbar-error-item-1",
835
+ "sub": {
836
+ "items": [
837
+ {
838
+ "text": "Subitem 1",
839
+ "value": "subitem-1"
840
+ },
841
+ {
842
+ "text": "Subitem 2",
843
+ "value": "subitem-2"
844
+ },
845
+ {
846
+ "text": "Subitem 3",
847
+ "value": "subitem-3"
848
+ }
849
+ ],
850
+ "attributes": {
851
+ "aria-labelledby": "with-searchbar-error-item-1"
852
+ }
853
+ }
854
+ },
855
+ {
856
+ "text": "Item 2",
857
+ "id": "with-searchbar-error-item-2",
858
+ "sub": {
859
+ "items": [
860
+ {
861
+ "text": "Subitem 1",
862
+ "value": "subitem-1"
863
+ },
864
+ {
865
+ "text": "Subitem 2",
866
+ "value": "subitem-2"
867
+ },
868
+ {
869
+ "text": "Subitem 3",
870
+ "value": "subitem-3"
871
+ }
872
+ ],
873
+ "attributes": {
874
+ "aria-labelledby": "with-searchbar-error-item-2"
875
+ }
876
+ }
877
+ },
878
+ {
879
+ "text": "Item 3",
880
+ "id": "with-searchbar-error-item-3",
881
+ "sub": {
882
+ "items": [
883
+ {
884
+ "text": "Subitem 1",
885
+ "value": "subitem-1"
886
+ },
887
+ {
888
+ "text": "Subitem 2",
889
+ "value": "subitem-2"
890
+ },
891
+ {
892
+ "text": "Subitem 3",
893
+ "value": "subitem-3"
894
+ }
895
+ ],
896
+ "attributes": {
897
+ "aria-labelledby": "with-searchbar-error-item-3"
898
+ }
899
+ }
900
+ }
901
+ ]
902
+ }
903
+ },
904
+ {
905
+ "name": "small",
906
+ "description": "with classes applied",
907
+ "data": {
908
+ "name": "with-classes-applied",
909
+ "classes": "c-tree--sm mt-sm",
910
+ "fieldset": {
911
+ "legend": {
912
+ "text": "Selecciona organismo"
913
+ }
914
+ },
915
+ "hint": {
916
+ "text": "Selecciona el organismo al que perteneces."
917
+ },
918
+ "items": [
919
+ {
920
+ "text": "Option 1",
921
+ "value": "option-1",
922
+ "classes": "-mt-xs pt-1",
923
+ "label": {
924
+ "classes": "text-sm -mt-1"
925
+ }
926
+ },
927
+ {
928
+ "text": "Option 2",
929
+ "value": "option-2",
930
+ "classes": "-mt-xs pt-1",
931
+ "label": {
932
+ "classes": "text-sm -mt-1"
933
+ },
934
+ "expanded": true,
935
+ "id": "classes-1",
936
+ "sub": {
937
+ "items": [
938
+ {
939
+ "text": "Item",
940
+ "value": "item",
941
+ "classes": "-mt-xs pt-1",
942
+ "label": {
943
+ "classes": "text-sm -mt-1"
944
+ }
945
+ },
946
+ {
947
+ "text": "Item",
948
+ "value": "item",
949
+ "classes": "-mt-xs pt-1",
950
+ "label": {
951
+ "classes": "text-sm -mt-1"
952
+ },
953
+ "active": true
954
+ },
955
+ {
956
+ "text": "Item",
957
+ "value": "item",
958
+ "classes": "-mt-xs pt-1",
959
+ "label": {
960
+ "classes": "text-sm -mt-1"
961
+ }
962
+ }
963
+ ],
964
+ "attributes": {
965
+ "aria-labelledby": "classes-1"
966
+ }
967
+ }
968
+ },
969
+ {
970
+ "text": "Option 3",
971
+ "value": "option-3",
972
+ "classes": "-mt-xs pt-1",
973
+ "label": {
974
+ "classes": "text-sm -mt-1"
975
+ }
976
+ },
977
+ {
978
+ "text": "Option 4",
979
+ "value": "option-4",
980
+ "classes": "-mt-xs pt-1",
981
+ "label": {
982
+ "classes": "text-sm -mt-1"
983
+ }
984
+ },
985
+ {
986
+ "text": "Option 5",
987
+ "value": "option-5",
988
+ "classes": "-mt-xs pt-1",
989
+ "label": {
990
+ "classes": "text-sm -mt-1"
991
+ }
992
+ }
993
+ ]
994
+ }
995
+ },
996
+ {
997
+ "name": "with idPrefix",
998
+ "description": "See code to display the idPrefix applied",
999
+ "data": {
1000
+ "name": "with-idprefix",
1001
+ "classes": "mt-base",
1002
+ "fieldset": {
1003
+ "legend": {
1004
+ "text": "Selecciona organismo"
1005
+ }
1006
+ },
1007
+ "hint": {
1008
+ "text": "Selecciona el organismo al que perteneces."
1009
+ },
1010
+ "idPrefix": "tree-menu-item",
1011
+ "items": [
1012
+ {
1013
+ "text": "Option 1",
1014
+ "value": "option-1"
1015
+ },
1016
+ {
1017
+ "text": "Option 2",
1018
+ "value": "option-2"
1019
+ },
1020
+ {
1021
+ "text": "Option 3",
1022
+ "value": "option-3"
1023
+ },
1024
+ {
1025
+ "text": "Option 4",
1026
+ "value": "option-4"
1027
+ },
1028
+ {
1029
+ "text": "Option 5",
1030
+ "value": "option-5"
1031
+ }
1032
+ ]
1033
+ }
1034
+ },
1035
+ {
1036
+ "name": "with individual ids",
1037
+ "description": "See code to display the ids applied",
1038
+ "data": {
1039
+ "name": "with-individual-ids",
1040
+ "classes": "mt-base",
1041
+ "fieldset": {
1042
+ "legend": {
1043
+ "text": "Selecciona organismo"
1044
+ }
1045
+ },
1046
+ "hint": {
1047
+ "text": "Selecciona el organismo al que perteneces."
1048
+ },
1049
+ "items": [
1050
+ {
1051
+ "text": "Option 1",
1052
+ "value": "option-1",
1053
+ "id": "option-A"
1054
+ },
1055
+ {
1056
+ "text": "Option 2",
1057
+ "value": "option-2",
1058
+ "id": "option-B"
1059
+ },
1060
+ {
1061
+ "text": "Option 3",
1062
+ "value": "option-3",
1063
+ "id": "option-C"
1064
+ },
1065
+ {
1066
+ "text": "Option 4",
1067
+ "value": "option-4",
1068
+ "id": "option-D"
1069
+ },
1070
+ {
1071
+ "text": "Option 5",
1072
+ "value": "option-5",
1073
+ "id": "option-E"
1074
+ }
1075
+ ]
1076
+ }
1077
+ },
1078
+ {
1079
+ "name": "with attributes",
1080
+ "description": "See code to display the attributes applied",
1081
+ "data": {
1082
+ "name": "with-attributes",
1083
+ "classes": "mt-base",
1084
+ "fieldset": {
1085
+ "legend": {
1086
+ "text": "Selecciona organismo"
1087
+ }
1088
+ },
1089
+ "hint": {
1090
+ "text": "Selecciona el organismo al que perteneces."
1091
+ },
1092
+ "attributes": {
1093
+ "id": "tree-id-example"
1094
+ },
1095
+ "items": [
1096
+ {
1097
+ "text": "Option 1",
1098
+ "value": "option-1",
1099
+ "attributes": {
1100
+ "data-attribute-1": "value-A",
1101
+ "data-attribute-2": "value-B",
1102
+ "data-attribute-3": "value-C"
1103
+ }
1104
+ },
1105
+ {
1106
+ "text": "Option 2",
1107
+ "value": "option-2",
1108
+ "attributes": {
1109
+ "data-attribute-1": "value-A",
1110
+ "data-attribute-2": "value-B",
1111
+ "data-attribute-3": "value-C"
1112
+ }
1113
+ },
1114
+ {
1115
+ "text": "Option 3",
1116
+ "value": "option-3",
1117
+ "attributes": {
1118
+ "data-attribute-1": "value-A",
1119
+ "data-attribute-2": "value-B",
1120
+ "data-attribute-3": "value-C"
1121
+ },
1122
+ "expanded": true,
1123
+ "sub": {
1124
+ "attributes": {
1125
+ "sub-data-attribute-1": "sub-value-A",
1126
+ "sub-data-attribute-2": "sub-value-B",
1127
+ "sub-data-attribute-3": "sub-value-C"
1128
+ },
1129
+ "items": [
1130
+ {
1131
+ "text": "Item",
1132
+ "value": "item",
1133
+ "attributes": {
1134
+ "item-data-attribute-1": "item-value-A",
1135
+ "item-data-attribute-2": "item-value-B",
1136
+ "item-data-attribute-3": "item-value-C"
1137
+ }
1138
+ },
1139
+ {
1140
+ "text": "Item",
1141
+ "value": "item"
1142
+ },
1143
+ {
1144
+ "text": "Item",
1145
+ "value": "item"
1146
+ }
1147
+ ]
1148
+ }
1149
+ },
1150
+ {
1151
+ "text": "Option 4",
1152
+ "value": "option-4",
1153
+ "attributes": {
1154
+ "data-attribute-1": "value-A",
1155
+ "data-attribute-2": "value-B",
1156
+ "data-attribute-3": "value-C"
1157
+ }
1158
+ },
1159
+ {
1160
+ "text": "Option 5",
1161
+ "value": "option-5",
1162
+ "attributes": {
1163
+ "data-attribute-1": "value-A",
1164
+ "data-attribute-2": "value-B",
1165
+ "data-attribute-3": "value-C"
1166
+ }
1167
+ }
1168
+ ]
1169
+ }
1170
+ }
1171
+ ] %}