desy-angular 5.0.2 → 5.1.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 (42) hide show
  1. package/bundles/desy-angular.umd.js +1204 -97
  2. package/bundles/desy-angular.umd.js.map +1 -1
  3. package/bundles/desy-angular.umd.min.js +2 -2
  4. package/bundles/desy-angular.umd.min.js.map +1 -1
  5. package/desy-angular.d.ts +29 -24
  6. package/desy-angular.metadata.json +1 -1
  7. package/esm2015/desy-angular.js +30 -25
  8. package/esm2015/lib/desy-buttons/components/toggle/toggle-off-state/toggle-off-state.component.js +15 -0
  9. package/esm2015/lib/desy-buttons/components/toggle/toggle-on-state/toggle-on-state.component.js +15 -0
  10. package/esm2015/lib/desy-buttons/components/toggle/toggle.component.js +41 -0
  11. package/esm2015/lib/desy-buttons/desy-buttons.module.js +12 -3
  12. package/esm2015/lib/desy-forms/components/tree/interfaces/itree-item.js +3 -0
  13. package/esm2015/lib/desy-forms/components/tree/interfaces/quit-tree-item-focus-options.js +2 -0
  14. package/esm2015/lib/desy-forms/components/tree/tree-checkbox/tree-checkbox.component.js +151 -0
  15. package/esm2015/lib/desy-forms/components/tree/tree-item/tree-item.component.js +365 -0
  16. package/esm2015/lib/desy-forms/components/tree/tree-items-generator/tree-items-generator.component.js +25 -0
  17. package/esm2015/lib/desy-forms/components/tree/tree-sub/tree-sub.component.js +14 -0
  18. package/esm2015/lib/desy-forms/components/tree/tree.component.js +396 -0
  19. package/esm2015/lib/desy-forms/desy-forms.module.js +15 -1
  20. package/esm2015/lib/desy-nav/components/header/header-dropdown/header-dropdown.component.js +8 -3
  21. package/esm2015/lib/desy-nav/components/header/header-offcanvas/header-offcanvas.component.js +7 -4
  22. package/esm2015/lib/desy-nav/components/header/header-subnav/header-subnav.component.js +2 -2
  23. package/esm2015/lib/desy-nav/components/menu-vertical/menu-vertical.component.js +12 -3
  24. package/esm2015/lib/desy-nav/components/nav/nav.component.js +33 -2
  25. package/esm2015/public-api.js +5 -1
  26. package/fesm2015/desy-angular.js +1120 -71
  27. package/fesm2015/desy-angular.js.map +1 -1
  28. package/lib/desy-buttons/components/toggle/toggle-off-state/toggle-off-state.component.d.ts +5 -0
  29. package/lib/desy-buttons/components/toggle/toggle-on-state/toggle-on-state.component.d.ts +5 -0
  30. package/lib/desy-buttons/components/toggle/toggle.component.d.ts +15 -0
  31. package/lib/desy-forms/components/tree/interfaces/itree-item.d.ts +5 -0
  32. package/lib/desy-forms/components/tree/interfaces/quit-tree-item-focus-options.d.ts +5 -0
  33. package/lib/desy-forms/components/tree/tree-checkbox/tree-checkbox.component.d.ts +43 -0
  34. package/lib/desy-forms/components/tree/tree-item/tree-item.component.d.ts +85 -0
  35. package/lib/desy-forms/components/tree/tree-items-generator/tree-items-generator.component.d.ts +10 -0
  36. package/lib/desy-forms/components/tree/tree-sub/tree-sub.component.d.ts +6 -0
  37. package/lib/desy-forms/components/tree/tree.component.d.ts +107 -0
  38. package/lib/desy-nav/components/header/header-dropdown/header-dropdown.component.d.ts +2 -0
  39. package/lib/desy-nav/components/menu-vertical/menu-vertical.component.d.ts +1 -0
  40. package/lib/desy-nav/components/nav/nav.component.d.ts +3 -0
  41. package/package.json +2 -2
  42. package/public-api.d.ts +4 -0
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, Input, ViewChild, EventEmitter, HostBinding, Output, ElementRef, QueryList, ViewChildren, ContentChildren, ChangeDetectorRef, HostListener, forwardRef, Pipe, Optional, Host, Directive, TemplateRef, ComponentFactoryResolver, ViewContainerRef, Type, ComponentRef, Injectable, Injector, ApplicationRef, ContentChild, SecurityContext, NgModule } from '@angular/core';
2
+ import { Component, Input, ViewChild, EventEmitter, HostBinding, Output, ElementRef, QueryList, ViewChildren, ContentChildren, ChangeDetectorRef, HostListener, forwardRef, Pipe, Optional, Host, Directive, TemplateRef, ChangeDetectionStrategy, ViewContainerRef, ComponentFactoryResolver, Type, ComponentRef, Injectable, Injector, ApplicationRef, ContentChild, SecurityContext, NgModule } from '@angular/core';
3
3
  import { __decorate, __awaiter } from 'tslib';
4
4
  import { NG_VALUE_ACCESSOR, ControlContainer, NgForm, FormsModule, ReactiveFormsModule } from '@angular/forms';
5
5
  import { trigger, state, style, transition, animate, query, animateChild } from '@angular/animations';
@@ -3051,6 +3051,965 @@ SearchBarComponent.propDecorators = {
3051
3051
  clickEvent: [{ type: Output }]
3052
3052
  };
3053
3053
 
3054
+ class TreeSubComponent extends ContentBaseComponent {
3055
+ }
3056
+ TreeSubComponent.decorators = [
3057
+ { type: Component, args: [{
3058
+ selector: 'desy-tree-sub',
3059
+ template: "<ng-template #contentTemplate>\r\n <ul [class]=\"['c-tree__itemgroup', classes] | makeHtmlList\"\r\n [attr.role]=\"role ? role : 'group'\"\r\n [attr.aria-describedby]=\"ariaDescribedBy ? ariaDescribedBy : null\"\r\n [attr.aria-labelledby]=\"ariaLabelledBy ? ariaLabelledBy : null\"\r\n [attr.aria-hidden]=\"ariaHidden ? ariaHidden : null\"\r\n [attr.aria-disabled]=\"ariaDisabled ? ariaDisabled : null\"\r\n [attr.aria-controls]=\"ariaControls ? ariaControls : null\"\r\n [attr.aria-current]=\"ariaCurrent ? ariaCurrent : null\"\r\n [attr.aria-live]=\"ariaLive ? ariaLive : null\"\r\n [attr.aria-expanded]=\"ariaExpanded ? ariaExpanded : null\"\r\n [attr.aria-errormessage]=\"ariaErrorMessage ? ariaErrorMessage : null\"\r\n [attr.aria-haspopup]=\"ariaHasPopup ? ariaHasPopup : null\"\r\n [attr.aria-modal]=\"ariaModal ? ariaModal : null\"\r\n [attr.tabindex]=\"tabindex ? tabindex : null\">\r\n <ng-content></ng-content>\r\n </ul>\r\n</ng-template>\r\n"
3060
+ },] }
3061
+ ];
3062
+ TreeSubComponent.propDecorators = {
3063
+ classes: [{ type: Input }]
3064
+ };
3065
+
3066
+ class ITreeItem {
3067
+ }
3068
+
3069
+ class SearchUtils {
3070
+ /**
3071
+ * Comprueba si una cadena de texto (target) contiene cualquier palabra de otro texto (text)
3072
+ * @param target - Texto en el que buscar
3073
+ * @param text - Texto a buscar
3074
+ * @param fullWord - Indica si las palabras del texto a buscar deben aparecer enteras
3075
+ */
3076
+ static containsAnyWordFrom(target, text, fullWord) {
3077
+ let words = [];
3078
+ let includes = false;
3079
+ const simplifiedTarget = this.getSimplifiedString(target);
3080
+ if (text && text.split(' ').length > 1) {
3081
+ words = text.split(' ');
3082
+ }
3083
+ words.push(text);
3084
+ words.forEach(word => {
3085
+ if (simplifiedTarget && word) {
3086
+ if ((fullWord && simplifiedTarget === this.getSimplifiedString(word))
3087
+ || (!fullWord && simplifiedTarget.includes(this.getSimplifiedString(word)))) {
3088
+ includes = true;
3089
+ }
3090
+ }
3091
+ });
3092
+ return includes;
3093
+ }
3094
+ /**
3095
+ * Convierte a mayúsculas, elimina espacios y reemplaza/elimina caracteres especiales para realizar comparaciones más tolerantes
3096
+ * @param str - cadena de entrada
3097
+ */
3098
+ static getSimplifiedString(str) {
3099
+ let res = str;
3100
+ if (str) {
3101
+ res = str.toLocaleUpperCase().trim();
3102
+ res = res.replace('Á', 'A');
3103
+ res = res.replace('É', 'E');
3104
+ res = res.replace('Í', 'I');
3105
+ res = res.replace('Ó', 'O');
3106
+ res = res.replace('Ú', 'U');
3107
+ res = res.replace('À', 'A');
3108
+ res = res.replace('È', 'E');
3109
+ res = res.replace('Ì', 'I');
3110
+ res = res.replace('Ò', 'O');
3111
+ res = res.replace('Ù', 'U');
3112
+ res = res.replace('Ä', 'A');
3113
+ res = res.replace('Ë', 'E');
3114
+ res = res.replace('Ï', 'I');
3115
+ res = res.replace('Ö', 'O');
3116
+ res = res.replace('Ü', 'U');
3117
+ res = res.replace(',', '');
3118
+ res = res.replace('.', '');
3119
+ res = res.replace('\'', '');
3120
+ res = res.replace('"', '');
3121
+ }
3122
+ return res;
3123
+ }
3124
+ }
3125
+
3126
+ class TreeCheckboxComponent extends AccessibilityComponent {
3127
+ constructor(changeDetector) {
3128
+ super();
3129
+ this.changeDetector = changeDetector;
3130
+ this.checkedChange = new EventEmitter();
3131
+ this.indeterminateCheckedChange = new EventEmitter();
3132
+ this.hasError = false;
3133
+ this._hasInit = false;
3134
+ }
3135
+ ngOnInit() {
3136
+ this._hasInit = true;
3137
+ this.onDescribedByChange();
3138
+ }
3139
+ detectChanges() {
3140
+ this.changeDetector.detectChanges();
3141
+ }
3142
+ hasChanged() {
3143
+ if (this._hasInit) {
3144
+ const input = this.inputElement.nativeElement;
3145
+ // Se establece el cambio a visualizar en el input
3146
+ if (this.isIndeterminate) {
3147
+ if (input.readOnly) {
3148
+ input.checked = false;
3149
+ input.readOnly = false;
3150
+ }
3151
+ else if (!input.checked) {
3152
+ input.readOnly = true;
3153
+ input.indeterminate = true;
3154
+ }
3155
+ }
3156
+ this.setIndeterminateChecked(input.indeterminate);
3157
+ this.checkedChange.emit(input.checked);
3158
+ }
3159
+ }
3160
+ onIdChange() {
3161
+ this.overrideLabelParams();
3162
+ this.overrideHintParams();
3163
+ }
3164
+ setIndeterminateStatus() {
3165
+ var _a;
3166
+ const input = (_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.nativeElement;
3167
+ if (input) {
3168
+ if (this.indeterminateChecked) {
3169
+ input.readOnly = true;
3170
+ input.indeterminate = true;
3171
+ }
3172
+ else if (input.readOnly) {
3173
+ input.readOnly = false;
3174
+ input.indeterminate = false;
3175
+ }
3176
+ }
3177
+ }
3178
+ setIndeterminateChecked(indeterminateChecked) {
3179
+ this.indeterminateChecked = indeterminateChecked;
3180
+ this._lastIndeterminate = indeterminateChecked;
3181
+ this.indeterminateCheckedChange.emit(indeterminateChecked);
3182
+ this.changeDetector.detectChanges(); // Avisa al elemento input para que actualice su estado
3183
+ }
3184
+ focus() {
3185
+ this.inputElement.nativeElement.focus();
3186
+ }
3187
+ matchesText(value) {
3188
+ const checkboxText = this.contentWrapper.nativeElement.textContent;
3189
+ return SearchUtils.containsAnyWordFrom(checkboxText, value);
3190
+ }
3191
+ preventDefault(event) {
3192
+ event.preventDefault();
3193
+ }
3194
+ getHintId() {
3195
+ return this.hintComponent ? this.hintComponent.id : '';
3196
+ }
3197
+ overrideLabelParams() {
3198
+ if (this.labelComponent) {
3199
+ this.labelComponent.for = this.id + '-input';
3200
+ if (!this.labelComponent.classes) {
3201
+ this.labelComponent.classes = 'block relative -top-xs -left-8 pl-8 py-xs';
3202
+ }
3203
+ this.labelComponent.detectChanges();
3204
+ }
3205
+ }
3206
+ overrideHintParams() {
3207
+ if (this.hintComponent) {
3208
+ if (!this.hintComponent.id) {
3209
+ this.hintComponent.id = this.id + '-item-hint';
3210
+ }
3211
+ this.hintComponent.detectChanges();
3212
+ }
3213
+ this.onDescribedByChange();
3214
+ }
3215
+ getItemDescribedBy() {
3216
+ return (this.describedBy ? this.describedBy : '') + ' ' + this.getHintId();
3217
+ }
3218
+ onDescribedByChange() {
3219
+ if (this.ariaDescribedBy) {
3220
+ this.itemDescribedBy = this.ariaDescribedBy;
3221
+ }
3222
+ else {
3223
+ this.itemDescribedBy = this.getItemDescribedBy();
3224
+ }
3225
+ }
3226
+ }
3227
+ TreeCheckboxComponent.decorators = [
3228
+ { type: Component, args: [{
3229
+ selector: 'desy-tree-checkbox',
3230
+ template: "<div [class]=\"classes\" [ngClass]=\"{'border-t border-b border-neutral-base -mb-px': hasDividers}\">\r\n <div class=\"relative flex items-start py-xs\">\r\n <div class=\"flex items-center mx-sm\">\r\n <input #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\"\r\n [id]=\"id + '-input'\"\r\n [name]=\"name\"\r\n [type]=\"type === 'checkbox' ? 'checkbox' : 'radio'\"\r\n [value]=\"value\"\r\n [checked]=\"checked\"\r\n (change)=\"hasChanged()\"\r\n [disabled]=\"disabled ? disabled : null\"\r\n [attr.aria-invalid]=\"hasError ? 'true' : null\"\r\n\r\n [attr.role]=\"role ? role : 'group'\"\r\n [attr.aria-describedby]=\"itemDescribedBy\"\r\n [attr.aria-labelledby]=\"ariaLabelledBy ? ariaLabelledBy : null\"\r\n [attr.aria-hidden]=\"ariaHidden ? ariaHidden : null\"\r\n [attr.aria-disabled]=\"ariaDisabled ? ariaDisabled : null\"\r\n [attr.aria-controls]=\"ariaControls ? ariaControls : null\"\r\n [attr.aria-current]=\"ariaCurrent ? ariaCurrent : null\"\r\n [attr.aria-live]=\"ariaLive ? ariaLive : null\"\r\n [attr.aria-expanded]=\"ariaExpanded ? ariaExpanded : null\"\r\n [attr.aria-errormessage]=\"ariaErrorMessage ? ariaErrorMessage : null\"\r\n [attr.aria-haspopup]=\"ariaHasPopup ? ariaHasPopup : null\"\r\n [attr.aria-modal]=\"ariaModal ? ariaModal : null\"\r\n [attr.tabindex]=\"tabindex ? tabindex : null\"\r\n\r\n (keydown.home)=\"preventDefault($event)\"\r\n (keydown.end)=\"preventDefault($event)\"\r\n (keydown.arrowup)=\"preventDefault($event)\"\r\n (keydown.arrowdown)=\"preventDefault($event)\"\r\n (keydown.arrowright)=\"preventDefault($event)\"\r\n (keydown.arrowleft)=\"preventDefault($event)\">\r\n </div>\r\n <div #contentWrapper class=\"flex-1 pt-0.5 leading-5\">\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n</div>\r\n"
3231
+ },] }
3232
+ ];
3233
+ TreeCheckboxComponent.ctorParameters = () => [
3234
+ { type: ChangeDetectorRef }
3235
+ ];
3236
+ TreeCheckboxComponent.propDecorators = {
3237
+ inputElement: [{ type: ViewChild, args: ['input', { static: true },] }],
3238
+ contentWrapper: [{ type: ViewChild, args: ['contentWrapper', { static: true },] }],
3239
+ id: [{ type: Input }],
3240
+ name: [{ type: Input }],
3241
+ type: [{ type: Input }],
3242
+ classes: [{ type: Input }],
3243
+ value: [{ type: Input }],
3244
+ checked: [{ type: Input }],
3245
+ checkedChange: [{ type: Output }],
3246
+ isIndeterminate: [{ type: Input }],
3247
+ indeterminateChecked: [{ type: Input }],
3248
+ indeterminateCheckedChange: [{ type: Output }],
3249
+ disabled: [{ type: Input }],
3250
+ hasDividers: [{ type: Input }],
3251
+ describedBy: [{ type: Input }],
3252
+ hasError: [{ type: Input }],
3253
+ labelComponent: [{ type: Input }],
3254
+ hintComponent: [{ type: Input }]
3255
+ };
3256
+ __decorate([
3257
+ DesyOnInputChange('onIdChange')
3258
+ ], TreeCheckboxComponent.prototype, "id", void 0);
3259
+ __decorate([
3260
+ DesyOnInputChange('setIndeterminateStatus')
3261
+ ], TreeCheckboxComponent.prototype, "indeterminateChecked", void 0);
3262
+ __decorate([
3263
+ DesyOnInputChange('onDescribedByChange')
3264
+ ], TreeCheckboxComponent.prototype, "describedBy", void 0);
3265
+ __decorate([
3266
+ DesyOnInputChange('overrideLabelParams')
3267
+ ], TreeCheckboxComponent.prototype, "labelComponent", void 0);
3268
+ __decorate([
3269
+ DesyOnInputChange('overrideHintParams')
3270
+ ], TreeCheckboxComponent.prototype, "hintComponent", void 0);
3271
+
3272
+ class TreeItemComponent extends AccessibilityComponent {
3273
+ constructor(changeDetector, element) {
3274
+ super();
3275
+ this.changeDetector = changeDetector;
3276
+ this.element = element;
3277
+ this.checkedChange = new EventEmitter();
3278
+ this.checkedChangeForTree = new EventEmitter();
3279
+ this.expandedChange = new EventEmitter();
3280
+ this.indeterminateCheckedChange = new EventEmitter();
3281
+ /*
3282
+ * Identificador del wrapper del componente. Se utiliza para recorrer el árbol en sentido inverso y que cada item
3283
+ * sepa cuál es su item/árbol padre.
3284
+ * Esto es necesario ya que, a la hora de construir un árbol dinámico con templates,
3285
+ * el decorador @ContentChildren no funciona correctamente y no los detecta.
3286
+ * Dejo el enlace de un problema similar: https://github.com/angular/angular/issues/21751
3287
+ */
3288
+ this.treeItemKey = TreeItemComponent.generateStaticItemKey();
3289
+ this.allParentsExpanded = true; // True si el elemento es visible según los elementos expandidos
3290
+ this.inheritedMatchesSearch = true; // True si el elemento es visible según los criterios de búsqueda
3291
+ // Evento para emitir al componente arbol cuando se pretende abandonar el foco del item
3292
+ this.quitFocus = new EventEmitter();
3293
+ this.isFocus = false;
3294
+ this.isHover = false;
3295
+ }
3296
+ ngOnChanges(changes) {
3297
+ if (this.sub && this.sub.itemList) {
3298
+ this.sub.itemList.forEach(item => item.refreshAllParentsExpandedRecursive(this.allParentsExpanded && this.expanded));
3299
+ }
3300
+ for (const propName in changes) {
3301
+ if (changes.hasOwnProperty(propName)) {
3302
+ switch (propName) {
3303
+ case 'checked': {
3304
+ // Reasignamos el valor de checked cuando detectamos el cambio en la entrada
3305
+ setTimeout(() => {
3306
+ this.setChecked(this.checked, false, false);
3307
+ if (this.inheritedExpandedFirstLevel && this.checked && !this.expanded) {
3308
+ this.expandSub(true);
3309
+ }
3310
+ });
3311
+ break;
3312
+ }
3313
+ }
3314
+ }
3315
+ }
3316
+ }
3317
+ /*
3318
+ * Métodos expuestos que permiten configurar al ítem de forma externa
3319
+ */
3320
+ focus() {
3321
+ var _a;
3322
+ (_a = this.checkbox) === null || _a === void 0 ? void 0 : _a.focus();
3323
+ this.handleItemFocus(true);
3324
+ }
3325
+ setCheckedAutomaticallyDependingOnChildren() {
3326
+ if (this.sub) {
3327
+ this.sub.itemList.forEach(item => item.setCheckedAutomaticallyDependingOnChildren());
3328
+ if (this.areAllChildrenChecked()) {
3329
+ if (this.indeterminateChecked) {
3330
+ this.setIndeterminateChecked(false);
3331
+ }
3332
+ if (!this.checked) {
3333
+ this.setChecked(true, true);
3334
+ }
3335
+ }
3336
+ else if (this.hasChildrenCheckedOrIndeterminate()) {
3337
+ if (!this.indeterminateChecked) {
3338
+ this.setIndeterminateChecked(true);
3339
+ }
3340
+ if (this.checked) {
3341
+ this.setChecked(false, true);
3342
+ }
3343
+ }
3344
+ else {
3345
+ if (this.indeterminateChecked) {
3346
+ this.setIndeterminateChecked(false);
3347
+ }
3348
+ if (this.checked) {
3349
+ this.setChecked(false, true);
3350
+ }
3351
+ }
3352
+ }
3353
+ }
3354
+ refreshAllParentsExpandedRecursive(value) {
3355
+ this.allParentsExpanded = value;
3356
+ if (this.sub) {
3357
+ this.sub.itemList.forEach(item => item.refreshAllParentsExpandedRecursive(value && this.expanded));
3358
+ }
3359
+ }
3360
+ detectChanges() {
3361
+ this.changeDetector.detectChanges();
3362
+ }
3363
+ expandSub(value) {
3364
+ this.expanded = value;
3365
+ if (this.sub) {
3366
+ this.sub.itemList.forEach(item => item.refreshAllParentsExpandedRecursive(this.allParentsExpanded && value));
3367
+ }
3368
+ this.expandedChange.emit(value);
3369
+ }
3370
+ /*
3371
+ * Gestion de eventos
3372
+ */
3373
+ handleCheckboxChange(checked) {
3374
+ this.setChecked(checked, false);
3375
+ if (this.inheritedExpandedFirstLevel && checked && !this.expanded) {
3376
+ this.expandSub(true);
3377
+ }
3378
+ }
3379
+ handleIndeterminateCheckedChange(indeterminate) {
3380
+ this.indeterminateCheckedChange.emit(indeterminate);
3381
+ }
3382
+ handleItemFocus(value, condition = true) {
3383
+ if (condition) {
3384
+ this.isFocus = value;
3385
+ }
3386
+ }
3387
+ handleItemHover(value, condition = true) {
3388
+ if (condition) {
3389
+ this.isHover = value;
3390
+ }
3391
+ }
3392
+ handleArrowUp(event, condition = true) {
3393
+ if (condition) {
3394
+ event.preventDefault();
3395
+ this.quitFocus.emit({
3396
+ nextElement: 'previous',
3397
+ currentItem: this
3398
+ });
3399
+ }
3400
+ }
3401
+ handleHome(event, condition = true) {
3402
+ if (condition) {
3403
+ event.preventDefault();
3404
+ this.quitFocus.emit({
3405
+ nextElement: 'first',
3406
+ currentItem: this
3407
+ });
3408
+ }
3409
+ }
3410
+ handleEnd(event, condition = true) {
3411
+ if (condition) {
3412
+ event.preventDefault();
3413
+ this.quitFocus.emit({
3414
+ nextElement: 'last',
3415
+ currentItem: this
3416
+ });
3417
+ }
3418
+ }
3419
+ handleArrowDown(event, condition = true) {
3420
+ if (condition) {
3421
+ event.preventDefault();
3422
+ this.quitFocus.emit({
3423
+ nextElement: 'next',
3424
+ currentItem: this
3425
+ });
3426
+ }
3427
+ }
3428
+ handleArrowRight(event, condition = true) {
3429
+ var _a;
3430
+ if (condition && this.sub && ((_a = this.sub.itemList) === null || _a === void 0 ? void 0 : _a.length) > 0) {
3431
+ event.preventDefault();
3432
+ if (this.expanded) {
3433
+ this.quitFocus.emit({
3434
+ nextElement: 'firstChild',
3435
+ currentItem: this
3436
+ });
3437
+ }
3438
+ else {
3439
+ this.expandSub(true);
3440
+ }
3441
+ }
3442
+ }
3443
+ handleArrowLeft(event, condition = true) {
3444
+ if (condition) {
3445
+ event.preventDefault();
3446
+ if (this.expanded) {
3447
+ this.expandSub(false);
3448
+ }
3449
+ else if (this.subLevel > 0) {
3450
+ this.quitFocus.emit({
3451
+ nextElement: 'parent',
3452
+ currentItem: this
3453
+ });
3454
+ }
3455
+ }
3456
+ }
3457
+ /*
3458
+ * Setters and getters
3459
+ */
3460
+ setChecked(checked, ignoreInTree, emitEvent = true) {
3461
+ if (!this.disabled) {
3462
+ this.checked = checked;
3463
+ }
3464
+ if (!this.inheritedDecoupleChildFromParent && this.sub && this.sub.itemList && !this.indeterminateChecked) {
3465
+ this.sub.itemList.forEach(item => {
3466
+ item.setIndeterminateChecked(false);
3467
+ item.setChecked(checked, true);
3468
+ });
3469
+ }
3470
+ if (emitEvent) {
3471
+ this.checkedChange.emit(checked);
3472
+ }
3473
+ if (!ignoreInTree) {
3474
+ this.checkedChangeForTree.emit(checked);
3475
+ }
3476
+ }
3477
+ setIndeterminateChecked(indeterminate) {
3478
+ if (!this.disabled) {
3479
+ this.indeterminateChecked = indeterminate;
3480
+ this.indeterminateCheckedChange.emit(indeterminate);
3481
+ }
3482
+ }
3483
+ setSubLevel(subLevel) {
3484
+ this.subLevel = subLevel;
3485
+ if (this.sub && this.sub.itemList) {
3486
+ this.sub.itemList.forEach(item => item.setSubLevel(subLevel + 1));
3487
+ }
3488
+ }
3489
+ setOrderRecursively(order) {
3490
+ this.orderInTree = order;
3491
+ let newOrder = order + 1;
3492
+ if (this.sub && this.sub.itemList) {
3493
+ this.sub.itemList.forEach(item => {
3494
+ newOrder = item.setOrderRecursively(newOrder);
3495
+ });
3496
+ }
3497
+ return newOrder;
3498
+ }
3499
+ setDefaultId(defaultId) {
3500
+ this.defaultId = defaultId;
3501
+ this.setDefaultIdRecursive();
3502
+ }
3503
+ setDefaultIdRecursive() {
3504
+ if (this.sub && this.sub.itemList) {
3505
+ this.sub.itemList.forEach((item, index) => {
3506
+ item.setDefaultId(`sub-${this.getId()}-${index}`);
3507
+ });
3508
+ }
3509
+ }
3510
+ getId() {
3511
+ return this.id ? this.id : this.defaultId;
3512
+ }
3513
+ isHidden() {
3514
+ return !this.inheritedMatchesSearch && (!this.sub || this.areAllChildrenHidden());
3515
+ }
3516
+ areAllChildrenHidden() {
3517
+ const children = this.sub.itemList;
3518
+ return children.findIndex(child => !child.isHidden()) < 0;
3519
+ }
3520
+ areAllChildrenChecked() {
3521
+ const children = this.sub.itemList;
3522
+ return children.findIndex(child => !child.checked) < 0;
3523
+ }
3524
+ hasChildrenCheckedOrIndeterminate() {
3525
+ const children = this.sub.itemList;
3526
+ return children.findIndex(child => child.checked || child.indeterminateChecked) >= 0;
3527
+ }
3528
+ matchesText(value) {
3529
+ var _a;
3530
+ let matches;
3531
+ if (this.allParentsExpanded && !this.isHidden()) {
3532
+ matches = (_a = this.checkbox) === null || _a === void 0 ? void 0 : _a.matchesText(value);
3533
+ }
3534
+ else {
3535
+ const itemText = this.hiddenWrapper.nativeElement.textContent;
3536
+ matches = SearchUtils.containsAnyWordFrom(itemText, value);
3537
+ }
3538
+ return matches;
3539
+ }
3540
+ getKey() {
3541
+ return this.treeItemKey;
3542
+ }
3543
+ getParentKey() {
3544
+ let parentKey;
3545
+ let parentElement = this.element.nativeElement.parentElement;
3546
+ while (parentElement && parentElement.tagName !== 'BODY' && parentElement.tagName !== 'DESY-TREE-ITEM' && parentElement.tagName !== 'DESY-TREE') {
3547
+ parentElement = parentElement.parentElement;
3548
+ }
3549
+ if (parentElement.tagName === 'BODY') {
3550
+ throw new Error('Parent for tree-item not found');
3551
+ }
3552
+ if (parentElement.tagName === 'DESY-TREE') {
3553
+ parentKey = 'root';
3554
+ }
3555
+ if (parentElement.tagName === 'DESY-TREE-ITEM') {
3556
+ parentKey = parentElement.getAttribute('desy-tree-item-key');
3557
+ }
3558
+ return parentKey;
3559
+ }
3560
+ /*
3561
+ * Métodos privados
3562
+ */
3563
+ /**
3564
+ * Genera una clave única para el componente
3565
+ * @private
3566
+ */
3567
+ static generateStaticItemKey() {
3568
+ const key = 'tree-item-key-' + TreeItemComponent._treeItemKeySuffix;
3569
+ TreeItemComponent._treeItemKeySuffix++;
3570
+ return key;
3571
+ }
3572
+ }
3573
+ TreeItemComponent._treeItemKeySuffix = 0; // Sufijo estático para generar siempre claves distintas
3574
+ TreeItemComponent.decorators = [
3575
+ { type: Component, args: [{
3576
+ selector: 'desy-tree-item',
3577
+ template: "<li *ngIf=\"allParentsExpanded && !isHidden(); else hidden\"\r\n [id]=\"id\"\r\n [class]=\"'c-tree__item focus:outline-none'\"\r\n [ngClass]=\"{\r\n 'ml-4': subLevel === 0,\r\n 'ml-8': subLevel !== 0,\r\n 'c-tree__item--focus': isFocus && !sub,\r\n 'c-tree__item--hover': isHover && !sub,\r\n 'font-bold': active && subLevel === 0\r\n }\"\r\n (focusin)=\"handleItemFocus(true, !sub)\"\r\n (focusout)=\"handleItemFocus(false, !sub)\"\r\n (mouseover)=\"handleItemHover(true, !sub)\"\r\n (mouseout)=\"handleItemHover(false, !sub)\"\r\n (keydown.home)=\"handleHome($event, !sub)\"\r\n (keydown.end)=\"handleEnd($event, !sub)\"\r\n (keydown.arrowup)=\"handleArrowUp($event, !sub)\"\r\n (keydown.arrowdown)=\"handleArrowDown($event, !sub)\"\r\n (keydown.arrowright)=\"handleArrowRight($event, !sub)\"\r\n (keydown.arrowleft)=\"handleArrowLeft($event, !sub)\"\r\n role=\"treeitem\"\r\n [attr.aria-expanded]=\"sub ? (expanded ? 'true' : 'false') : null\"\r\n [attr.aria-current]=\"active && subLevel === 0 ? 'page' : null\"\r\n [attr.disabled]=\"disabled && subLevel === 0 ? 'disabled' : null\"\r\n [attr.aria-disabled]=\"disabled && subLevel === 0 ? 'true' : null\"\r\n [attr.tabIndex]=\"disabled && subLevel === 0 ? '-1' : null\">\r\n <div *ngIf=\"!sub && subLevel !== 0; else childrenTree\"\r\n [id]=\"id\"\r\n [class]=\"['block', classes] | makeHtmlList\"\r\n [ngClass]=\"{'font-bold': active}\"\r\n [attr.title]=\"title ? title : null\"\r\n [attr.disabled]=\"disabled ? 'disabled' : null\"\r\n\r\n [attr.role]=\"role ? role : 'tree'\"\r\n [attr.aria-describedby]=\"ariaDescribedBy ? ariaDescribedBy : null\"\r\n [attr.aria-labelledby]=\"ariaLabelledBy ? ariaLabelledBy : null\"\r\n [attr.aria-hidden]=\"ariaHidden ? ariaHidden : null\"\r\n [attr.aria-disabled]=\"ariaDisabled ? ariaDisabled : (disabled ? 'true' : null)\"\r\n [attr.aria-controls]=\"ariaControls ? ariaControls : null\"\r\n [attr.aria-current]=\"ariaCurrent ? ariaCurrent : (active ? 'page' : null)\"\r\n [attr.aria-live]=\"ariaLive ? ariaLive : null\"\r\n [attr.aria-expanded]=\"ariaExpanded ? ariaExpanded : null\"\r\n [attr.aria-errormessage]=\"ariaErrorMessage ? ariaErrorMessage : null\"\r\n [attr.aria-haspopup]=\"ariaHasPopup ? ariaHasPopup : null\"\r\n [attr.aria-modal]=\"ariaModal ? ariaModal : null\"\r\n [attr.tabindex]=\"tabindex ? tabindex : (disabled ? '-1' : null)\">\r\n <div class=\"font-bold\" *ngIf=\"active; else checkbox\">\r\n <ng-container *ngTemplateOutlet=\"checkbox\"></ng-container>\r\n </div>\r\n </div>\r\n</li>\r\n\r\n<ng-template #childrenTree>\r\n <div *ngIf=\"sub; else checkbox\" class=\"w-full h-full\"\r\n [ngClass]=\"{'c-tree__item--focus': isFocus && sub, 'c-tree__item--hover': isHover && sub}\"\r\n (focusin)=\"handleItemFocus(true)\"\r\n (focusout)=\"handleItemFocus(false)\"\r\n (mouseover)=\"handleItemHover(true)\"\r\n (mouseout)=\"handleItemHover(false)\"\r\n (keydown.home)=\"handleHome($event)\"\r\n (keydown.end)=\"handleEnd($event)\"\r\n (keydown.arrowup)=\"handleArrowUp($event)\"\r\n (keydown.arrowdown)=\"handleArrowDown($event)\"\r\n (keydown.arrowright)=\"handleArrowRight($event)\"\r\n (keydown.arrowLeft)=\"handleArrowLeft($event)\">\r\n <div [class]=\"['w-full flex items-center relative focus:bg-warning-base focus:outline-none focus:shadow-outline-focus focus:text-black text-left', classes] | makeHtmlList\"\r\n\r\n [attr.role]=\"role ? role : null\"\r\n [attr.aria-describedby]=\"ariaDescribedBy ? ariaDescribedBy : null\"\r\n [attr.aria-labelledby]=\"ariaLabelledBy ? ariaLabelledBy : null\"\r\n [attr.aria-hidden]=\"ariaHidden ? ariaHidden : null\"\r\n [attr.aria-disabled]=\"ariaDisabled ? ariaDisabled : null\"\r\n [attr.aria-controls]=\"ariaControls ? ariaControls : null\"\r\n [attr.aria-current]=\"ariaCurrent ? ariaCurrent : null\"\r\n [attr.aria-live]=\"ariaLive ? ariaLive : null\"\r\n [attr.aria-expanded]=\"ariaExpanded ? ariaExpanded : null\"\r\n [attr.aria-errormessage]=\"ariaErrorMessage ? ariaErrorMessage : null\"\r\n [attr.aria-haspopup]=\"ariaHasPopup ? ariaHasPopup : null\"\r\n [attr.aria-modal]=\"ariaModal ? ariaModal : null\"\r\n [attr.tabindex]=\"tabindex ? tabindex : null\">\r\n <span class=\"absolute top-3 -left-4 flex items-center w-4 h-2.5 text-primary-base font-bold\">\r\n <svg (click)=\"expandSub(false)\" 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>\r\n <svg (click)=\"expandSub(true)\" 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>\r\n </span>\r\n <ng-container *ngTemplateOutlet=\"checkbox\"></ng-container>\r\n </div>\r\n </div>\r\n\r\n <ng-container *desyCustomInnerContent=\"{ component: sub }\"></ng-container>\r\n</ng-template>\r\n\r\n<!-- Se incorpora el contenido m\u00EDnimo para funcionar con el objetivo de mejorar el rendimiento -->\r\n<ng-template #hidden>\r\n <li class=\"hidden\">\r\n <div #hiddenWrapper>\r\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\r\n </div>\r\n <ng-container *desyCustomInnerContent=\"{ component: sub }\"></ng-container>\r\n </li>\r\n</ng-template>\r\n\r\n<ng-template #checkbox>\r\n <desy-tree-checkbox [name]=\"name ? name : parentName\"\r\n [id]=\"getId()\"\r\n [value]=\"value\"\r\n [classes]=\"classes\"\r\n [type]=\"type\"\r\n [(checked)]=\"checked\" (checkedChange)=\"handleCheckboxChange($event)\"\r\n [hasError]=\"inheritedHasError\"\r\n [disabled]=\"disabled\"\r\n [hasDividers]=\"hasDividers\"\r\n [describedBy]=\"[inheritedDescribedBy, hint?.id] | makeHtmlList\"\r\n [isIndeterminate]=\"isIndeterminate\"\r\n [(indeterminateChecked)]=\"indeterminateChecked\"\r\n (indeterminateCheckedChange)=\"handleIndeterminateCheckedChange($event)\"\r\n\r\n [labelComponent]=\"label\"\r\n [hintComponent]=\"hint\"\r\n\r\n [role]=\"role\"\r\n [ariaLabel]=\"ariaLabel\"\r\n [ariaDescribedBy]=\"ariaDescribedBy\"\r\n [ariaLabelledBy]=\"ariaLabelledBy\"\r\n [ariaHidden]=\"ariaHidden\"\r\n [ariaDisabled]=\"ariaDisabled\"\r\n [ariaControls]=\"ariaControls\"\r\n [ariaCurrent]=\"ariaCurrent\"\r\n [ariaLive]=\"ariaLive\"\r\n [ariaExpanded]=\"ariaExpanded\"\r\n [ariaErrorMessage]=\"ariaErrorMessage\"\r\n [ariaHasPopup]=\"ariaHasPopup\"\r\n [ariaModal]=\"ariaModal\"\r\n [tabindex]=\"tabindex\">\r\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\r\n </desy-tree-checkbox>\r\n</ng-template>\r\n\r\n<ng-template #content>\r\n <ng-content select=\"desy-label\"></ng-content>\r\n <ng-content select=\"desy-hint\"></ng-content>\r\n</ng-template>\r\n",
3578
+ providers: [
3579
+ {
3580
+ provide: ITreeItem,
3581
+ useExisting: forwardRef(() => TreeItemComponent)
3582
+ }
3583
+ ]
3584
+ },] }
3585
+ ];
3586
+ TreeItemComponent.ctorParameters = () => [
3587
+ { type: ChangeDetectorRef },
3588
+ { type: ElementRef }
3589
+ ];
3590
+ TreeItemComponent.propDecorators = {
3591
+ hiddenWrapper: [{ type: ViewChild, args: ['hiddenWrapper',] }],
3592
+ id: [{ type: Input }],
3593
+ name: [{ type: Input }],
3594
+ value: [{ type: Input }],
3595
+ classes: [{ type: Input }],
3596
+ active: [{ type: Input }],
3597
+ disabled: [{ type: Input }],
3598
+ title: [{ type: Input }],
3599
+ hasDividers: [{ type: Input }],
3600
+ isIndeterminate: [{ type: Input }],
3601
+ checked: [{ type: Input }],
3602
+ checkedChange: [{ type: Output }],
3603
+ expanded: [{ type: Input }],
3604
+ expandedChange: [{ type: Output }],
3605
+ indeterminateChecked: [{ type: Input }],
3606
+ indeterminateCheckedChange: [{ type: Output }],
3607
+ sub: [{ type: ContentChildren, args: [TreeSubComponent,] }],
3608
+ hint: [{ type: ContentChildren, args: [HintComponent,] }],
3609
+ label: [{ type: ContentChildren, args: [LabelComponent,] }],
3610
+ checkbox: [{ type: ViewChild, args: [TreeCheckboxComponent,] }],
3611
+ treeItemKey: [{ type: HostBinding, args: ['attr.desy-tree-item-key',] }]
3612
+ };
3613
+ __decorate([
3614
+ DesyOnInputChange('setDefaultIdRecursive')
3615
+ ], TreeItemComponent.prototype, "id", void 0);
3616
+ __decorate([
3617
+ DesyContentChild({ onSetCallbackName: 'overrideSubValues' })
3618
+ ], TreeItemComponent.prototype, "sub", void 0);
3619
+ __decorate([
3620
+ DesyContentChild()
3621
+ ], TreeItemComponent.prototype, "hint", void 0);
3622
+ __decorate([
3623
+ DesyContentChild()
3624
+ ], TreeItemComponent.prototype, "label", void 0);
3625
+
3626
+ class TreeComponent extends FormFieldComponent {
3627
+ constructor(changeDetector) {
3628
+ super();
3629
+ this.changeDetector = changeDetector;
3630
+ this.expandedFirstLevel = true;
3631
+ this.decoupleChildFromParent = false;
3632
+ this.disableDefaultSearch = false;
3633
+ this.searchMatchValuesChange = new EventEmitter();
3634
+ this.rootItems = [];
3635
+ this._itemListCheckedSubscriptions = [];
3636
+ this._itemListQuitFocusSubscriptions = [];
3637
+ this._alreadyConfiguringItems = false;
3638
+ }
3639
+ ngOnDestroy() {
3640
+ var _a, _b;
3641
+ this.clearSubscriptions(this._itemListCheckedSubscriptions);
3642
+ this.clearSubscriptions(this._itemListQuitFocusSubscriptions);
3643
+ (_a = this._itemListSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
3644
+ (_b = this._allItemListSubscription) === null || _b === void 0 ? void 0 : _b.unsubscribe();
3645
+ }
3646
+ ngOnChanges(changes) {
3647
+ this.configureAllItems();
3648
+ }
3649
+ /*
3650
+ * Eventos
3651
+ */
3652
+ /**
3653
+ * Actualiza el valor del componente al checkquearse un ítem
3654
+ * @param originItem ítem modificado
3655
+ */
3656
+ updateValueFromItems(originItem) {
3657
+ // Si es radio, se desactivan el resto de items cuando se activa otro item
3658
+ if (this.type !== 'checkbox') {
3659
+ const items = this.getAllItemsInOrder();
3660
+ items.forEach(item => {
3661
+ if (item !== originItem && item.checked) {
3662
+ item.setChecked(false, true);
3663
+ }
3664
+ });
3665
+ }
3666
+ else if (!this.decoupleChildFromParent) {
3667
+ this.rootItems.forEach(item => item.setCheckedAutomaticallyDependingOnChildren());
3668
+ }
3669
+ // Si es checkbox se modifica el valor y se emite
3670
+ if (this.type === 'checkbox') {
3671
+ this.value = [];
3672
+ const items = this.getAllItemsInOrder();
3673
+ items.forEach(item => {
3674
+ if (item.checked) {
3675
+ this.value.push(item.value);
3676
+ }
3677
+ });
3678
+ this.onChange(this.value);
3679
+ }
3680
+ }
3681
+ /**
3682
+ * Gestiona cuando el foco abandona un ítem desde un evento de teclado controlado
3683
+ * @param options
3684
+ */
3685
+ handleItemQuitFocus(options) {
3686
+ if (options && options.nextElement) {
3687
+ const items = this.getAllItemsInOrder();
3688
+ const focusableItems = items.filter(item => !item.isHidden() && !item.disabled && item.allParentsExpanded);
3689
+ switch (options.nextElement) {
3690
+ case "first":
3691
+ focusableItems[0].focus();
3692
+ break;
3693
+ case "last":
3694
+ focusableItems[focusableItems.length - 1].focus();
3695
+ break;
3696
+ case "parent":
3697
+ const currentSubLevel = options.currentItem.subLevel;
3698
+ if (currentSubLevel > 0) {
3699
+ const currentItemIndex = focusableItems.findIndex(item => item === options.currentItem);
3700
+ const parent = focusableItems.slice(0, currentItemIndex).reverse().find(item => item.subLevel < currentSubLevel);
3701
+ if (parent) {
3702
+ parent.focus();
3703
+ }
3704
+ }
3705
+ break;
3706
+ case "firstChild":
3707
+ case "next":
3708
+ if (options.currentItem) {
3709
+ let currentItemIndex = focusableItems.findIndex(item => item === options.currentItem);
3710
+ if (currentItemIndex < focusableItems.length - 1) {
3711
+ focusableItems[currentItemIndex + 1].focus();
3712
+ }
3713
+ }
3714
+ break;
3715
+ case "previous":
3716
+ if (options.currentItem) {
3717
+ const currentItemIndex = focusableItems.findIndex(item => item === options.currentItem);
3718
+ if (currentItemIndex > 0) {
3719
+ focusableItems[currentItemIndex - 1].focus();
3720
+ }
3721
+ }
3722
+ break;
3723
+ }
3724
+ }
3725
+ }
3726
+ /**
3727
+ * Realiza la búsqueda interna de los items en el componente
3728
+ * @param value texto de búsqueda
3729
+ */
3730
+ onSearch(value) {
3731
+ if (!this.disableDefaultSearch) {
3732
+ if (value && value.length > 0) {
3733
+ this.searchMatchValues = this.allItems.filter(item => item.matchesText(value)).map(item => item.value);
3734
+ }
3735
+ else {
3736
+ this.searchMatchValues = null;
3737
+ }
3738
+ this.searchMatchValuesChange.emit(this.searchMatchValues);
3739
+ }
3740
+ }
3741
+ /*
3742
+ * Eventos al cambiar propiedades
3743
+ */
3744
+ /**
3745
+ * Configura los items del árbol
3746
+ */
3747
+ configureAllItems() {
3748
+ if (!this._alreadyConfiguringItems) {
3749
+ this._alreadyConfiguringItems = true;
3750
+ // Lo realizamos desde un setTimeout para que todos los inputs, values y demás vivan en paz y armonía
3751
+ setTimeout(() => {
3752
+ var _a;
3753
+ if (((_a = this.allItems) === null || _a === void 0 ? void 0 : _a.length) > 0) {
3754
+ this.clearSubscriptions(this._itemListCheckedSubscriptions);
3755
+ this.clearSubscriptions(this._itemListQuitFocusSubscriptions);
3756
+ this.allItems.forEach(item => {
3757
+ item.parentName = this.name;
3758
+ item.type = this.type;
3759
+ item.inheritedDescribedBy = this.getDescribedByForItems();
3760
+ item.inheritedExpandedFirstLevel = this.expandedFirstLevel;
3761
+ item.inheritedDecoupleChildFromParent = this.decoupleChildFromParent;
3762
+ if (this.value && this.value.length > 0) {
3763
+ item.setChecked(!!this.value.find(v => v === item.value), true);
3764
+ }
3765
+ item.detectChanges();
3766
+ const checkedSubscription = item.checkedChangeForTree.subscribe(() => this.updateValueFromItems(item));
3767
+ this._itemListCheckedSubscriptions.push(checkedSubscription);
3768
+ const quitFocusSubscription = item.quitFocus.subscribe(options => this.handleItemQuitFocus(options));
3769
+ this._itemListQuitFocusSubscriptions.push(quitFocusSubscription);
3770
+ });
3771
+ this.setErrorInItems(this.hasErrorMessageComponent());
3772
+ this.buildTree();
3773
+ if (!this.value) {
3774
+ this.updateValueFromItems();
3775
+ }
3776
+ }
3777
+ if (this.allItems && !this._allItemListSubscription) {
3778
+ this._allItemListSubscription = this.allItems.changes.subscribe(() => this.configureAllItems());
3779
+ }
3780
+ this.changeDetector.detectChanges();
3781
+ this._alreadyConfiguringItems = false;
3782
+ });
3783
+ }
3784
+ }
3785
+ /**
3786
+ * Modifica los items visibles según el filtro de búsqueda
3787
+ */
3788
+ onSearchMatchValuesChange() {
3789
+ if (this.allItems) {
3790
+ this.allItems.forEach(item => {
3791
+ item.inheritedMatchesSearch = true;
3792
+ });
3793
+ if (this.searchMatchValues !== null && this.searchMatchValues !== undefined) {
3794
+ this.allItems.forEach(item => {
3795
+ if (this.searchMatchValues.findIndex(value => item.value === value) < 0) {
3796
+ item.inheritedMatchesSearch = false;
3797
+ }
3798
+ });
3799
+ }
3800
+ }
3801
+ }
3802
+ /*
3803
+ * Getters and setters
3804
+ */
3805
+ getIdPrefix() {
3806
+ return this.idPrefix ? this.idPrefix : this.name;
3807
+ }
3808
+ getDescribedBy() {
3809
+ let describedBy = '';
3810
+ if (this.describedBy) {
3811
+ describedBy = this.describedBy;
3812
+ }
3813
+ if (this.hasHintComponent() && this.hintComponent.id) {
3814
+ describedBy = describedBy + ' ' + this.hintComponent.id;
3815
+ }
3816
+ if (this.hasErrorMessageComponent() && this.errorMessageComponent.id) {
3817
+ describedBy = describedBy + ' ' + this.errorMessageComponent.id;
3818
+ }
3819
+ return describedBy;
3820
+ }
3821
+ /**
3822
+ * Devuelve el valor de describedBy que se transmitirá a los items
3823
+ */
3824
+ getDescribedByForItems() {
3825
+ let describedBy;
3826
+ if (this.hasFieldsetComponent()) {
3827
+ describedBy = this.fieldsetComponent.describedBy;
3828
+ }
3829
+ else {
3830
+ describedBy = this.getDescribedBy();
3831
+ }
3832
+ return describedBy;
3833
+ }
3834
+ hasFieldsetComponent() {
3835
+ return !!this.fieldsetComponent;
3836
+ }
3837
+ /**
3838
+ * Overrides super.getHintId();
3839
+ */
3840
+ getHintId() {
3841
+ var _a;
3842
+ return this.idPrefix ? this.idPrefix + '-hint' : (_a = this.hintComponent) === null || _a === void 0 ? void 0 : _a.id;
3843
+ }
3844
+ /**
3845
+ * Overrides super.getHintId();
3846
+ */
3847
+ getErrorId() {
3848
+ var _a;
3849
+ return this.idPrefix ? this.idPrefix + '-error' : (_a = this.errorMessageComponent) === null || _a === void 0 ? void 0 : _a.id;
3850
+ }
3851
+ /*
3852
+ * Funciones para reemplazar el contenido del fieldset, label, hint o errormessage
3853
+ */
3854
+ overrideFieldsetParams(fieldset) {
3855
+ fieldset.caller = this.innerHtml;
3856
+ fieldset.errorId = this.getErrorId();
3857
+ fieldset.describedBy = this.getDescribedBy();
3858
+ fieldset.detectChanges();
3859
+ }
3860
+ overrideSearchBarParams(searchbar) {
3861
+ const defaultOnChange = searchbar.onChange;
3862
+ const newOnChange = value => {
3863
+ this.onSearch(value);
3864
+ defaultOnChange(value);
3865
+ };
3866
+ searchbar.registerOnChange(newOnChange);
3867
+ }
3868
+ /**
3869
+ * Se llama desde FormField
3870
+ */
3871
+ overrideHintParams(hint) {
3872
+ hint.id = this.getHintId();
3873
+ hint.detectChanges();
3874
+ }
3875
+ /**
3876
+ * Se llama desde FormField
3877
+ */
3878
+ overrideErrorMessageParams(errorMessage) {
3879
+ errorMessage.id = this.getErrorId();
3880
+ this.setErrorInItems(this.hasErrorMessageComponent());
3881
+ errorMessage.detectChanges();
3882
+ }
3883
+ /**
3884
+ * Se llama desde FormField
3885
+ */
3886
+ onDeleteErrorMessage(errorMessage) {
3887
+ this.setErrorInItems(this.hasErrorMessageComponent());
3888
+ }
3889
+ /*
3890
+ * Métodos privados
3891
+ */
3892
+ /**
3893
+ * Configura la estructura del árbol
3894
+ * @private
3895
+ */
3896
+ buildTree() {
3897
+ // Se crea un mapa para tener accesibles los items por key y se borran los listados existentes
3898
+ const itemMap = {};
3899
+ this.rootItems = [];
3900
+ this.allItems.forEach(item => {
3901
+ const key = item.getKey();
3902
+ itemMap[key] = item;
3903
+ if (item.sub) {
3904
+ item.sub.itemList = [];
3905
+ }
3906
+ });
3907
+ // Se añaden los items a los listados correspondientes
3908
+ this.allItems.forEach(item => {
3909
+ const parentKey = item.getParentKey();
3910
+ if (parentKey === 'root') {
3911
+ this.rootItems.push(item);
3912
+ }
3913
+ else if (parentKey) {
3914
+ const sub = itemMap[parentKey].sub;
3915
+ if (sub) {
3916
+ sub.itemList.push(item);
3917
+ }
3918
+ }
3919
+ });
3920
+ // Se configuran los items desde root
3921
+ let order = 0;
3922
+ this.rootItems.forEach((item, index) => {
3923
+ item.setSubLevel(0);
3924
+ item.setDefaultId(`${this.idPrefix}-${index}`);
3925
+ item.refreshAllParentsExpandedRecursive(true);
3926
+ item.setCheckedAutomaticallyDependingOnChildren();
3927
+ order = item.setOrderRecursively(order);
3928
+ });
3929
+ }
3930
+ /**
3931
+ * Si tiene un mensaje de error, se indica a los items
3932
+ * @param hasError
3933
+ * @private
3934
+ */
3935
+ setErrorInItems(hasError) {
3936
+ var _a;
3937
+ if (((_a = this.allItems) === null || _a === void 0 ? void 0 : _a.length) > 0) {
3938
+ this.allItems.forEach(item => {
3939
+ item.inheritedHasError = hasError;
3940
+ item.detectChanges();
3941
+ });
3942
+ }
3943
+ }
3944
+ /**
3945
+ * Limpia un listado de subscripciones
3946
+ * @param subscriptionList
3947
+ * @private
3948
+ */
3949
+ clearSubscriptions(subscriptionList) {
3950
+ if (subscriptionList.length > 0) {
3951
+ subscriptionList.forEach(s => s.unsubscribe());
3952
+ subscriptionList.splice(0, subscriptionList.length);
3953
+ }
3954
+ }
3955
+ /**
3956
+ * Devuelve los items del árbol ordenados
3957
+ * @private
3958
+ */
3959
+ getAllItemsInOrder() {
3960
+ let list = [];
3961
+ if (this.allItems) {
3962
+ list = this.allItems.toArray().sort((a, b) => a.orderInTree > b.orderInTree ? 1 : -1);
3963
+ }
3964
+ return list;
3965
+ }
3966
+ }
3967
+ TreeComponent.decorators = [
3968
+ { type: Component, args: [{
3969
+ selector: 'desy-tree',
3970
+ template: "\r\n<ng-template #innerHtml>\r\n <ng-content select=\"desy-hint\"></ng-content>\r\n <ng-content select=\"desy-error-message\"></ng-content>\r\n <ng-content select=\"desy-search-bar\"></ng-content>\r\n <ul [class]=\"['c-tree', classes] | makeHtmlList\"\r\n [attr.role]=\"role ? role : 'tree'\"\r\n [attr.aria-describedby]=\"ariaDescribedBy ? ariaDescribedBy : null\"\r\n [attr.aria-labelledby]=\"ariaLabelledBy ? ariaLabelledBy : null\"\r\n [attr.aria-hidden]=\"ariaHidden ? ariaHidden : null\"\r\n [attr.aria-disabled]=\"ariaDisabled ? ariaDisabled : null\"\r\n [attr.aria-controls]=\"ariaControls ? ariaControls : null\"\r\n [attr.aria-current]=\"ariaCurrent ? ariaCurrent : null\"\r\n [attr.aria-live]=\"ariaLive ? ariaLive : null\"\r\n [attr.aria-expanded]=\"ariaExpanded ? ariaExpanded : null\"\r\n [attr.aria-errormessage]=\"ariaErrorMessage ? ariaErrorMessage : null\"\r\n [attr.aria-haspopup]=\"ariaHasPopup ? ariaHasPopup : null\"\r\n [attr.aria-modal]=\"ariaModal ? ariaModal : null\"\r\n [attr.tabindex]=\"tabindex ? tabindex : null\">\r\n <ng-content></ng-content>\r\n </ul>\r\n</ng-template>\r\n\r\n<!-- tree -->\r\n<div [class]=\"['c-form-group', formGroupClasses] | makeHtmlList\"\r\n [ngClass]=\"{'c-form-group--error': (hasErrorsMessage() || formGroupClasses === 'c-form-group--error') }\">\r\n <ng-container *ngIf=\"hasFieldsetComponent(); else innerHtml\">\r\n <ng-content select=\"desy-fieldset\"></ng-content>\r\n </ng-container>\r\n</div>\r\n",
3971
+ providers: [
3972
+ {
3973
+ provide: NG_VALUE_ACCESSOR,
3974
+ useExisting: forwardRef(() => TreeComponent),
3975
+ multi: true
3976
+ }
3977
+ ]
3978
+ },] }
3979
+ ];
3980
+ TreeComponent.ctorParameters = () => [
3981
+ { type: ChangeDetectorRef }
3982
+ ];
3983
+ TreeComponent.propDecorators = {
3984
+ idPrefix: [{ type: Input }],
3985
+ classes: [{ type: Input }],
3986
+ formGroupClasses: [{ type: Input }],
3987
+ name: [{ type: Input }],
3988
+ type: [{ type: Input }],
3989
+ describedBy: [{ type: Input }],
3990
+ expandedFirstLevel: [{ type: Input }],
3991
+ decoupleChildFromParent: [{ type: Input }],
3992
+ disableDefaultSearch: [{ type: Input }],
3993
+ searchMatchValues: [{ type: Input }],
3994
+ searchMatchValuesChange: [{ type: Output }],
3995
+ allItems: [{ type: ContentChildren, args: [TreeItemComponent, { descendants: true },] }],
3996
+ fieldsetComponent: [{ type: ContentChildren, args: [FieldsetComponent,] }],
3997
+ searchBarComponent: [{ type: ContentChildren, args: [SearchBarComponent,] }],
3998
+ innerHtml: [{ type: ViewChild, args: ['innerHtml', { static: true },] }]
3999
+ };
4000
+ __decorate([
4001
+ DesyOnInputChange('onSearchMatchValuesChange')
4002
+ ], TreeComponent.prototype, "searchMatchValues", void 0);
4003
+ __decorate([
4004
+ DesyOnInputChange('configureAllItems')
4005
+ ], TreeComponent.prototype, "allItems", void 0);
4006
+ __decorate([
4007
+ DesyContentChild({ onSetCallbackName: 'overrideFieldsetParams' })
4008
+ ], TreeComponent.prototype, "fieldsetComponent", void 0);
4009
+ __decorate([
4010
+ DesyContentChild({ onSetCallbackName: 'overrideSearchBarParams' })
4011
+ ], TreeComponent.prototype, "searchBarComponent", void 0);
4012
+
3054
4013
  class ConditionDirective {
3055
4014
  constructor(templateRef) {
3056
4015
  this.templateRef = templateRef;
@@ -3085,6 +4044,30 @@ ConditionDirective.propDecorators = {
3085
4044
  items: [{ type: Input }]
3086
4045
  };
3087
4046
 
4047
+ class TreeItemsGeneratorComponent {
4048
+ constructor(viewContainerRef) {
4049
+ this.viewContainerRef = viewContainerRef;
4050
+ }
4051
+ ngOnInit() {
4052
+ this.viewContainerRef.createEmbeddedView(this.content);
4053
+ }
4054
+ }
4055
+ TreeItemsGeneratorComponent.decorators = [
4056
+ { type: Component, args: [{
4057
+ selector: 'desy-tree-items-generator',
4058
+ template: "<ng-template #content>\r\n <ng-container *ngIf=\"items && itemTemplate\">\r\n <ng-container *ngFor=\"let item of items\">\r\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: {item: item}\"></ng-container>\r\n </ng-container>\r\n </ng-container>\r\n</ng-template>\r\n",
4059
+ changeDetection: ChangeDetectionStrategy.OnPush
4060
+ },] }
4061
+ ];
4062
+ TreeItemsGeneratorComponent.ctorParameters = () => [
4063
+ { type: ViewContainerRef }
4064
+ ];
4065
+ TreeItemsGeneratorComponent.propDecorators = {
4066
+ content: [{ type: ViewChild, args: ['content', { static: true },] }],
4067
+ items: [{ type: Input }],
4068
+ itemTemplate: [{ type: Input }]
4069
+ };
4070
+
3088
4071
  class ModalButtonPrimaryComponent extends ContentBaseComponent {
3089
4072
  constructor() {
3090
4073
  super(...arguments);
@@ -3600,6 +4583,8 @@ class HeaderOffcanvasComponent {
3600
4583
  if (this.isOpen()) {
3601
4584
  this.dialogService.closeDialog(this.dialog);
3602
4585
  this.dialog = null;
4586
+ const elementToFocus = document.getElementById('header-offcanvas-button');
4587
+ elementToFocus === null || elementToFocus === void 0 ? void 0 : elementToFocus.focus();
3603
4588
  }
3604
4589
  }
3605
4590
  isOpen() {
@@ -3624,14 +4609,15 @@ class HeaderOffcanvasComponent {
3624
4609
  }
3625
4610
  HeaderOffcanvasComponent.dialogOptions = {
3626
4611
  id: 'header-offcanvas-dialog',
3627
- focusOnClose: 'header-offcanvas',
4612
+ focusOnClose: 'header-offcanvas-button',
3628
4613
  ariaModal: 'true',
3629
- ariaLabelledBy: 'header-offcanvas-button-text'
4614
+ ariaLabelledBy: 'header-offcanvas-button-text',
4615
+ role: 'dialog'
3630
4616
  };
3631
4617
  HeaderOffcanvasComponent.decorators = [
3632
4618
  { type: Component, args: [{
3633
4619
  selector: 'desy-header-offcanvas',
3634
- template: "\r\n<ng-template #offcanvasContent>\r\n <div class=\"origin-top-left left-0 fixed inset-0 h-screen\">\r\n <div class=\"h-full overflow-auto relative w-offcanvas h-screen ml-offcanvas-negative bg-white z-10\"\r\n [desyClickOutside]=\"isOpen()\" (clickOutside)=\"close()\">\r\n <div class=\"text-right p-sm\">\r\n <button (click)=\"close()\" id=\"header-offcanvas-button-close\" class=\"c-button c-button--sm c-button--transparent m-sm\"\r\n (desyContentEmpty)=\"handleEmptyContent('Header-offcanvas close button')\">\r\n <ng-container *desyCustomInnerContent=\"{ component: closeButton }\"></ng-container> <svg #desyContentEmptyIgnore xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 14 14\" width=\"14\" height=\"14\" class=\"self-center ml-2\"><path fill=\"currentColor\" d=\"M8.591 7.177a.25.25 0 010-.354l4.616-4.616A1 1 0 1011.793.793L7.177 5.409a.25.25 0 01-.354 0L2.207.793A1 1 0 00.793 2.207l4.616 4.616a.25.25 0 010 .354L.793 11.793a1 1 0 001.414 1.414l4.616-4.616a.25.25 0 01.354 0l4.616 4.616a1 1 0 001.414-1.414z\"/></svg>\r\n </button>\r\n </div>\r\n <ng-container *desyCustomInnerContent=\"{ component: content }\"></ng-container>\r\n </div>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-container *desyCustomInnerContent=\"{ component: button }\"></ng-container>\r\n"
4620
+ template: "\r\n<ng-template #offcanvasContent>\r\n <div class=\"origin-top-left left-0 fixed inset-0 h-screen\">\r\n <div class=\"h-full overflow-auto relative w-offcanvas h-screen ml-offcanvas-negative bg-white z-10\"\r\n [desyClickOutside]=\"isOpen()\" (clickOutside)=\"close()\">\r\n <div class=\"text-right p-sm\">\r\n <button (click)=\"close()\" id=\"header-offcanvas-button-close\" class=\"c-button c-button--sm c-button--transparent m-sm\"\r\n (desyContentEmpty)=\"handleEmptyContent('Header-offcanvas close button')\">\r\n <ng-container *desyCustomInnerContent=\"{ component: closeButton }\"></ng-container> <svg #desyContentEmptyIgnore xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 14 14\" width=\"14\" height=\"14\" class=\"self-center ml-2\" aria-hidden=\"true\"><path fill=\"currentColor\" d=\"M8.591 7.177a.25.25 0 010-.354l4.616-4.616A1 1 0 1011.793.793L7.177 5.409a.25.25 0 01-.354 0L2.207.793A1 1 0 00.793 2.207l4.616 4.616a.25.25 0 010 .354L.793 11.793a1 1 0 001.414 1.414l4.616-4.616a.25.25 0 01.354 0l4.616 4.616a1 1 0 001.414-1.414z\"/></svg>\r\n </button>\r\n </div>\r\n <ng-container *desyCustomInnerContent=\"{ component: content }\"></ng-container>\r\n </div>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-container *desyCustomInnerContent=\"{ component: button }\"></ng-container>\r\n"
3635
4621
  },] }
3636
4622
  ];
3637
4623
  HeaderOffcanvasComponent.ctorParameters = () => [
@@ -3798,11 +4784,42 @@ class NavComponent extends AccessibilityComponent {
3798
4784
  getIdPrefix() {
3799
4785
  return this.idPrefix ? this.idPrefix : 'nav-item';
3800
4786
  }
4787
+ movePrevious(event, currentIndex) {
4788
+ event.preventDefault();
4789
+ const items = this.getItemList();
4790
+ let nextIndex = currentIndex - 1;
4791
+ while (nextIndex >= 0 && !this.isFocusableItem(items[nextIndex])) {
4792
+ nextIndex--;
4793
+ }
4794
+ if (nextIndex < items.length) {
4795
+ const itemElem = document.getElementById(this.getItemId(items[nextIndex], nextIndex));
4796
+ if (itemElem) {
4797
+ itemElem.focus();
4798
+ }
4799
+ }
4800
+ }
4801
+ moveNext(event, currentIndex) {
4802
+ event.preventDefault();
4803
+ const items = this.getItemList();
4804
+ let nextIndex = currentIndex + 1;
4805
+ while (nextIndex < items.length && !this.isFocusableItem(items[nextIndex])) {
4806
+ nextIndex++;
4807
+ }
4808
+ if (nextIndex < items.length) {
4809
+ const itemElem = document.getElementById(this.getItemId(items[nextIndex], nextIndex));
4810
+ if (itemElem) {
4811
+ itemElem.focus();
4812
+ }
4813
+ }
4814
+ }
4815
+ isFocusableItem(item) {
4816
+ return !item.active && !item.disabled;
4817
+ }
3801
4818
  }
3802
4819
  NavComponent.decorators = [
3803
4820
  { type: Component, args: [{
3804
4821
  selector: 'desy-nav',
3805
- template: "<ng-template #innerHtml>\r\n <ng-container *ngFor=\"let item of getItemList(); index as i\">\r\n <li>\r\n <span *ngIf=\"item.active\"\r\n [class]=\"['flex items-center px-base py-sm font-semibold', item.classes] | makeHtmlList\"\r\n [attr.id]=\"getItemId(item, i)\"\r\n [attr.title]=\"item.title ? item.title : null\"\r\n [attr.role]=\"item.role ? item.role : null\"\r\n [attr.aria-label]=\"item.ariaLabel ? item.ariaLabel : null\"\r\n [attr.aria-describedby]=\"item.ariaDescribedBy ? item.ariaDescribedBy : null\"\r\n [attr.aria-labelledby]=\"item.ariaLabelledBy ? item.ariaLabelledBy : null\"\r\n [attr.aria-hidden]=\"item.ariaHidden ? item.ariaHidden : null\"\r\n [attr.aria-disabled]=\"item.disabled ? item.disabled : null\"\r\n [attr.aria-controls]=\"item.ariaControls ? item.ariaControls : null\"\r\n [attr.aria-current]=\"hasNav ? 'true' : 'page'\"\r\n [attr.aria-live]=\"item.ariaLive ? item.ariaLive : null\"\r\n [attr.aria-expanded]=\"item.ariaExpanded ? item.ariaExpanded : null\"\r\n [attr.aria-errormessage]=\"item.ariaErrorMessage ? item.ariaErrorMessage : null\"\r\n [attr.aria-haspopup]=\"item.ariaHasPopup ? item.ariaHasPopup : null\"\r\n [attr.tabindex]=\"item.tabindex\"\r\n (click)=\"onClick($event, item)\">\r\n <strong>\r\n <ng-container *desyCustomInnerContent=\"{ component: item, html: item.html, text: item.text }\"></ng-container>\r\n </strong>\r\n </span>\r\n <a *ngIf=\"!item.active && item.href\"\r\n [href]=\"item.href | externalHref\" [target]=\"item.target\"\r\n [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', item.classes] | makeHtmlList\"\r\n [ngClass]=\"{'pointer-events-none': item.disabled}\"\r\n [attr.aria-disabled]=\"item.disabled ? 'true' : null\"\r\n [attr.tabindex]=\"item.disabled ? -1 : item.tabindex\"\r\n [attr.id]=\"getItemId(item, i)\"\r\n [attr.title]=\"item.title ? item.title : null\"\r\n [attr.role]=\"item.role ? item.role : null\"\r\n [attr.aria-label]=\"item.ariaLabel ? item.ariaLabel : null\"\r\n [attr.aria-describedby]=\"item.ariaDescribedBy ? item.ariaDescribedBy : null\"\r\n [attr.aria-labelledby]=\"item.ariaLabelledBy ? item.ariaLabelledBy : null\"\r\n [attr.aria-hidden]=\"item.ariaHidden ? item.ariaHidden : null\"\r\n [attr.aria-controls]=\"item.ariaControls ? item.ariaControls : null\"\r\n [attr.aria-current]=\"item.ariaCurrent ? item.ariaCurrent : null\"\r\n [attr.aria-live]=\"item.ariaLive ? item.ariaLive : null\"\r\n [attr.aria-expanded]=\"item.ariaExpanded ? item.ariaExpanded : null\"\r\n [attr.aria-errormessage]=\"item.ariaErrorMessage ? item.ariaErrorMessage : null\"\r\n [attr.aria-haspopup]=\"item.ariaHasPopup ? item.ariaHasPopup : null\"\r\n (desyContentEmpty)=\"handleContentEmpty(i)\"\r\n (click)=\"onClick($event, item)\">\r\n <ng-container *desyCustomInnerContent=\"{ component: item, html: item.html, text: item.text }\"></ng-container>\r\n <svg #desyContentEmptyIgnore *ngIf=\"item.disabled\" viewBox=\"0 0 140 140\" height=\"1em\" width=\"1em\" xmlns=\"http://www.w3.org/2000/svg\" class=\"inline-block align-middle ml-sm text-neutral-base fill-current\" aria-hidden=\"true\" focusable=\"false\" ><path d=\"M70 0a70 70 0 1070 70A70.08 70.08 0 0070 0zM20 70a50 50 0 0174.8-43.4 2.51 2.51 0 011.23 1.84 2.48 2.48 0 01-.71 2.1L30.54 95.32a2.51 2.51 0 01-3.94-.52A49.63 49.63 0 0120 70zm100 0a50 50 0 01-74.8 43.4 2.51 2.51 0 01-1.23-1.84 2.48 2.48 0 01.71-2.1l64.78-64.78a2.51 2.51 0 013.94.52A49.63 49.63 0 01120 70z\"/></svg>\r\n </a>\r\n <a *ngIf=\"!item.active && !item.href\"\r\n [routerLink]=\"item.routerLink\" [fragment]=\"item.fragment\"\r\n [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', item.classes] | makeHtmlList\"\r\n [ngClass]=\"{'pointer-events-none': item.disabled}\"\r\n [attr.aria-disabled]=\"item.disabled ? 'true' : null\"\r\n [attr.tabindex]=\"item.disabled ? -1 : item.tabindex\"\r\n [attr.id]=\"getItemId(item, i)\"\r\n [attr.title]=\"item.title ? item.title : null\"\r\n [attr.role]=\"item.role ? item.role : null\"\r\n [attr.aria-label]=\"item.ariaLabel ? item.ariaLabel : null\"\r\n [attr.aria-describedby]=\"item.ariaDescribedBy ? item.ariaDescribedBy : null\"\r\n [attr.aria-labelledby]=\"item.ariaLabelledBy ? item.ariaLabelledBy : null\"\r\n [attr.aria-hidden]=\"item.ariaHidden ? item.ariaHidden : null\"\r\n [attr.aria-controls]=\"item.ariaControls ? item.ariaControls : null\"\r\n [attr.aria-current]=\"item.ariaCurrent ? item.ariaCurrent : null\"\r\n [attr.aria-live]=\"item.ariaLive ? item.ariaLive : null\"\r\n [attr.aria-expanded]=\"item.ariaExpanded ? item.ariaExpanded : null\"\r\n [attr.aria-errormessage]=\"item.ariaErrorMessage ? item.ariaErrorMessage : null\"\r\n [attr.aria-haspopup]=\"item.ariaHasPopup ? item.ariaHasPopup : null\"\r\n (click)=\"onClick($event, item)\"\r\n (desyContentEmpty)=\"handleContentEmpty(i)\">\r\n <ng-container *desyCustomInnerContent=\"{ component: item, html: item.html, text: item.text }\"></ng-container>\r\n <svg #desyContentEmptyIgnore *ngIf=\"item.disabled\" viewBox=\"0 0 140 140\" height=\"1em\" width=\"1em\" xmlns=\"http://www.w3.org/2000/svg\" class=\"inline-block align-middle ml-sm text-neutral-base fill-current\" aria-hidden=\"true\" focusable=\"false\" ><path d=\"M70 0a70 70 0 1070 70A70.08 70.08 0 0070 0zM20 70a50 50 0 0174.8-43.4 2.51 2.51 0 011.23 1.84 2.48 2.48 0 01-.71 2.1L30.54 95.32a2.51 2.51 0 01-3.94-.52A49.63 49.63 0 0120 70zm100 0a50 50 0 01-74.8 43.4 2.51 2.51 0 01-1.23-1.84 2.48 2.48 0 01.71-2.1l64.78-64.78a2.51 2.51 0 013.94.52A49.63 49.63 0 01120 70z\"/></svg>\r\n </a>\r\n </li>\r\n <li *ngIf=\"item.divider\" class=\"my-sm border-b border-neutral-base\" aria-hidden=\"true\">\r\n <div class=\"sr-only\">Separador</div>\r\n </li>\r\n </ng-container>\r\n</ng-template>\r\n\r\n\r\n<ul *ngIf=\"!hasNav; else wrapIntoNav\"\r\n [class]=\"['text-sm', classes] | makeHtmlList\"\r\n [attr.aria-label]=\"ariaLabel ? ariaLabel : null\"\r\n [attr.aria-describedby]=\"ariaDescribedBy ? ariaDescribedBy : null\"\r\n [attr.aria-labelledby]=\"ariaLabelledBy ? ariaLabelledBy : null\"\r\n [attr.aria-hidden]=\"ariaHidden ? ariaHidden : null\"\r\n [attr.aria-disabled]=\"ariaDisabled ? ariaDisabled : null\"\r\n [attr.aria-controls]=\"ariaControls ? ariaControls : null\"\r\n [attr.aria-current]=\"ariaCurrent ? ariaCurrent : null\"\r\n [attr.aria-live]=\"ariaLive ? ariaLive : null\"\r\n [attr.aria-expanded]=\"ariaExpanded ? ariaExpanded : null\"\r\n [attr.aria-errormessage]=\"ariaErrorMessage ? ariaErrorMessage : null\"\r\n [attr.aria-haspopup]=\"ariaHasPopup ? ariaHasPopup : null\"\r\n [attr.tabindex]=\"tabindex ? tabindex : null\">\r\n <ng-container *ngTemplateOutlet=\"innerHtml\"></ng-container>\r\n</ul>\r\n<ng-template #wrapIntoNav>\r\n <nav [class]=\"['text-sm', classes] | makeHtmlList\"\r\n [attr.role]=\"role ? role : null\"\r\n [attr.aria-label]=\"ariaLabel ? ariaLabel : null\"\r\n [attr.aria-describedby]=\"ariaDescribedBy ? ariaDescribedBy : null\"\r\n [attr.aria-labelledby]=\"ariaLabelledBy ? ariaLabelledBy : null\"\r\n [attr.aria-hidden]=\"ariaHidden ? ariaHidden : null\"\r\n [attr.aria-disabled]=\"ariaDisabled ? ariaDisabled : null\"\r\n [attr.aria-controls]=\"ariaControls ? ariaControls : null\"\r\n [attr.aria-current]=\"ariaCurrent ? ariaCurrent : null\"\r\n [attr.aria-live]=\"ariaLive ? ariaLive : null\"\r\n [attr.aria-expanded]=\"ariaExpanded ? ariaExpanded : null\"\r\n [attr.aria-errormessage]=\"ariaErrorMessage ? ariaErrorMessage : null\"\r\n [attr.aria-haspopup]=\"ariaHasPopup ? ariaHasPopup : null\"\r\n [attr.tabindex]=\"tabindex ? tabindex : null\">\r\n <ul>\r\n <ng-container *ngTemplateOutlet=\"innerHtml\"></ng-container>\r\n </ul>\r\n </nav>\r\n</ng-template>\r\n"
4822
+ template: "<ng-template #innerHtml>\r\n <ng-container *ngFor=\"let item of getItemList(); index as i\">\r\n <li>\r\n <span *ngIf=\"item.active\"\r\n [class]=\"['flex items-center px-base py-sm font-semibold', item.classes] | makeHtmlList\"\r\n [attr.id]=\"getItemId(item, i)\"\r\n [attr.title]=\"item.title ? item.title : null\"\r\n [attr.role]=\"item.role ? item.role : null\"\r\n [attr.aria-label]=\"item.ariaLabel ? item.ariaLabel : null\"\r\n [attr.aria-describedby]=\"item.ariaDescribedBy ? item.ariaDescribedBy : null\"\r\n [attr.aria-labelledby]=\"item.ariaLabelledBy ? item.ariaLabelledBy : null\"\r\n [attr.aria-hidden]=\"item.ariaHidden ? item.ariaHidden : null\"\r\n [attr.aria-disabled]=\"item.disabled ? item.disabled : null\"\r\n [attr.aria-controls]=\"item.ariaControls ? item.ariaControls : null\"\r\n [attr.aria-current]=\"hasNav ? 'true' : 'page'\"\r\n [attr.aria-live]=\"item.ariaLive ? item.ariaLive : null\"\r\n [attr.aria-expanded]=\"item.ariaExpanded ? item.ariaExpanded : null\"\r\n [attr.aria-errormessage]=\"item.ariaErrorMessage ? item.ariaErrorMessage : null\"\r\n [attr.aria-haspopup]=\"item.ariaHasPopup ? item.ariaHasPopup : null\"\r\n [attr.tabindex]=\"item.tabindex\"\r\n (click)=\"onClick($event, item)\">\r\n <strong>\r\n <ng-container *desyCustomInnerContent=\"{ component: item, html: item.html, text: item.text }\"></ng-container>\r\n </strong>\r\n </span>\r\n <a *ngIf=\"!item.active && item.href\"\r\n [href]=\"item.href | externalHref\" [target]=\"item.target\"\r\n [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', item.classes] | makeHtmlList\"\r\n [ngClass]=\"{'pointer-events-none': item.disabled}\"\r\n [attr.aria-disabled]=\"item.disabled ? 'true' : null\"\r\n [attr.tabindex]=\"item.disabled ? -1 : item.tabindex\"\r\n [attr.id]=\"getItemId(item, i)\"\r\n [attr.title]=\"item.title ? item.title : null\"\r\n [attr.role]=\"item.role ? item.role : null\"\r\n [attr.aria-label]=\"item.ariaLabel ? item.ariaLabel : null\"\r\n [attr.aria-describedby]=\"item.ariaDescribedBy ? item.ariaDescribedBy : null\"\r\n [attr.aria-labelledby]=\"item.ariaLabelledBy ? item.ariaLabelledBy : null\"\r\n [attr.aria-hidden]=\"item.ariaHidden ? item.ariaHidden : null\"\r\n [attr.aria-controls]=\"item.ariaControls ? item.ariaControls : null\"\r\n [attr.aria-current]=\"item.ariaCurrent ? item.ariaCurrent : null\"\r\n [attr.aria-live]=\"item.ariaLive ? item.ariaLive : null\"\r\n [attr.aria-expanded]=\"item.ariaExpanded ? item.ariaExpanded : null\"\r\n [attr.aria-errormessage]=\"item.ariaErrorMessage ? item.ariaErrorMessage : null\"\r\n [attr.aria-haspopup]=\"item.ariaHasPopup ? item.ariaHasPopup : null\"\r\n (desyContentEmpty)=\"handleContentEmpty(i)\"\r\n (keydown.arrowUp)=\"movePrevious($event, i)\"\r\n (keydown.arrowDown)=\"moveNext($event, i)\"\r\n (click)=\"onClick($event, item)\">\r\n <ng-container *desyCustomInnerContent=\"{ component: item, html: item.html, text: item.text }\"></ng-container>\r\n <svg #desyContentEmptyIgnore *ngIf=\"item.disabled\" viewBox=\"0 0 140 140\" height=\"1em\" width=\"1em\" xmlns=\"http://www.w3.org/2000/svg\" class=\"inline-block align-middle ml-sm text-neutral-base fill-current\" aria-hidden=\"true\" focusable=\"false\" ><path d=\"M70 0a70 70 0 1070 70A70.08 70.08 0 0070 0zM20 70a50 50 0 0174.8-43.4 2.51 2.51 0 011.23 1.84 2.48 2.48 0 01-.71 2.1L30.54 95.32a2.51 2.51 0 01-3.94-.52A49.63 49.63 0 0120 70zm100 0a50 50 0 01-74.8 43.4 2.51 2.51 0 01-1.23-1.84 2.48 2.48 0 01.71-2.1l64.78-64.78a2.51 2.51 0 013.94.52A49.63 49.63 0 01120 70z\"/></svg>\r\n </a>\r\n <a *ngIf=\"!item.active && !item.href\"\r\n [routerLink]=\"item.routerLink\" [fragment]=\"item.fragment\"\r\n [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', item.classes] | makeHtmlList\"\r\n [ngClass]=\"{'pointer-events-none': item.disabled}\"\r\n [attr.aria-disabled]=\"item.disabled ? 'true' : null\"\r\n [attr.tabindex]=\"item.disabled ? -1 : item.tabindex\"\r\n [attr.id]=\"getItemId(item, i)\"\r\n [attr.title]=\"item.title ? item.title : null\"\r\n [attr.role]=\"item.role ? item.role : null\"\r\n [attr.aria-label]=\"item.ariaLabel ? item.ariaLabel : null\"\r\n [attr.aria-describedby]=\"item.ariaDescribedBy ? item.ariaDescribedBy : null\"\r\n [attr.aria-labelledby]=\"item.ariaLabelledBy ? item.ariaLabelledBy : null\"\r\n [attr.aria-hidden]=\"item.ariaHidden ? item.ariaHidden : null\"\r\n [attr.aria-controls]=\"item.ariaControls ? item.ariaControls : null\"\r\n [attr.aria-current]=\"item.ariaCurrent ? item.ariaCurrent : null\"\r\n [attr.aria-live]=\"item.ariaLive ? item.ariaLive : null\"\r\n [attr.aria-expanded]=\"item.ariaExpanded ? item.ariaExpanded : null\"\r\n [attr.aria-errormessage]=\"item.ariaErrorMessage ? item.ariaErrorMessage : null\"\r\n [attr.aria-haspopup]=\"item.ariaHasPopup ? item.ariaHasPopup : null\"\r\n (keydown.arrowUp)=\"movePrevious($event, i)\"\r\n (keydown.arrowDown)=\"moveNext($event, i)\"\r\n (click)=\"onClick($event, item)\"\r\n (desyContentEmpty)=\"handleContentEmpty(i)\">\r\n <ng-container *desyCustomInnerContent=\"{ component: item, html: item.html, text: item.text }\"></ng-container>\r\n <svg #desyContentEmptyIgnore *ngIf=\"item.disabled\" viewBox=\"0 0 140 140\" height=\"1em\" width=\"1em\" xmlns=\"http://www.w3.org/2000/svg\" class=\"inline-block align-middle ml-sm text-neutral-base fill-current\" aria-hidden=\"true\" focusable=\"false\" ><path d=\"M70 0a70 70 0 1070 70A70.08 70.08 0 0070 0zM20 70a50 50 0 0174.8-43.4 2.51 2.51 0 011.23 1.84 2.48 2.48 0 01-.71 2.1L30.54 95.32a2.51 2.51 0 01-3.94-.52A49.63 49.63 0 0120 70zm100 0a50 50 0 01-74.8 43.4 2.51 2.51 0 01-1.23-1.84 2.48 2.48 0 01.71-2.1l64.78-64.78a2.51 2.51 0 013.94.52A49.63 49.63 0 01120 70z\"/></svg>\r\n </a>\r\n </li>\r\n <li *ngIf=\"item.divider\" class=\"my-sm border-b border-neutral-base\" aria-hidden=\"true\">\r\n <div class=\"sr-only\">Separador</div>\r\n </li>\r\n </ng-container>\r\n</ng-template>\r\n\r\n\r\n<ul *ngIf=\"!hasNav; else wrapIntoNav\"\r\n [class]=\"['text-sm', classes] | makeHtmlList\"\r\n [attr.aria-label]=\"ariaLabel ? ariaLabel : null\"\r\n [attr.aria-describedby]=\"ariaDescribedBy ? ariaDescribedBy : null\"\r\n [attr.aria-labelledby]=\"ariaLabelledBy ? ariaLabelledBy : null\"\r\n [attr.aria-hidden]=\"ariaHidden ? ariaHidden : null\"\r\n [attr.aria-disabled]=\"ariaDisabled ? ariaDisabled : null\"\r\n [attr.aria-controls]=\"ariaControls ? ariaControls : null\"\r\n [attr.aria-current]=\"ariaCurrent ? ariaCurrent : null\"\r\n [attr.aria-live]=\"ariaLive ? ariaLive : null\"\r\n [attr.aria-expanded]=\"ariaExpanded ? ariaExpanded : null\"\r\n [attr.aria-errormessage]=\"ariaErrorMessage ? ariaErrorMessage : null\"\r\n [attr.aria-haspopup]=\"ariaHasPopup ? ariaHasPopup : null\"\r\n [attr.tabindex]=\"tabindex ? tabindex : null\">\r\n <ng-container *ngTemplateOutlet=\"innerHtml\"></ng-container>\r\n</ul>\r\n<ng-template #wrapIntoNav>\r\n <nav [class]=\"['text-sm', classes] | makeHtmlList\"\r\n [attr.role]=\"role ? role : null\"\r\n [attr.aria-label]=\"ariaLabel ? ariaLabel : null\"\r\n [attr.aria-describedby]=\"ariaDescribedBy ? ariaDescribedBy : null\"\r\n [attr.aria-labelledby]=\"ariaLabelledBy ? ariaLabelledBy : null\"\r\n [attr.aria-hidden]=\"ariaHidden ? ariaHidden : null\"\r\n [attr.aria-disabled]=\"ariaDisabled ? ariaDisabled : null\"\r\n [attr.aria-controls]=\"ariaControls ? ariaControls : null\"\r\n [attr.aria-current]=\"ariaCurrent ? ariaCurrent : null\"\r\n [attr.aria-live]=\"ariaLive ? ariaLive : null\"\r\n [attr.aria-expanded]=\"ariaExpanded ? ariaExpanded : null\"\r\n [attr.aria-errormessage]=\"ariaErrorMessage ? ariaErrorMessage : null\"\r\n [attr.aria-haspopup]=\"ariaHasPopup ? ariaHasPopup : null\"\r\n [attr.tabindex]=\"tabindex ? tabindex : null\">\r\n <ul>\r\n <ng-container *ngTemplateOutlet=\"innerHtml\"></ng-container>\r\n </ul>\r\n </nav>\r\n</ng-template>\r\n"
3806
4823
  },] }
3807
4824
  ];
3808
4825
  NavComponent.propDecorators = {
@@ -3832,7 +4849,7 @@ class HeaderSubnavComponent extends AccessibilityComponent {
3832
4849
  HeaderSubnavComponent.decorators = [
3833
4850
  { type: Component, args: [{
3834
4851
  selector: 'desy-header-subnav',
3835
- template: "<ng-template #templateNav>\r\n <ng-content select=\"desy-nav\"></ng-content>\r\n</ng-template>\r\n\r\n<ng-template #templateContent>\r\n <ng-content></ng-content>\r\n</ng-template>\r\n\r\n<div class=\"hidden lg:flex items-center\" *ngIf=\"hasSubnavItems(); else noItems\">\r\n <div class=\"ml-3 py-2 relative border-r border-l border-neutral-base\">\r\n <h2 id=\"subnav-title\" class=\"\">\r\n <desy-dropdown [hiddenText]=\"hiddenText\"\r\n [classesContainer]=\"classesContainer\"\r\n [classesTooltip]=\"classesTooltip\"\r\n [classes]=\"classes ? classes : 'c-dropdown--header'\"\r\n [caller]=\"caller\"\r\n\r\n [role]=\"role\"\r\n [ariaLabel]=\"ariaLabel\"\r\n [ariaDescribedBy]=\"ariaDescribedBy\"\r\n [ariaLabelledBy]=\"ariaLabelledBy\"\r\n [ariaHidden]=\"ariaHidden\"\r\n [ariaDisabled]=\"ariaDisabled\"\r\n [ariaControls]=\"ariaControls\"\r\n [ariaCurrent]=\"ariaCurrent\"\r\n [ariaLive]=\"ariaLive\"\r\n [ariaExpanded]=\"ariaExpanded\"\r\n [ariaErrorMessage]=\"ariaErrorMessage\"\r\n [ariaHasPopup]=\"ariaHasPopup\"\r\n [tabindex]=\"tabindex\">\r\n <ng-container *ngTemplateOutlet=\"templateContent\"></ng-container>\r\n </desy-dropdown>\r\n <ng-template #caller>\r\n <ng-container *ngTemplateOutlet=\"templateNav\"></ng-container>\r\n </ng-template>\r\n </h2>\r\n </div>\r\n</div>\r\n<ng-template #noItems>\r\n <p class=\"hidden lg:inline-block align-middle ml-4 px-3 py-4 border-r border-l border-neutral-base text-sm text-white\"\r\n (desyContentEmpty)=\"handleEmptyContent('Header-subnav')\">\r\n <span #desyContentEmptyIgnore class=\"sr-only\">Aplicaci\u00F3n actual: </span>\r\n <ng-container *ngTemplateOutlet=\"templateContent\"></ng-container>\r\n </p>\r\n</ng-template>\r\n\r\n\r\n"
4852
+ template: "<ng-template #templateNav>\r\n <ng-content select=\"desy-nav\"></ng-content>\r\n</ng-template>\r\n\r\n<ng-template #templateContent>\r\n <ng-content></ng-content>\r\n</ng-template>\r\n\r\n<div class=\"hidden lg:flex items-center\" *ngIf=\"hasSubnavItems(); else noItems\">\r\n <div class=\"ml-3 py-2 relative border-r border-l border-neutral-base\">\r\n <p class=\"sr-only\">Aplicaci\u00F3n actual: </p>\r\n <desy-dropdown [hiddenText]=\"hiddenText\"\r\n [classesContainer]=\"classesContainer\"\r\n [classesTooltip]=\"classesTooltip\"\r\n [classes]=\"classes ? classes : 'c-dropdown--header'\"\r\n [caller]=\"caller\"\r\n\r\n [role]=\"role\"\r\n [ariaLabel]=\"ariaLabel\"\r\n [ariaDescribedBy]=\"ariaDescribedBy\"\r\n [ariaLabelledBy]=\"ariaLabelledBy\"\r\n [ariaHidden]=\"ariaHidden\"\r\n [ariaDisabled]=\"ariaDisabled\"\r\n [ariaControls]=\"ariaControls\"\r\n [ariaCurrent]=\"ariaCurrent\"\r\n [ariaLive]=\"ariaLive\"\r\n [ariaExpanded]=\"ariaExpanded\"\r\n [ariaErrorMessage]=\"ariaErrorMessage\"\r\n [ariaHasPopup]=\"ariaHasPopup\"\r\n [tabindex]=\"tabindex\">\r\n <ng-container *ngTemplateOutlet=\"templateContent\"></ng-container>\r\n <ng-template #caller>\r\n <ng-container *ngTemplateOutlet=\"templateNav\"></ng-container>\r\n </ng-template>\r\n </desy-dropdown>\r\n </div>\r\n</div>\r\n<ng-template #noItems>\r\n <p class=\"hidden lg:inline-block align-middle ml-4 px-3 py-4 border-r border-l border-neutral-base text-sm text-white\"\r\n (desyContentEmpty)=\"handleEmptyContent('Header-subnav')\">\r\n <span #desyContentEmptyIgnore class=\"sr-only\">Aplicaci\u00F3n actual: </span>\r\n <ng-container *ngTemplateOutlet=\"templateContent\"></ng-container>\r\n </p>\r\n</ng-template>\r\n\r\n\r\n"
3836
4853
  },] }
3837
4854
  ];
3838
4855
  HeaderSubnavComponent.propDecorators = {
@@ -3861,7 +4878,7 @@ class HeaderDropdownComponent extends AccessibilityComponent {
3861
4878
  HeaderDropdownComponent.decorators = [
3862
4879
  { type: Component, args: [{
3863
4880
  selector: 'desy-header-dropdown',
3864
- template: "<div class=\"ml-4 flex items-center lg:ml-6\">\r\n <div class=\"ml-3 relative\">\r\n <desy-dropdown [hiddenText]=\"hiddenText\"\r\n [classesContainer]=\"classesContainer ? classesContainer : 'hidden lg:block'\"\r\n [classesTooltip]=\"classesTooltip\"\r\n [classes]=\"classes ? classes : 'c-dropdown--header'\"\r\n [caller]=\"caller\"\r\n\r\n [role]=\"role\"\r\n [ariaLabel]=\"ariaLabel\"\r\n [ariaDescribedBy]=\"ariaDescribedBy\"\r\n [ariaLabelledBy]=\"ariaLabelledBy\"\r\n [ariaHidden]=\"ariaHidden\"\r\n [ariaDisabled]=\"ariaDisabled\"\r\n [ariaControls]=\"ariaControls\"\r\n [ariaCurrent]=\"ariaCurrent\"\r\n [ariaLive]=\"ariaLive\"\r\n [ariaExpanded]=\"ariaExpanded\"\r\n [ariaErrorMessage]=\"ariaErrorMessage\"\r\n [ariaHasPopup]=\"ariaHasPopup\"\r\n [tabindex]=\"tabindex\">\r\n <ng-content></ng-content>\r\n </desy-dropdown>\r\n <ng-template #caller>\r\n <ng-content select=\"desy-nav\"></ng-content>\r\n </ng-template>\r\n </div>\r\n</div>\r\n"
4881
+ template: "<div class=\"ml-4 flex items-center lg:ml-6\">\r\n <div class=\"ml-3 relative\">\r\n <desy-dropdown [hiddenText]=\"hiddenText\"\r\n [classesContainer]=\"classesContainer ? classesContainer : 'hidden lg:block'\"\r\n [classesTooltip]=\"classesTooltip\"\r\n [classes]=\"classes ? classes : 'c-dropdown--header'\"\r\n [caller]=\"caller\"\r\n\r\n [role]=\"role\"\r\n [ariaLabel]=\"ariaLabel\"\r\n [ariaDescribedBy]=\"ariaDescribedBy\"\r\n [ariaLabelledBy]=\"ariaLabelledBy\"\r\n [ariaHidden]=\"ariaHidden\"\r\n [ariaDisabled]=\"ariaDisabled\"\r\n [ariaControls]=\"ariaControls\"\r\n [ariaCurrent]=\"ariaCurrent\"\r\n [ariaLive]=\"ariaLive\"\r\n [ariaExpanded]=\"ariaExpanded\"\r\n [ariaErrorMessage]=\"ariaErrorMessage\"\r\n [ariaHasPopup]=\"ariaHasPopup\"\r\n [tabindex]=\"tabindex\">\r\n <ng-content></ng-content>\r\n </desy-dropdown>\r\n <ng-template #caller>\r\n <ng-container *desyCustomInnerContent=\"{ component: contentComponent, template: templateNav }\"></ng-container>\r\n </ng-template>\r\n </div>\r\n</div>\r\n\r\n<ng-template #templateNav>\r\n <ng-content select=\"desy-nav\"></ng-content>\r\n</ng-template>\r\n"
3865
4882
  },] }
3866
4883
  ];
3867
4884
  HeaderDropdownComponent.propDecorators = {
@@ -3869,11 +4886,15 @@ HeaderDropdownComponent.propDecorators = {
3869
4886
  classesContainer: [{ type: Input }],
3870
4887
  classesTooltip: [{ type: Input }],
3871
4888
  classes: [{ type: Input }],
3872
- nav: [{ type: ContentChildren, args: [NavComponent,] }]
4889
+ nav: [{ type: ContentChildren, args: [NavComponent,] }],
4890
+ contentComponent: [{ type: ContentChildren, args: [ContentComponent,] }]
3873
4891
  };
3874
4892
  __decorate([
3875
4893
  DesyContentChild({ onSetCallbackName: 'overrideNavParams' })
3876
- ], HeaderDropdownComponent.prototype, "nav", void 0);
4894
+ ], HeaderDropdownComponent.prototype, "nav", void 0);
4895
+ __decorate([
4896
+ DesyContentChild()
4897
+ ], HeaderDropdownComponent.prototype, "contentComponent", void 0);
3877
4898
 
3878
4899
  class SkipLinkComponent extends AccessibilityComponent {
3879
4900
  constructor(changeDetectorRef) {
@@ -4306,7 +5327,7 @@ class MenuVerticalComponent extends AccessibilityComponent {
4306
5327
  else {
4307
5328
  const idPrefix = this.idPrefix ? this.idPrefix : 'nav-item';
4308
5329
  if (i === 0) {
4309
- return idPrefix;
5330
+ return idPrefix + '-0';
4310
5331
  }
4311
5332
  else {
4312
5333
  return idPrefix + '-' + i;
@@ -4343,11 +5364,20 @@ class MenuVerticalComponent extends AccessibilityComponent {
4343
5364
  const subItems = sub instanceof MenuVerticalItemSubComponent ? sub.itemComponents.toArray() : sub.items;
4344
5365
  return subItems && subItems.length > 0 ? subItems : null;
4345
5366
  }
5367
+ focus(id, idFocus) {
5368
+ const elementToQuitFocus = document.getElementById(id);
5369
+ elementToQuitFocus.blur();
5370
+ if (idFocus) {
5371
+ const elementToFocus = document.getElementById(idFocus);
5372
+ elementToFocus.tabIndex = 0;
5373
+ elementToFocus === null || elementToFocus === void 0 ? void 0 : elementToFocus.focus();
5374
+ }
5375
+ }
4346
5376
  }
4347
5377
  MenuVerticalComponent.decorators = [
4348
5378
  { type: Component, args: [{
4349
5379
  selector: 'desy-menu-vertical',
4350
- template: "<!--\r\n Template para ser utilizado tanto por los items como por los subitems:\r\n - item: Item que representa\r\n - index: indice del item en la lista\r\n - id: identificador del item\r\n - isRoot: si pertenece al nivel raiz\r\n-->\r\n<ng-template #itemTemplate let-item=\"item\" let-index=\"index\" let-id=\"id\" let-sub=\"sub\" let-isRoot=\"isRoot\">\r\n <ng-container *ngIf=\"item\">\r\n <li class=\"m-base\" [ngClass]=\"{'origin-top-left text-sm': !isRoot}\">\r\n <ng-container *ngIf=\"item.href || item.routerLink; else notHref\">\r\n <a *ngIf=\"item.href; else hasRouterLink\" [attr.id]=\"id\"\r\n (desyContentEmpty)=\"handleItemContentEmpty(index, isRoot)\"\r\n [href]=\"item.href | externalHref\"\r\n [class]=\"['block px-xs focus:bg-warning-base focus:outline-none focus:shadow-outline-focus focus:text-black', item.classes] | makeHtmlList\"\r\n [ngClass]=\"{\r\n 'underline': hasUnderline,\r\n 'hover:text-primary-base hover:underline': !item.disabled,\r\n 'no-underline pointer-events-none': item.disabled,\r\n 'font-bold': item.active\r\n }\"\r\n [attr.title]=\"item.title\"\r\n [attr.tabindex]=\"item.disabled ? -1 : null\"\r\n [attr.target]=\"item.target ? item.target : null\"\r\n [attr.aria-current]=\"item.active ? 'page' : null\"\r\n [attr.aria-disabled]=\"item.disabled\"\r\n [attr.aria-describedby]=\"item.ariaDescribedBy\"\r\n [attr.aria-errormessage]=\"item.ariaErrorMessage\"\r\n [attr.aria-label]=\"item.ariaLabel\"\r\n [attr.aria-labelledby]=\"item.ariaLabelledBy\"\r\n [attr.aria-hidden]=\"item.ariaHidden\"\r\n [attr.aria-controls]=\"item.ariaControls\"\r\n [attr.aria-live]=\"item.ariaLive\"\r\n [attr.aria-expanded]=\"item.ariaExpanded\"\r\n [attr.aria-haspopup]=\"item.ariaHasPopup\"\r\n [attr.disabled]=\"item.disabled\">\r\n <ng-container *desyCustomInnerContent=\"{ component: item, html: getItemHtml(item), text: item.text }\"></ng-container>\r\n </a>\r\n <ng-template #hasRouterLink>\r\n <!-- Todos los enlaces que admiten o href o routerLink estar\u00EDa bien unificarlos (en todos los componentes).\r\n Para ello, ser\u00EDa necesario crear una directiva para a\u00F1adir o quitar la directiva routerLink si no tiene href.\r\n Sin embargo, esto no es posible actualmente, ya que Angular todav\u00EDa no permite a\u00F1adir directivas din\u00E1micamente:\r\n https://angular.io/guide/roadmap#support-adding-directives-to-host-elements -->\r\n <a [attr.id]=\"id\"\r\n (desyContentEmpty)=\"handleItemContentEmpty(index, isRoot)\"\r\n [routerLink]=\"item.routerLink\" [fragment]=\"item.fragment ? item.fragment : null\"\r\n [routerLinkActive]=\"item.routerLinkActiveClasses ? item.routerLinkActiveClasses : []\"\r\n [class]=\"['block px-xs focus:bg-warning-base focus:outline-none focus:shadow-outline-focus focus:text-black', item.classes] | makeHtmlList\"\r\n [ngClass]=\"{\r\n 'underline': hasUnderline,\r\n 'hover:text-primary-base hover:underline': !item.disabled,\r\n 'no-underline pointer-events-none': item.disabled,\r\n 'font-bold': item.active\r\n }\"\r\n [attr.title]=\"item.title\"\r\n [attr.tabindex]=\"item.disabled ? -1 : null\"\r\n [attr.target]=\"item.target ? item.target : null\"\r\n [attr.aria-current]=\"item.active ? 'page' : null\"\r\n [attr.aria-disabled]=\"item.disabled\"\r\n [attr.aria-describedby]=\"item.ariaDescribedBy\"\r\n [attr.aria-errormessage]=\"item.ariaErrorMessage\"\r\n [attr.aria-label]=\"item.ariaLabel\"\r\n [attr.aria-labelledby]=\"item.ariaLabelledBy\"\r\n [attr.aria-hidden]=\"item.ariaHidden\"\r\n [attr.aria-controls]=\"item.ariaControls\"\r\n [attr.aria-live]=\"item.ariaLive\"\r\n [attr.aria-expanded]=\"item.ariaExpanded\"\r\n [attr.aria-haspopup]=\"item.ariaHasPopup\"\r\n [attr.disabled]=\"item.disabled\">\r\n <ng-container *desyCustomInnerContent=\"{ component: item, html: getItemHtml(item), text: item.text }\"></ng-container>\r\n </a>\r\n </ng-template>\r\n </ng-container>\r\n <ng-template #notHref>\r\n <span [attr.id]=\"id\"\r\n (desyContentEmpty)=\"handleItemContentEmpty(index, isRoot)\"\r\n [class]=\"['block px-xs', item.classes] | makeHtmlList\"\r\n [ngClass]=\"{'font-bold': item.active}\"\r\n\r\n [attr.title]=\"item.title\"\r\n [attr.tabindex]=\"item.disabled ? -1 : null\"\r\n [attr.aria-current]=\"item.active ? 'page' : null\"\r\n [attr.aria-disabled]=\"item.disabled\"\r\n [attr.aria-describedby]=\"item.ariaDescribedBy\"\r\n [attr.aria-errormessage]=\"item.ariaErrorMessage\"\r\n [attr.aria-label]=\"item.ariaLabel\"\r\n [attr.aria-labelledby]=\"item.ariaLabelledBy\"\r\n [attr.aria-hidden]=\"item.ariaHidden\"\r\n [attr.aria-controls]=\"item.ariaControls\"\r\n [attr.aria-live]=\"item.ariaLive\"\r\n [attr.aria-expanded]=\"item.ariaExpanded\"\r\n [attr.aria-haspopup]=\"item.ariaHasPopup\"\r\n [attr.disabled]=\"item.disabled\">\r\n <ng-container *desyCustomInnerContent=\"{ component: item, html: getItemHtml(item), text: item.text }\"></ng-container>\r\n </span>\r\n </ng-template>\r\n <ng-container *ngIf=\"isRoot && sub\">\r\n <ul *ngIf=\"getSubItems(sub)\" [ngClass]=\"sub.classes\"\r\n [attr.aria-describedby]=\"sub.ariaDescribedBy\"\r\n [attr.aria-errormessage]=\"sub.ariaErrorMessage\"\r\n [attr.aria-label]=\"sub.ariaLabel\"\r\n [attr.aria-labelledby]=\"sub.ariaLabelledBy\"\r\n [attr.aria-hidden]=\"sub.ariaHidden\"\r\n [attr.aria-disabled]=\"sub.ariaDisabled\"\r\n [attr.aria-controls]=\"sub.ariaControls\"\r\n [attr.aria-current]=\"sub.ariaCurrent\"\r\n [attr.aria-live]=\"sub.ariaLive\"\r\n [attr.aria-expanded]=\"sub.ariaExpanded\"\r\n [attr.aria-haspopup]=\"sub.ariaHasPopup\"\r\n [attr.tabindex]=\"sub.tabindex\">\r\n <ng-container *ngFor=\"let subItem of getSubItems(sub); index as subIndex\">\r\n <ng-container [ngTemplateOutlet]=\"itemTemplate\"\r\n [ngTemplateOutletContext]=\"{\r\n item: subItem,\r\n id: getSubItemId(item, index, subIndex),\r\n index: subIndex,\r\n isRoot: false\r\n }\">\r\n </ng-container>\r\n </ng-container>\r\n </ul>\r\n <div *ngIf=\"!getSubItems(sub)\"\r\n [class]=\"['mb-base px-xs origin-top-left text-sm text-neutral-dark', sub.classes] | makeHtmlList\"\r\n [id]=\"'sub-' + id\">\r\n <ng-container *desyCustomInnerContent=\"{ component: sub, html: sub.html }\"></ng-container>\r\n </div>\r\n </ng-container>\r\n </li>\r\n <li *ngIf=\"item.divider\" class=\"my-sm border-b border-neutral-base\" aria-hidden=\"true\">\r\n <div class=\"sr-only\">Separador</div>\r\n </li>\r\n </ng-container>\r\n</ng-template>\r\n\r\n<nav [ngClass]=\"classes\"\r\n [attr.role]=\"(role ? role : null)\"\r\n [attr.aria-describedby]=\"ariaDescribedBy\"\r\n [attr.aria-errormessage]=\"ariaErrorMessage\"\r\n [attr.aria-label]=\"ariaLabel\"\r\n [attr.aria-labelledby]=\"ariaLabelledBy\"\r\n [attr.aria-hidden]=\"ariaHidden\"\r\n [attr.aria-disabled]=\"ariaDisabled\"\r\n [attr.aria-controls]=\"ariaControls\"\r\n [attr.aria-current]=\"ariaCurrent\"\r\n [attr.aria-live]=\"ariaLive\"\r\n [attr.aria-expanded]=\"ariaExpanded\"\r\n [attr.aria-haspopup]=\"ariaHasPopup\"\r\n [attr.tabindex]=\"tabindex\">\r\n <ul class=\"text-base\">\r\n <ng-container *ngFor=\"let item of getItems(); index as index\">\r\n <ng-container [ngTemplateOutlet]=\"itemTemplate\"\r\n [ngTemplateOutletContext]=\"{ item: item, id: getId(item, index), index: index, sub: getItemSub(item), isRoot: true }\">\r\n </ng-container>\r\n </ng-container>\r\n </ul>\r\n</nav>\r\n",
5380
+ template: "<!--\r\n Template para ser utilizado tanto por los items como por los subitems:\r\n - item: Item que representa\r\n - index: indice del item en la lista\r\n - id: identificador del item\r\n - isRoot: si pertenece al nivel raiz\r\n-->\r\n<ng-template #itemTemplate let-item=\"item\" let-index=\"index\" let-id=\"id\" let-sub=\"sub\" let-isRoot=\"isRoot\">\r\n <ng-container *ngIf=\"item\">\r\n <li class=\"m-base\" [ngClass]=\"{'origin-top-left text-sm': !isRoot}\">\r\n <ng-container *ngIf=\"item.href || item.routerLink; else notHref\">\r\n <a *ngIf=\"item.href; else hasRouterLink\" [attr.id]=\"id\"\r\n (desyContentEmpty)=\"handleItemContentEmpty(index, isRoot)\"\r\n [href]=\"item.href | externalHref\"\r\n [class]=\"['block px-xs focus:bg-warning-base focus:outline-none focus:shadow-outline-focus focus:text-black', item.classes] | makeHtmlList\"\r\n [ngClass]=\"{\r\n 'underline': hasUnderline,\r\n 'hover:text-primary-base hover:underline': !item.disabled,\r\n 'no-underline pointer-events-none': item.disabled,\r\n 'font-bold': item.active\r\n }\"\r\n [attr.title]=\"item.title\"\r\n [attr.tabindex]=\"item.disabled ? -1 : null\"\r\n [attr.target]=\"item.target ? item.target : null\"\r\n [attr.aria-current]=\"item.active ? 'page' : null\"\r\n [attr.aria-disabled]=\"item.disabled\"\r\n [attr.aria-describedby]=\"item.ariaDescribedBy\"\r\n [attr.aria-errormessage]=\"item.ariaErrorMessage\"\r\n [attr.aria-label]=\"item.ariaLabel\"\r\n [attr.aria-labelledby]=\"item.ariaLabelledBy\"\r\n [attr.aria-hidden]=\"item.ariaHidden\"\r\n [attr.aria-controls]=\"item.ariaControls\"\r\n [attr.aria-live]=\"item.ariaLive\"\r\n [attr.aria-expanded]=\"item.ariaExpanded\"\r\n [attr.aria-haspopup]=\"item.ariaHasPopup\"\r\n [attr.disabled]=\"item.disabled\">\r\n <ng-container *desyCustomInnerContent=\"{ component: item, html: getItemHtml(item), text: item.text }\"></ng-container>\r\n </a>\r\n <ng-template #hasRouterLink>\r\n <!-- Todos los enlaces que admiten o href o routerLink estar\u00EDa bien unificarlos (en todos los componentes).\r\n Para ello, ser\u00EDa necesario crear una directiva para a\u00F1adir o quitar la directiva routerLink si no tiene href.\r\n Sin embargo, esto no es posible actualmente, ya que Angular todav\u00EDa no permite a\u00F1adir directivas din\u00E1micamente:\r\n https://angular.io/guide/roadmap#support-adding-directives-to-host-elements -->\r\n <a [attr.id]=\"id\"\r\n (desyContentEmpty)=\"handleItemContentEmpty(index, isRoot)\"\r\n [routerLink]=\"item.routerLink\" [fragment]=\"item.fragment ? item.fragment : null\"\r\n [routerLinkActive]=\"item.routerLinkActiveClasses ? item.routerLinkActiveClasses : []\"\r\n [class]=\"['block px-xs focus:bg-warning-base focus:outline-none focus:shadow-outline-focus focus:text-black', item.classes] | makeHtmlList\"\r\n [ngClass]=\"{\r\n 'underline': hasUnderline,\r\n 'hover:text-primary-base hover:underline': !item.disabled,\r\n 'no-underline pointer-events-none': item.disabled,\r\n 'font-bold': item.active\r\n }\"\r\n [attr.title]=\"item.title\"\r\n [attr.tabindex]=\"item.disabled ? -1 : null\"\r\n [attr.target]=\"item.target ? item.target : null\"\r\n [attr.aria-current]=\"item.active ? 'page' : null\"\r\n [attr.aria-disabled]=\"item.disabled\"\r\n [attr.aria-describedby]=\"item.ariaDescribedBy\"\r\n [attr.aria-errormessage]=\"item.ariaErrorMessage\"\r\n [attr.aria-label]=\"item.ariaLabel\"\r\n [attr.aria-labelledby]=\"item.ariaLabelledBy\"\r\n [attr.aria-hidden]=\"item.ariaHidden\"\r\n [attr.aria-controls]=\"item.ariaControls\"\r\n [attr.aria-live]=\"item.ariaLive\"\r\n [attr.aria-expanded]=\"item.ariaExpanded\"\r\n [attr.aria-haspopup]=\"item.ariaHasPopup\"\r\n [attr.disabled]=\"item.disabled\"\r\n \r\n (click)=\"focus(id, item.fragment ? item.fragment : null)\">\r\n <ng-container *desyCustomInnerContent=\"{ component: item, html: getItemHtml(item), text: item.text }\"></ng-container>\r\n </a>\r\n </ng-template>\r\n </ng-container>\r\n <ng-template #notHref>\r\n <span [attr.id]=\"id\"\r\n (desyContentEmpty)=\"handleItemContentEmpty(index, isRoot)\"\r\n [class]=\"['block px-xs', item.classes] | makeHtmlList\"\r\n [ngClass]=\"{'font-bold': item.active}\"\r\n\r\n [attr.title]=\"item.title\"\r\n [attr.tabindex]=\"item.disabled ? -1 : null\"\r\n [attr.aria-current]=\"item.active ? 'page' : null\"\r\n [attr.aria-disabled]=\"item.disabled\"\r\n [attr.aria-describedby]=\"item.ariaDescribedBy\"\r\n [attr.aria-errormessage]=\"item.ariaErrorMessage\"\r\n [attr.aria-label]=\"item.ariaLabel\"\r\n [attr.aria-labelledby]=\"item.ariaLabelledBy\"\r\n [attr.aria-hidden]=\"item.ariaHidden\"\r\n [attr.aria-controls]=\"item.ariaControls\"\r\n [attr.aria-live]=\"item.ariaLive\"\r\n [attr.aria-expanded]=\"item.ariaExpanded\"\r\n [attr.aria-haspopup]=\"item.ariaHasPopup\"\r\n [attr.disabled]=\"item.disabled\">\r\n <ng-container *desyCustomInnerContent=\"{ component: item, html: getItemHtml(item), text: item.text }\"></ng-container>\r\n </span>\r\n </ng-template>\r\n <ng-container *ngIf=\"isRoot && sub\">\r\n <ul *ngIf=\"getSubItems(sub)\" [ngClass]=\"sub.classes\"\r\n [attr.aria-describedby]=\"sub.ariaDescribedBy\"\r\n [attr.aria-errormessage]=\"sub.ariaErrorMessage\"\r\n [attr.aria-label]=\"sub.ariaLabel\"\r\n [attr.aria-labelledby]=\"sub.ariaLabelledBy\"\r\n [attr.aria-hidden]=\"sub.ariaHidden\"\r\n [attr.aria-disabled]=\"sub.ariaDisabled\"\r\n [attr.aria-controls]=\"sub.ariaControls\"\r\n [attr.aria-current]=\"sub.ariaCurrent\"\r\n [attr.aria-live]=\"sub.ariaLive\"\r\n [attr.aria-expanded]=\"sub.ariaExpanded\"\r\n [attr.aria-haspopup]=\"sub.ariaHasPopup\"\r\n [attr.tabindex]=\"sub.tabindex\">\r\n <ng-container *ngFor=\"let subItem of getSubItems(sub); index as subIndex\">\r\n <ng-container [ngTemplateOutlet]=\"itemTemplate\"\r\n [ngTemplateOutletContext]=\"{\r\n item: subItem,\r\n id: getSubItemId(item, index, subIndex),\r\n index: subIndex,\r\n isRoot: false\r\n }\">\r\n </ng-container>\r\n </ng-container>\r\n </ul>\r\n <div *ngIf=\"!getSubItems(sub)\"\r\n [class]=\"['mb-base px-xs origin-top-left text-sm text-neutral-dark', sub.classes] | makeHtmlList\"\r\n [id]=\"'sub-' + id\">\r\n <ng-container *desyCustomInnerContent=\"{ component: sub, html: sub.html }\"></ng-container>\r\n </div>\r\n </ng-container>\r\n </li>\r\n <li *ngIf=\"item.divider\" class=\"my-sm border-b border-neutral-base\" aria-hidden=\"true\">\r\n <div class=\"sr-only\">Separador</div>\r\n </li>\r\n </ng-container>\r\n</ng-template>\r\n\r\n<nav [ngClass]=\"classes\"\r\n [attr.role]=\"(role ? role : null)\"\r\n [attr.aria-describedby]=\"ariaDescribedBy\"\r\n [attr.aria-errormessage]=\"ariaErrorMessage\"\r\n [attr.aria-label]=\"ariaLabel\"\r\n [attr.aria-labelledby]=\"ariaLabelledBy\"\r\n [attr.aria-hidden]=\"ariaHidden\"\r\n [attr.aria-disabled]=\"ariaDisabled\"\r\n [attr.aria-controls]=\"ariaControls\"\r\n [attr.aria-current]=\"ariaCurrent\"\r\n [attr.aria-live]=\"ariaLive\"\r\n [attr.aria-expanded]=\"ariaExpanded\"\r\n [attr.aria-haspopup]=\"ariaHasPopup\"\r\n [attr.tabindex]=\"tabindex\">\r\n <ul class=\"text-base\">\r\n <ng-container *ngFor=\"let item of getItems(); index as index\">\r\n <ng-container [ngTemplateOutlet]=\"itemTemplate\"\r\n [ngTemplateOutletContext]=\"{ item: item, id: getId(item, index), index: index, sub: getItemSub(item), isRoot: true }\">\r\n </ng-container>\r\n </ng-container>\r\n </ul>\r\n</nav>\r\n",
4351
5381
  animations: [
4352
5382
  trigger('displayMenuVertical', [
4353
5383
  state('void', style({
@@ -5374,63 +6404,6 @@ __decorate([
5374
6404
  DesyContentChild()
5375
6405
  ], TableComponent.prototype, "headerComponent", void 0);
5376
6406
 
5377
- class SearchUtils {
5378
- /**
5379
- * Comprueba si una cadena de texto (target) contiene cualquier palabra de otro texto (text)
5380
- * @param target - Texto en el que buscar
5381
- * @param text - Texto a buscar
5382
- * @param fullWord - Indica si las palabras del texto a buscar deben aparecer enteras
5383
- */
5384
- static containsAnyWordFrom(target, text, fullWord) {
5385
- let words = [];
5386
- let includes = false;
5387
- const simplifiedTarget = this.getSimplifiedString(target);
5388
- if (text && text.split(' ').length > 1) {
5389
- words = text.split(' ');
5390
- }
5391
- words.push(text);
5392
- words.forEach(word => {
5393
- if (simplifiedTarget && word) {
5394
- if ((fullWord && simplifiedTarget === this.getSimplifiedString(word))
5395
- || (!fullWord && simplifiedTarget.includes(this.getSimplifiedString(word)))) {
5396
- includes = true;
5397
- }
5398
- }
5399
- });
5400
- return includes;
5401
- }
5402
- /**
5403
- * Convierte a mayúsculas, elimina espacios y reemplaza/elimina caracteres especiales para realizar comparaciones más tolerantes
5404
- * @param str - cadena de entrada
5405
- */
5406
- static getSimplifiedString(str) {
5407
- let res = str;
5408
- if (str) {
5409
- res = str.toLocaleUpperCase().trim();
5410
- res = res.replace('Á', 'A');
5411
- res = res.replace('É', 'E');
5412
- res = res.replace('Í', 'I');
5413
- res = res.replace('Ó', 'O');
5414
- res = res.replace('Ú', 'U');
5415
- res = res.replace('À', 'A');
5416
- res = res.replace('È', 'E');
5417
- res = res.replace('Ì', 'I');
5418
- res = res.replace('Ò', 'O');
5419
- res = res.replace('Ù', 'U');
5420
- res = res.replace('Ä', 'A');
5421
- res = res.replace('Ë', 'E');
5422
- res = res.replace('Ï', 'I');
5423
- res = res.replace('Ö', 'O');
5424
- res = res.replace('Ü', 'U');
5425
- res = res.replace(',', '');
5426
- res = res.replace('.', '');
5427
- res = res.replace('\'', '');
5428
- res = res.replace('"', '');
5429
- }
5430
- return res;
5431
- }
5432
- }
5433
-
5434
6407
  var OrderBy;
5435
6408
  (function (OrderBy) {
5436
6409
  OrderBy["none"] = "none";
@@ -7278,6 +8251,11 @@ DesyFormsModule.decorators = [
7278
8251
  DateInputDayComponent,
7279
8252
  DateInputMonthComponent,
7280
8253
  DateInputYearComponent,
8254
+ TreeComponent,
8255
+ TreeSubComponent,
8256
+ TreeItemComponent,
8257
+ TreeCheckboxComponent,
8258
+ TreeItemsGeneratorComponent,
7281
8259
  ConditionDirective,
7282
8260
  ],
7283
8261
  imports: [
@@ -7314,6 +8292,10 @@ DesyFormsModule.decorators = [
7314
8292
  DateInputDayComponent,
7315
8293
  DateInputMonthComponent,
7316
8294
  DateInputYearComponent,
8295
+ TreeComponent,
8296
+ TreeSubComponent,
8297
+ TreeItemComponent,
8298
+ TreeItemsGeneratorComponent,
7317
8299
  ConditionDirective
7318
8300
  ]
7319
8301
  },] }
@@ -7508,6 +8490,67 @@ DesyViewsModule.decorators = [
7508
8490
  },] }
7509
8491
  ];
7510
8492
 
8493
+ class ToggleOffStateComponent extends AccessibilityComponent {
8494
+ }
8495
+ ToggleOffStateComponent.decorators = [
8496
+ { type: Component, args: [{
8497
+ selector: 'desy-toggle-off-state',
8498
+ template: "<ng-template #contentTemplateOffState>\r\n <ng-content></ng-content>\r\n</ng-template>"
8499
+ },] }
8500
+ ];
8501
+ ToggleOffStateComponent.propDecorators = {
8502
+ content: [{ type: ViewChild, args: ['contentTemplateOffState', { static: true },] }],
8503
+ classes: [{ type: Input }]
8504
+ };
8505
+
8506
+ class ToggleOnStateComponent extends AccessibilityComponent {
8507
+ }
8508
+ ToggleOnStateComponent.decorators = [
8509
+ { type: Component, args: [{
8510
+ selector: 'desy-toggle-on-state',
8511
+ template: "<ng-template #contentTemplateOnState>\r\n <ng-content></ng-content>\r\n</ng-template>"
8512
+ },] }
8513
+ ];
8514
+ ToggleOnStateComponent.propDecorators = {
8515
+ content: [{ type: ViewChild, args: ['contentTemplateOnState', { static: true },] }],
8516
+ classes: [{ type: Input }]
8517
+ };
8518
+
8519
+ class ToggleComponent extends AccessibilityComponent {
8520
+ constructor() {
8521
+ super(...arguments);
8522
+ this.clickEvent = new EventEmitter();
8523
+ this.pressedChange = new EventEmitter();
8524
+ }
8525
+ onClick(event) {
8526
+ this.pressed = !this.pressed;
8527
+ this.pressedChange.emit(this.pressed);
8528
+ this.clickEvent.emit(event);
8529
+ }
8530
+ }
8531
+ ToggleComponent.decorators = [
8532
+ { type: Component, args: [{
8533
+ selector: 'desy-toggle',
8534
+ template: "<!-- toggle -->\r\n<div class=\"relative\">\r\n <button *ngIf=\"isSwitch\"\r\n (click)=\"onClick($event)\"\r\n [type]=\"'button'\"\r\n [class]=\"pressed ? (classes + ' ' + contentTemplateOnState?.classes) : (classes + ' ' + contentTemplateOffState?.classes)\"\r\n [attr.aria-checked]=\"pressed ? 'true' : 'false'\"\r\n \r\n [attr.id]=\"id ? id : null\" \r\n [attr.role]=\"'switch'\"\r\n [attr.aria-label]=\"ariaLabel ? ariaLabel : null\"\r\n [attr.aria-describedby]=\"ariaDescribedBy ? ariaDescribedBy : null\"\r\n [attr.aria-labelledby]=\"ariaLabelledBy ? ariaLabelledBy : null\"\r\n [attr.aria-hidden]=\"ariaHidden ? ariaHidden : null\"\r\n [attr.aria-disabled]=\"ariaDisabled ? ariaDisabled : null\"\r\n [attr.aria-controls]=\"ariaControls ? ariaControls : null\" \r\n [attr.aria-current]=\"ariaCurrent ? ariaCurrent : null\" \r\n [attr.aria-live]=\"ariaLive ? ariaLive : null\" \r\n [attr.aria-expanded]=\"ariaExpanded ? ariaExpanded : null\" \r\n [attr.aria-errormessage]=\"ariaErrorMessage ? ariaErrorMessage : null\" \r\n [attr.aria-haspopup]=\"ariaHasPopup ? ariaHasPopup : null\" \r\n [attr.tabindex]=\"tabindex ? tabindex : null\">\r\n \r\n <span [class]=\"pressed ? 'hidden' : ''\"><ng-container *ngTemplateOutlet=\"contentTemplateOffState?.content\"></ng-container></span>\r\n <span [class]=\"pressed ? '' : 'hidden'\"><ng-container *ngTemplateOutlet=\"contentTemplateOnState?.content\"></ng-container></span>\r\n </button>\r\n\r\n <button *ngIf=\"!isSwitch\"\r\n (click)=\"onClick($event)\"\r\n [type]=\"'button'\"\r\n [class]=\"pressed ? (classes + ' ' + contentTemplateOnState?.classes) : (classes + ' ' + contentTemplateOffState?.classes)\"\r\n [attr.aria-pressed]=\"pressed ? 'true' : 'false'\"\r\n [attr.id]=\"id ? id : null\" \r\n [attr.role]=\"role ? role : null\"\r\n [attr.aria-label]=\"ariaLabel ? ariaLabel : null\"\r\n [attr.aria-describedby]=\"ariaDescribedBy ? ariaDescribedBy : null\"\r\n [attr.aria-labelledby]=\"ariaLabelledBy ? ariaLabelledBy : null\"\r\n [attr.aria-hidden]=\"ariaHidden ? ariaHidden : null\"\r\n [attr.aria-disabled]=\"ariaDisabled ? ariaDisabled : null\"\r\n [attr.aria-controls]=\"ariaControls ? ariaControls : null\" \r\n [attr.aria-current]=\"ariaCurrent ? ariaCurrent : null\" \r\n [attr.aria-live]=\"ariaLive ? ariaLive : null\" \r\n [attr.aria-expanded]=\"ariaExpanded ? ariaExpanded : null\" \r\n [attr.aria-errormessage]=\"ariaErrorMessage ? ariaErrorMessage : null\" \r\n [attr.aria-haspopup]=\"ariaHasPopup ? ariaHasPopup : null\" \r\n [attr.tabindex]=\"tabindex ? tabindex : null\">\r\n \r\n <span [class]=\"pressed ? 'hidden' : ''\"><ng-container *ngTemplateOutlet=\"contentTemplateOffState?.content\"></ng-container></span>\r\n <span [class]=\"pressed ? '' : 'hidden'\"><ng-container *ngTemplateOutlet=\"contentTemplateOnState?.content\"></ng-container></span>\r\n </button>\r\n</div>\r\n<!-- /toggle -->"
8535
+ },] }
8536
+ ];
8537
+ ToggleComponent.propDecorators = {
8538
+ id: [{ type: Input }],
8539
+ isSwitch: [{ type: Input }],
8540
+ pressed: [{ type: Input }],
8541
+ classes: [{ type: Input }],
8542
+ clickEvent: [{ type: Output }],
8543
+ pressedChange: [{ type: Output }],
8544
+ contentTemplateOnState: [{ type: ContentChildren, args: [ToggleOnStateComponent,] }],
8545
+ contentTemplateOffState: [{ type: ContentChildren, args: [ToggleOffStateComponent,] }]
8546
+ };
8547
+ __decorate([
8548
+ DesyContentChild()
8549
+ ], ToggleComponent.prototype, "contentTemplateOnState", void 0);
8550
+ __decorate([
8551
+ DesyContentChild()
8552
+ ], ToggleComponent.prototype, "contentTemplateOffState", void 0);
8553
+
7511
8554
  class DesyButtonsModule {
7512
8555
  }
7513
8556
  DesyButtonsModule.decorators = [
@@ -7519,7 +8562,10 @@ DesyButtonsModule.decorators = [
7519
8562
  ListboxComponent,
7520
8563
  PillComponent,
7521
8564
  ListboxItemComponent,
7522
- ListboxLabelComponent
8565
+ ListboxLabelComponent,
8566
+ ToggleComponent,
8567
+ ToggleOnStateComponent,
8568
+ ToggleOffStateComponent
7523
8569
  ],
7524
8570
  imports: [
7525
8571
  CommonModule,
@@ -7534,7 +8580,10 @@ DesyButtonsModule.decorators = [
7534
8580
  ListboxComponent,
7535
8581
  PillComponent,
7536
8582
  ListboxItemComponent,
7537
- ListboxLabelComponent
8583
+ ListboxLabelComponent,
8584
+ ToggleComponent,
8585
+ ToggleOnStateComponent,
8586
+ ToggleOffStateComponent
7538
8587
  ]
7539
8588
  },] }
7540
8589
  ];
@@ -7823,5 +8872,5 @@ DesyAngularModule.decorators = [
7823
8872
  * Generated bundle index. Do not edit.
7824
8873
  */
7825
8874
 
7826
- export { AccordionComponent, AccordionHeaderComponent, AccordionItemComponent, AlertComponent, AlertService, BreadcrumbsComponent, BreadcrumbsItemComponent, ButtonComponent, ButtonLoaderComponent, CharacterCountComponent, CheckboxItemComponent, CheckboxesComponent, CollapsibleComponent, ConditionDirective, ContentComponent, DateInputComponent, DefinitionComponent, DescriptionComponent, DescriptionItemComponent, DescriptionListComponent, DesyAngularModule, DesyButtonsModule, DesyCommonsModule, DesyFormsModule, DesyModalsModule, DesyNavModule, DesyPaginationModule, DesyTablesModule, DesyViewsModule, DetailsComponent, DialogComponent, DialogService, DropdownComponent, ErrorMessageComponent, ErrorSummaryComponent, ErrorSummaryItemComponent, FieldsetComponent, FileUploadComponent, FooterComponent, FooterMetaComponent, FooterMetaItemComponent, FooterNavigationComponent, FooterNavigationItemComponent, HeaderComponent, HeaderDropdownComponent, HeaderNavigationComponent, HeaderOffcanvasButtonComponent, HeaderOffcanvasCloseButtonComponent, HeaderOffcanvasComponent, HeaderSubnavComponent, HintComponent, IconComponent, InputComponent, InputGroupComponent, InputGroupDividerComponent, InputGroupInputComponent, InputGroupSelectComponent, ItemComponent, ItemContentBottomComponent, ItemContentRightComponent, ItemItemComponent, LabelComponent, LegendComponent, ListboxComponent, ListboxItemComponent, ListboxLabelComponent, MediaObjectComponent, MenuHorizontalComponent, MenuHorizontalItemComponent, MenuVerticalComponent, MenuVerticalItemComponent, MenuVerticalItemSubComponent, MenuVerticalItemSubItemComponent, MenubarComponent, MenubarItemComponent, MenubarLabelComponent, MenubarSubitemComponent, MenubarSubsubitemComponent, ModalButtonPrimaryComponent, ModalButtonSecondaryComponent, ModalComponent, NavComponent, NavItemComponent, NotificationComponent, NotificationItemComponent, OptionComponent, OptionGroupComponent, OrderBy, PaginationComponent, PillComponent, RadioItemComponent, RadiosComponent, SearchBarComponent, SelectComponent, SkipLinkComponent, SpinnerComponent, StatusComponent, StatusItemComponent, TableAdvancedComponent, TableAdvancedHeaderCellComponent, TableAdvancedHeaderComponent, TableAdvancedRowCellComponent, TableAdvancedRowComponent, TableCaptionComponent, TableCellComponent, TableComponent, TableHeaderComponent, TableRowComponent, TabsComponent, TermComponent, TextareaComponent, TitleComponent, TooltipContentComponent, summaryTextOrSummaryHtmlRequiredFunction, AccessibilityComponent as ɵa, AccessibilityAndContentRequiredComponent as ɵb, CustomInnerContentDirective as ɵba, TooltipComponent as ɵbb, TemplateDrivenWrapperComponent as ɵbc, DateInputDividerComponent as ɵbd, DateInputDayComponent as ɵbe, DateInputMonthComponent as ɵbf, DateInputYearComponent as ɵbg, FocusClickedCellDirective as ɵbh, AccessibilityAndTextOrHtmlRequiredComponent as ɵc, DesyContentChild as ɵd, ContentBaseComponent as ɵe, FormFieldComponent as ɵf, SelectItemComponent as ɵg, DesyOnInputChange as ɵh, InputGroupItemComponent as ɵi, DateInputItemComponent as ɵj, HeaderNavigationItemComponent as ɵk, MenubaritemDirective as ɵl, RowDirective as ɵm, CellDirective as ɵn, TabItemComponent as ɵo, PanelComponent as ɵp, SharedModule as ɵq, TextOrHtmlRequiredComponent as ɵr, InnerHtmlPipe as ɵs, MakeHtmlListPipe as ɵt, ExternalHrefPipe as ɵu, AttributeChangeDirective as ɵv, InnerContentDirective as ɵw, ClickOutsideDirective as ɵx, ContentChangeDirective as ɵy, ContentEmptyDirective as ɵz };
8875
+ export { AccordionComponent, AccordionHeaderComponent, AccordionItemComponent, AlertComponent, AlertService, BreadcrumbsComponent, BreadcrumbsItemComponent, ButtonComponent, ButtonLoaderComponent, CharacterCountComponent, CheckboxItemComponent, CheckboxesComponent, CollapsibleComponent, ConditionDirective, ContentComponent, DateInputComponent, DefinitionComponent, DescriptionComponent, DescriptionItemComponent, DescriptionListComponent, DesyAngularModule, DesyButtonsModule, DesyCommonsModule, DesyFormsModule, DesyModalsModule, DesyNavModule, DesyPaginationModule, DesyTablesModule, DesyViewsModule, DetailsComponent, DialogComponent, DialogService, DropdownComponent, ErrorMessageComponent, ErrorSummaryComponent, ErrorSummaryItemComponent, FieldsetComponent, FileUploadComponent, FooterComponent, FooterMetaComponent, FooterMetaItemComponent, FooterNavigationComponent, FooterNavigationItemComponent, HeaderComponent, HeaderDropdownComponent, HeaderNavigationComponent, HeaderOffcanvasButtonComponent, HeaderOffcanvasCloseButtonComponent, HeaderOffcanvasComponent, HeaderSubnavComponent, HintComponent, IconComponent, InputComponent, InputGroupComponent, InputGroupDividerComponent, InputGroupInputComponent, InputGroupSelectComponent, ItemComponent, ItemContentBottomComponent, ItemContentRightComponent, ItemItemComponent, LabelComponent, LegendComponent, ListboxComponent, ListboxItemComponent, ListboxLabelComponent, MediaObjectComponent, MenuHorizontalComponent, MenuHorizontalItemComponent, MenuVerticalComponent, MenuVerticalItemComponent, MenuVerticalItemSubComponent, MenuVerticalItemSubItemComponent, MenubarComponent, MenubarItemComponent, MenubarLabelComponent, MenubarSubitemComponent, MenubarSubsubitemComponent, ModalButtonPrimaryComponent, ModalButtonSecondaryComponent, ModalComponent, NavComponent, NavItemComponent, NotificationComponent, NotificationItemComponent, OptionComponent, OptionGroupComponent, OrderBy, PaginationComponent, PillComponent, RadioItemComponent, RadiosComponent, SearchBarComponent, SelectComponent, SkipLinkComponent, SpinnerComponent, StatusComponent, StatusItemComponent, TableAdvancedComponent, TableAdvancedHeaderCellComponent, TableAdvancedHeaderComponent, TableAdvancedRowCellComponent, TableAdvancedRowComponent, TableCaptionComponent, TableCellComponent, TableComponent, TableHeaderComponent, TableRowComponent, TabsComponent, TermComponent, TextareaComponent, TitleComponent, TooltipContentComponent, TreeComponent, TreeItemComponent, TreeItemsGeneratorComponent, TreeSubComponent, summaryTextOrSummaryHtmlRequiredFunction, AccessibilityComponent as ɵa, AccessibilityAndContentRequiredComponent as ɵb, AttributeChangeDirective as ɵba, InnerContentDirective as ɵbb, ClickOutsideDirective as ɵbc, ContentChangeDirective as ɵbd, ContentEmptyDirective as ɵbe, CustomInnerContentDirective as ɵbf, TooltipComponent as ɵbg, TemplateDrivenWrapperComponent as ɵbh, DateInputDividerComponent as ɵbi, DateInputDayComponent as ɵbj, DateInputMonthComponent as ɵbk, DateInputYearComponent as ɵbl, FocusClickedCellDirective as ɵbm, AccessibilityAndTextOrHtmlRequiredComponent as ɵc, DesyContentChild as ɵd, ContentBaseComponent as ɵe, FormFieldComponent as ɵf, SelectItemComponent as ɵg, DesyOnInputChange as ɵh, InputGroupItemComponent as ɵi, DateInputItemComponent as ɵj, ITreeItem as ɵk, TreeCheckboxComponent as ɵl, HeaderNavigationItemComponent as ɵm, MenubaritemDirective as ɵn, RowDirective as ɵo, CellDirective as ɵp, TabItemComponent as ɵq, PanelComponent as ɵr, ToggleComponent as ɵs, ToggleOnStateComponent as ɵt, ToggleOffStateComponent as ɵu, SharedModule as ɵv, TextOrHtmlRequiredComponent as ɵw, InnerHtmlPipe as ɵx, MakeHtmlListPipe as ɵy, ExternalHrefPipe as ɵz };
7827
8876
  //# sourceMappingURL=desy-angular.js.map