desy-angular 5.0.1 → 5.1.3

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 +1218 -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 +370 -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 +408 -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 +2 -2
  24. package/esm2015/lib/desy-nav/components/nav/nav.component.js +38 -2
  25. package/esm2015/lib/desy-pagination/components/pagination/pagination.component.js +2 -2
  26. package/esm2015/public-api.js +5 -1
  27. package/fesm2015/desy-angular.js +1133 -71
  28. package/fesm2015/desy-angular.js.map +1 -1
  29. package/lib/desy-buttons/components/toggle/toggle-off-state/toggle-off-state.component.d.ts +5 -0
  30. package/lib/desy-buttons/components/toggle/toggle-on-state/toggle-on-state.component.d.ts +5 -0
  31. package/lib/desy-buttons/components/toggle/toggle.component.d.ts +15 -0
  32. package/lib/desy-forms/components/tree/interfaces/itree-item.d.ts +5 -0
  33. package/lib/desy-forms/components/tree/interfaces/quit-tree-item-focus-options.d.ts +5 -0
  34. package/lib/desy-forms/components/tree/tree-checkbox/tree-checkbox.component.d.ts +43 -0
  35. package/lib/desy-forms/components/tree/tree-item/tree-item.component.d.ts +87 -0
  36. package/lib/desy-forms/components/tree/tree-items-generator/tree-items-generator.component.d.ts +10 -0
  37. package/lib/desy-forms/components/tree/tree-sub/tree-sub.component.d.ts +6 -0
  38. package/lib/desy-forms/components/tree/tree.component.d.ts +112 -0
  39. package/lib/desy-nav/components/header/header-dropdown/header-dropdown.component.d.ts +2 -0
  40. package/lib/desy-nav/components/nav/nav.component.d.ts +4 -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,982 @@ 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
+ this._matchesValidText = false; // True si el contenido del item encaja con los criterios de búsqueda y se está filtrando
3296
+ }
3297
+ ngOnChanges(changes) {
3298
+ if (this.sub && this.sub.itemList) {
3299
+ this.sub.itemList.forEach(item => item.refreshAllParentsExpandedRecursive(this.allParentsExpanded && this.expanded));
3300
+ }
3301
+ for (const propName in changes) {
3302
+ if (changes.hasOwnProperty(propName)) {
3303
+ switch (propName) {
3304
+ case 'checked': {
3305
+ // Reasignamos el valor de checked cuando detectamos el cambio en la entrada
3306
+ setTimeout(() => {
3307
+ this.setChecked(this.checked, false, false);
3308
+ if (this.inheritedExpandedFirstLevel && this.checked && !this.expanded) {
3309
+ this.expandSub(true);
3310
+ }
3311
+ });
3312
+ break;
3313
+ }
3314
+ }
3315
+ }
3316
+ }
3317
+ }
3318
+ /*
3319
+ * Métodos expuestos que permiten configurar al ítem de forma externa
3320
+ */
3321
+ focus() {
3322
+ var _a;
3323
+ (_a = this.checkbox) === null || _a === void 0 ? void 0 : _a.focus();
3324
+ this.handleItemFocus(true);
3325
+ }
3326
+ setCheckedAutomaticallyDependingOnChildren() {
3327
+ if (this.sub) {
3328
+ this.sub.itemList.forEach(item => item.setCheckedAutomaticallyDependingOnChildren());
3329
+ if (this.areAllChildrenChecked()) {
3330
+ if (this.indeterminateChecked) {
3331
+ this.setIndeterminateChecked(false);
3332
+ }
3333
+ if (!this.checked) {
3334
+ this.setChecked(true, true);
3335
+ }
3336
+ }
3337
+ else if (this.hasChildrenCheckedOrIndeterminate()) {
3338
+ if (!this.indeterminateChecked) {
3339
+ this.setIndeterminateChecked(true);
3340
+ }
3341
+ if (this.checked) {
3342
+ this.setChecked(false, true);
3343
+ }
3344
+ }
3345
+ else {
3346
+ if (this.indeterminateChecked) {
3347
+ this.setIndeterminateChecked(false);
3348
+ }
3349
+ if (this.checked) {
3350
+ this.setChecked(false, true);
3351
+ }
3352
+ }
3353
+ }
3354
+ }
3355
+ refreshAllParentsExpandedRecursive(value) {
3356
+ this.allParentsExpanded = value;
3357
+ if (this.sub) {
3358
+ this.sub.itemList.forEach(item => item.refreshAllParentsExpandedRecursive(value && this.expanded));
3359
+ }
3360
+ }
3361
+ detectChanges() {
3362
+ this.changeDetector.detectChanges();
3363
+ }
3364
+ expandSub(value) {
3365
+ this.expanded = value;
3366
+ if (this.sub) {
3367
+ this.sub.itemList.forEach(item => item.refreshAllParentsExpandedRecursive(this.allParentsExpanded && value));
3368
+ }
3369
+ this.expandedChange.emit(value);
3370
+ }
3371
+ /*
3372
+ * Gestion de eventos
3373
+ */
3374
+ handleCheckboxChange(checked) {
3375
+ this.setChecked(checked, false);
3376
+ if (this.inheritedExpandedFirstLevel && checked && !this.expanded) {
3377
+ this.expandSub(true);
3378
+ }
3379
+ }
3380
+ handleIndeterminateCheckedChange(indeterminate) {
3381
+ this.indeterminateCheckedChange.emit(indeterminate);
3382
+ }
3383
+ handleItemFocus(value, condition = true) {
3384
+ if (condition) {
3385
+ this.isFocus = value;
3386
+ }
3387
+ }
3388
+ handleItemHover(value, condition = true) {
3389
+ if (condition) {
3390
+ this.isHover = value;
3391
+ }
3392
+ }
3393
+ handleArrowUp(event, condition = true) {
3394
+ if (condition) {
3395
+ event.preventDefault();
3396
+ this.quitFocus.emit({
3397
+ nextElement: 'previous',
3398
+ currentItem: this
3399
+ });
3400
+ }
3401
+ }
3402
+ handleHome(event, condition = true) {
3403
+ if (condition) {
3404
+ event.preventDefault();
3405
+ this.quitFocus.emit({
3406
+ nextElement: 'first',
3407
+ currentItem: this
3408
+ });
3409
+ }
3410
+ }
3411
+ handleEnd(event, condition = true) {
3412
+ if (condition) {
3413
+ event.preventDefault();
3414
+ this.quitFocus.emit({
3415
+ nextElement: 'last',
3416
+ currentItem: this
3417
+ });
3418
+ }
3419
+ }
3420
+ handleArrowDown(event, condition = true) {
3421
+ if (condition) {
3422
+ event.preventDefault();
3423
+ this.quitFocus.emit({
3424
+ nextElement: 'next',
3425
+ currentItem: this
3426
+ });
3427
+ }
3428
+ }
3429
+ handleArrowRight(event, condition = true) {
3430
+ var _a;
3431
+ if (condition && this.sub && ((_a = this.sub.itemList) === null || _a === void 0 ? void 0 : _a.length) > 0) {
3432
+ event.preventDefault();
3433
+ if (this.expanded) {
3434
+ this.quitFocus.emit({
3435
+ nextElement: 'firstChild',
3436
+ currentItem: this
3437
+ });
3438
+ }
3439
+ else {
3440
+ this.expandSub(true);
3441
+ }
3442
+ }
3443
+ }
3444
+ handleArrowLeft(event, condition = true) {
3445
+ if (condition) {
3446
+ event.preventDefault();
3447
+ if (this.expanded) {
3448
+ this.expandSub(false);
3449
+ }
3450
+ else if (this.subLevel > 0) {
3451
+ this.quitFocus.emit({
3452
+ nextElement: 'parent',
3453
+ currentItem: this
3454
+ });
3455
+ }
3456
+ }
3457
+ }
3458
+ /*
3459
+ * Setters and getters
3460
+ */
3461
+ setChecked(checked, ignoreInTree, emitEvent = true) {
3462
+ if (!this.disabled) {
3463
+ this.checked = checked;
3464
+ }
3465
+ if (!this.inheritedDecoupleChildFromParent && this.sub && this.sub.itemList && !this.indeterminateChecked) {
3466
+ this.sub.itemList.forEach(item => {
3467
+ item.setIndeterminateChecked(false);
3468
+ item.setChecked(checked, true);
3469
+ });
3470
+ }
3471
+ if (emitEvent) {
3472
+ this.checkedChange.emit(checked);
3473
+ }
3474
+ if (!ignoreInTree) {
3475
+ this.checkedChangeForTree.emit(checked);
3476
+ }
3477
+ }
3478
+ setIndeterminateChecked(indeterminate) {
3479
+ if (!this.disabled) {
3480
+ this.indeterminateChecked = indeterminate;
3481
+ this.indeterminateCheckedChange.emit(indeterminate);
3482
+ }
3483
+ }
3484
+ setSubLevel(subLevel) {
3485
+ this.subLevel = subLevel;
3486
+ if (this.sub && this.sub.itemList) {
3487
+ this.sub.itemList.forEach(item => item.setSubLevel(subLevel + 1));
3488
+ }
3489
+ }
3490
+ setOrderRecursively(order) {
3491
+ this.orderInTree = order;
3492
+ let newOrder = order + 1;
3493
+ if (this.sub && this.sub.itemList) {
3494
+ this.sub.itemList.forEach(item => {
3495
+ newOrder = item.setOrderRecursively(newOrder);
3496
+ });
3497
+ }
3498
+ return newOrder;
3499
+ }
3500
+ setDefaultId(defaultId) {
3501
+ this.defaultId = defaultId;
3502
+ this.setDefaultIdRecursive();
3503
+ }
3504
+ setDefaultIdRecursive() {
3505
+ if (this.sub && this.sub.itemList) {
3506
+ this.sub.itemList.forEach((item, index) => {
3507
+ item.setDefaultId(`sub-${this.getId()}-${index}`);
3508
+ });
3509
+ }
3510
+ }
3511
+ getId() {
3512
+ return this.id ? this.id : this.defaultId;
3513
+ }
3514
+ isHidden() {
3515
+ return !this.inheritedMatchesSearch && (!this.sub || this.areAllChildrenHidden());
3516
+ }
3517
+ areAllChildrenHidden() {
3518
+ const children = this.sub.itemList;
3519
+ return children.findIndex(child => !child.isHidden()) < 0;
3520
+ }
3521
+ areAllChildrenChecked() {
3522
+ const children = this.sub.itemList;
3523
+ return children.findIndex(child => !child.checked) < 0;
3524
+ }
3525
+ hasChildrenCheckedOrIndeterminate() {
3526
+ const children = this.sub.itemList;
3527
+ return children.findIndex(child => child.checked || child.indeterminateChecked) >= 0;
3528
+ }
3529
+ matchesText(value) {
3530
+ var _a;
3531
+ let matches;
3532
+ if (this.allParentsExpanded && !this.isHidden()) {
3533
+ matches = (_a = this.checkbox) === null || _a === void 0 ? void 0 : _a.matchesText(value);
3534
+ }
3535
+ else {
3536
+ const itemText = this.hiddenWrapper.nativeElement.textContent;
3537
+ matches = SearchUtils.containsAnyWordFrom(itemText, value);
3538
+ }
3539
+ this._matchesValidText = value ? matches : false;
3540
+ return matches;
3541
+ }
3542
+ getKey() {
3543
+ return this.treeItemKey;
3544
+ }
3545
+ getParentKey() {
3546
+ let parentKey;
3547
+ let parentElement = this.element.nativeElement.parentElement;
3548
+ while (parentElement && parentElement.tagName !== 'BODY' && parentElement.tagName !== 'DESY-TREE-ITEM' && parentElement.tagName !== 'DESY-TREE') {
3549
+ parentElement = parentElement.parentElement;
3550
+ }
3551
+ if (parentElement.tagName === 'BODY') {
3552
+ throw new Error('Parent for tree-item not found');
3553
+ }
3554
+ if (parentElement.tagName === 'DESY-TREE') {
3555
+ parentKey = 'root';
3556
+ }
3557
+ if (parentElement.tagName === 'DESY-TREE-ITEM') {
3558
+ parentKey = parentElement.getAttribute('desy-tree-item-key');
3559
+ }
3560
+ return parentKey;
3561
+ }
3562
+ isActive() {
3563
+ return this.active || this._matchesValidText;
3564
+ }
3565
+ /*
3566
+ * Métodos privados
3567
+ */
3568
+ /**
3569
+ * Genera una clave única para el componente
3570
+ * @private
3571
+ */
3572
+ static generateStaticItemKey() {
3573
+ const key = 'tree-item-key-' + TreeItemComponent._treeItemKeySuffix;
3574
+ TreeItemComponent._treeItemKeySuffix++;
3575
+ return key;
3576
+ }
3577
+ }
3578
+ TreeItemComponent._treeItemKeySuffix = 0; // Sufijo estático para generar siempre claves distintas
3579
+ TreeItemComponent.decorators = [
3580
+ { type: Component, args: [{
3581
+ selector: 'desy-tree-item',
3582
+ 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 }\"\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]=\"isActive() && 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 [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 : (isActive() ? '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 <ng-container *ngTemplateOutlet=\"checkbox\"></ng-container>\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 <!--\r\n El *ngIf=\"name || parentName\" se realiza para no crear el checkbox hasta que se ha ejecutado el configureAllItems.\r\n Esto puede dar problemas porque, hasta que no se ejecuta esto, el desy-tree-checkbox no cuenta con el type actualizado (por defecto radio).\r\n Un ejemplo en el que esto puede ser problem\u00E1tico es al ser typo checkbox y darle un valor checked=true a varios los items, ya\r\n que el type todav\u00EDa no se ha transmitido aqu\u00ED. Como por defecto el type es radio, s\u00F3lo marcar\u00E1 el \u00FAltimo. Posteriormente,\r\n ya detectar\u00E1 el tipo y permitir\u00E1 seleccionar varios items, pero hasta entonces existe este problema.\r\n -->\r\n <desy-tree-checkbox *ngIf=\"name || parentName\"\r\n [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 <div class=\"font-bold\" *ngIf=\"isActive(); else contentLabel\">\r\n <ng-container *ngTemplateOutlet=\"contentLabel\"></ng-container>\r\n </div>\r\n <ng-content select=\"desy-hint\"></ng-content>\r\n</ng-template>\r\n\r\n<ng-template #contentLabel>\r\n <ng-content select=\"desy-label\"></ng-content>\r\n</ng-template>\r\n",
3583
+ providers: [
3584
+ {
3585
+ provide: ITreeItem,
3586
+ useExisting: forwardRef(() => TreeItemComponent)
3587
+ }
3588
+ ]
3589
+ },] }
3590
+ ];
3591
+ TreeItemComponent.ctorParameters = () => [
3592
+ { type: ChangeDetectorRef },
3593
+ { type: ElementRef }
3594
+ ];
3595
+ TreeItemComponent.propDecorators = {
3596
+ hiddenWrapper: [{ type: ViewChild, args: ['hiddenWrapper',] }],
3597
+ id: [{ type: Input }],
3598
+ name: [{ type: Input }],
3599
+ value: [{ type: Input }],
3600
+ classes: [{ type: Input }],
3601
+ active: [{ type: Input }],
3602
+ disabled: [{ type: Input }],
3603
+ title: [{ type: Input }],
3604
+ hasDividers: [{ type: Input }],
3605
+ isIndeterminate: [{ type: Input }],
3606
+ checked: [{ type: Input }],
3607
+ checkedChange: [{ type: Output }],
3608
+ expanded: [{ type: Input }],
3609
+ expandedChange: [{ type: Output }],
3610
+ indeterminateChecked: [{ type: Input }],
3611
+ indeterminateCheckedChange: [{ type: Output }],
3612
+ sub: [{ type: ContentChildren, args: [TreeSubComponent,] }],
3613
+ hint: [{ type: ContentChildren, args: [HintComponent,] }],
3614
+ label: [{ type: ContentChildren, args: [LabelComponent,] }],
3615
+ checkbox: [{ type: ViewChild, args: [TreeCheckboxComponent,] }],
3616
+ treeItemKey: [{ type: HostBinding, args: ['attr.desy-tree-item-key',] }]
3617
+ };
3618
+ __decorate([
3619
+ DesyOnInputChange('setDefaultIdRecursive')
3620
+ ], TreeItemComponent.prototype, "id", void 0);
3621
+ __decorate([
3622
+ DesyContentChild({ onSetCallbackName: 'overrideSubValues' })
3623
+ ], TreeItemComponent.prototype, "sub", void 0);
3624
+ __decorate([
3625
+ DesyContentChild()
3626
+ ], TreeItemComponent.prototype, "hint", void 0);
3627
+ __decorate([
3628
+ DesyContentChild()
3629
+ ], TreeItemComponent.prototype, "label", void 0);
3630
+
3631
+ class TreeComponent extends FormFieldComponent {
3632
+ constructor(changeDetector) {
3633
+ super();
3634
+ this.changeDetector = changeDetector;
3635
+ this.expandedFirstLevel = true;
3636
+ this.decoupleChildFromParent = false;
3637
+ this.disableDefaultSearch = false;
3638
+ this.searchMatchValuesChange = new EventEmitter();
3639
+ this.rootItems = [];
3640
+ this._itemListCheckedSubscriptions = [];
3641
+ this._itemListQuitFocusSubscriptions = [];
3642
+ this._alreadyConfiguringItems = false;
3643
+ }
3644
+ ngOnDestroy() {
3645
+ var _a, _b;
3646
+ this.clearSubscriptions(this._itemListCheckedSubscriptions);
3647
+ this.clearSubscriptions(this._itemListQuitFocusSubscriptions);
3648
+ (_a = this._itemListSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
3649
+ (_b = this._allItemListSubscription) === null || _b === void 0 ? void 0 : _b.unsubscribe();
3650
+ }
3651
+ ngOnChanges(changes) {
3652
+ this.configureAllItems();
3653
+ }
3654
+ /**
3655
+ * Se sobrescribe el valor para actualizar los items
3656
+ * @Override
3657
+ */
3658
+ writeValue(value) {
3659
+ this.value = value;
3660
+ this.configureAllItems(true);
3661
+ this.onChange(this.value);
3662
+ }
3663
+ /*
3664
+ * Eventos
3665
+ */
3666
+ /**
3667
+ * Actualiza el valor del componente al checkquearse un ítem
3668
+ * @param originItem ítem modificado
3669
+ */
3670
+ updateValueFromItems(originItem) {
3671
+ // Si es radio, se desactivan el resto de items cuando se activa otro item
3672
+ if (this.type !== 'checkbox') {
3673
+ const items = this.getAllItemsInOrder();
3674
+ items.forEach(item => {
3675
+ if (item !== originItem && item.checked) {
3676
+ item.setChecked(false, true);
3677
+ }
3678
+ });
3679
+ }
3680
+ else if (!this.decoupleChildFromParent) {
3681
+ this.rootItems.forEach(item => item.setCheckedAutomaticallyDependingOnChildren());
3682
+ }
3683
+ this.value = [];
3684
+ const items = this.getAllItemsInOrder();
3685
+ items.forEach(item => {
3686
+ if (item.checked) {
3687
+ this.value.push(item.value);
3688
+ }
3689
+ });
3690
+ this.onChange(this.value);
3691
+ }
3692
+ /**
3693
+ * Gestiona cuando el foco abandona un ítem desde un evento de teclado controlado
3694
+ * @param options
3695
+ */
3696
+ handleItemQuitFocus(options) {
3697
+ if (options && options.nextElement) {
3698
+ const items = this.getAllItemsInOrder();
3699
+ const focusableItems = items.filter(item => !item.isHidden() && !item.disabled && item.allParentsExpanded);
3700
+ switch (options.nextElement) {
3701
+ case "first":
3702
+ focusableItems[0].focus();
3703
+ break;
3704
+ case "last":
3705
+ focusableItems[focusableItems.length - 1].focus();
3706
+ break;
3707
+ case "parent":
3708
+ const currentSubLevel = options.currentItem.subLevel;
3709
+ if (currentSubLevel > 0) {
3710
+ const currentItemIndex = focusableItems.findIndex(item => item === options.currentItem);
3711
+ const parent = focusableItems.slice(0, currentItemIndex).reverse().find(item => item.subLevel < currentSubLevel);
3712
+ if (parent) {
3713
+ parent.focus();
3714
+ }
3715
+ }
3716
+ break;
3717
+ case "firstChild":
3718
+ case "next":
3719
+ if (options.currentItem) {
3720
+ let currentItemIndex = focusableItems.findIndex(item => item === options.currentItem);
3721
+ if (currentItemIndex < focusableItems.length - 1) {
3722
+ focusableItems[currentItemIndex + 1].focus();
3723
+ }
3724
+ }
3725
+ break;
3726
+ case "previous":
3727
+ if (options.currentItem) {
3728
+ const currentItemIndex = focusableItems.findIndex(item => item === options.currentItem);
3729
+ if (currentItemIndex > 0) {
3730
+ focusableItems[currentItemIndex - 1].focus();
3731
+ }
3732
+ }
3733
+ break;
3734
+ }
3735
+ }
3736
+ }
3737
+ /**
3738
+ * Realiza la búsqueda interna de los items en el componente
3739
+ * @param value texto de búsqueda
3740
+ */
3741
+ onSearch(value) {
3742
+ if (!this.disableDefaultSearch) {
3743
+ if (value && value.length > 0) {
3744
+ this.searchMatchValues = this.allItems.filter(item => item.matchesText(value)).map(item => item.value);
3745
+ }
3746
+ else {
3747
+ this.searchMatchValues = null;
3748
+ }
3749
+ this.searchMatchValuesChange.emit(this.searchMatchValues);
3750
+ }
3751
+ }
3752
+ /*
3753
+ * Eventos al cambiar propiedades
3754
+ */
3755
+ /**
3756
+ * Configura los items del árbol
3757
+ */
3758
+ configureAllItems(isValueChange = false) {
3759
+ if (!this._alreadyConfiguringItems) {
3760
+ this._alreadyConfiguringItems = true;
3761
+ // Lo realizamos desde un setTimeout para que todos los inputs, values y demás vivan en paz y armonía
3762
+ setTimeout(() => {
3763
+ var _a;
3764
+ if (((_a = this.allItems) === null || _a === void 0 ? void 0 : _a.length) > 0) {
3765
+ this.clearSubscriptions(this._itemListCheckedSubscriptions);
3766
+ this.clearSubscriptions(this._itemListQuitFocusSubscriptions);
3767
+ this.allItems.forEach(item => {
3768
+ item.parentName = this.name;
3769
+ item.type = this.type;
3770
+ item.inheritedDescribedBy = this.getDescribedByForItems();
3771
+ item.inheritedExpandedFirstLevel = this.expandedFirstLevel;
3772
+ item.inheritedDecoupleChildFromParent = this.decoupleChildFromParent;
3773
+ if ((this.value && this.value.length > 0) || isValueChange) {
3774
+ const valueList = this.value ? this.value : [];
3775
+ item.setChecked(!!valueList.find(v => v === item.value), true);
3776
+ }
3777
+ item.detectChanges();
3778
+ const checkedSubscription = item.checkedChangeForTree.subscribe(() => this.updateValueFromItems(item));
3779
+ this._itemListCheckedSubscriptions.push(checkedSubscription);
3780
+ const quitFocusSubscription = item.quitFocus.subscribe(options => this.handleItemQuitFocus(options));
3781
+ this._itemListQuitFocusSubscriptions.push(quitFocusSubscription);
3782
+ });
3783
+ this.setErrorInItems(this.hasErrorMessageComponent());
3784
+ this.buildTree();
3785
+ if (!this.value) {
3786
+ this.updateValueFromItems();
3787
+ }
3788
+ if (this.searchMatchValues) {
3789
+ this.onSearchMatchValuesChange();
3790
+ }
3791
+ }
3792
+ if (this.allItems && !this._allItemListSubscription) {
3793
+ this._allItemListSubscription = this.allItems.changes.subscribe(() => this.configureAllItems());
3794
+ }
3795
+ this.changeDetector.detectChanges();
3796
+ this._alreadyConfiguringItems = false;
3797
+ });
3798
+ }
3799
+ }
3800
+ /**
3801
+ * Modifica los items visibles según el filtro de búsqueda
3802
+ */
3803
+ onSearchMatchValuesChange() {
3804
+ if (this.allItems) {
3805
+ this.allItems.forEach(item => {
3806
+ item.inheritedMatchesSearch = true;
3807
+ });
3808
+ if (this.searchMatchValues !== null && this.searchMatchValues !== undefined) {
3809
+ this.allItems.forEach(item => {
3810
+ if (this.searchMatchValues.findIndex(value => item.value === value) < 0) {
3811
+ item.inheritedMatchesSearch = false;
3812
+ }
3813
+ });
3814
+ }
3815
+ }
3816
+ }
3817
+ /*
3818
+ * Getters and setters
3819
+ */
3820
+ getIdPrefix() {
3821
+ return this.idPrefix ? this.idPrefix : this.name;
3822
+ }
3823
+ getDescribedBy() {
3824
+ let describedBy = '';
3825
+ if (this.describedBy) {
3826
+ describedBy = this.describedBy;
3827
+ }
3828
+ if (this.hasHintComponent() && this.hintComponent.id) {
3829
+ describedBy = describedBy + ' ' + this.hintComponent.id;
3830
+ }
3831
+ if (this.hasErrorMessageComponent() && this.errorMessageComponent.id) {
3832
+ describedBy = describedBy + ' ' + this.errorMessageComponent.id;
3833
+ }
3834
+ return describedBy;
3835
+ }
3836
+ /**
3837
+ * Devuelve el valor de describedBy que se transmitirá a los items
3838
+ */
3839
+ getDescribedByForItems() {
3840
+ let describedBy;
3841
+ if (this.hasFieldsetComponent()) {
3842
+ describedBy = this.fieldsetComponent.describedBy;
3843
+ }
3844
+ else {
3845
+ describedBy = this.getDescribedBy();
3846
+ }
3847
+ return describedBy;
3848
+ }
3849
+ hasFieldsetComponent() {
3850
+ return !!this.fieldsetComponent;
3851
+ }
3852
+ /**
3853
+ * Overrides super.getHintId();
3854
+ */
3855
+ getHintId() {
3856
+ var _a;
3857
+ return this.idPrefix ? this.idPrefix + '-hint' : (_a = this.hintComponent) === null || _a === void 0 ? void 0 : _a.id;
3858
+ }
3859
+ /**
3860
+ * Overrides super.getHintId();
3861
+ */
3862
+ getErrorId() {
3863
+ var _a;
3864
+ return this.idPrefix ? this.idPrefix + '-error' : (_a = this.errorMessageComponent) === null || _a === void 0 ? void 0 : _a.id;
3865
+ }
3866
+ /*
3867
+ * Funciones para reemplazar el contenido del fieldset, label, hint o errormessage
3868
+ */
3869
+ overrideFieldsetParams(fieldset) {
3870
+ fieldset.caller = this.innerHtml;
3871
+ fieldset.errorId = this.getErrorId();
3872
+ fieldset.describedBy = this.getDescribedBy();
3873
+ fieldset.detectChanges();
3874
+ }
3875
+ overrideSearchBarParams(searchbar) {
3876
+ const defaultOnChange = searchbar.onChange;
3877
+ const newOnChange = value => {
3878
+ this.onSearch(value);
3879
+ defaultOnChange(value);
3880
+ };
3881
+ searchbar.registerOnChange(newOnChange);
3882
+ }
3883
+ /**
3884
+ * Se llama desde FormField
3885
+ */
3886
+ overrideHintParams(hint) {
3887
+ hint.id = this.getHintId();
3888
+ hint.detectChanges();
3889
+ }
3890
+ /**
3891
+ * Se llama desde FormField
3892
+ */
3893
+ overrideErrorMessageParams(errorMessage) {
3894
+ errorMessage.id = this.getErrorId();
3895
+ this.setErrorInItems(this.hasErrorMessageComponent());
3896
+ errorMessage.detectChanges();
3897
+ }
3898
+ /**
3899
+ * Se llama desde FormField
3900
+ */
3901
+ onDeleteErrorMessage(errorMessage) {
3902
+ this.setErrorInItems(this.hasErrorMessageComponent());
3903
+ }
3904
+ /*
3905
+ * Métodos privados
3906
+ */
3907
+ /**
3908
+ * Configura la estructura del árbol
3909
+ * @private
3910
+ */
3911
+ buildTree() {
3912
+ // Se crea un mapa para tener accesibles los items por key y se borran los listados existentes
3913
+ const itemMap = {};
3914
+ this.rootItems = [];
3915
+ this.allItems.forEach(item => {
3916
+ const key = item.getKey();
3917
+ itemMap[key] = item;
3918
+ if (item.sub) {
3919
+ item.sub.itemList = [];
3920
+ }
3921
+ });
3922
+ // Se añaden los items a los listados correspondientes
3923
+ this.allItems.forEach(item => {
3924
+ const parentKey = item.getParentKey();
3925
+ if (parentKey === 'root') {
3926
+ this.rootItems.push(item);
3927
+ }
3928
+ else if (parentKey) {
3929
+ const sub = itemMap[parentKey].sub;
3930
+ if (sub) {
3931
+ sub.itemList.push(item);
3932
+ }
3933
+ }
3934
+ });
3935
+ // Se configuran los items desde root
3936
+ let order = 0;
3937
+ this.rootItems.forEach((item, index) => {
3938
+ item.setSubLevel(0);
3939
+ item.setDefaultId(`${this.idPrefix}-${index}`);
3940
+ item.refreshAllParentsExpandedRecursive(true);
3941
+ if (!this.decoupleChildFromParent) {
3942
+ item.setCheckedAutomaticallyDependingOnChildren();
3943
+ }
3944
+ order = item.setOrderRecursively(order);
3945
+ });
3946
+ }
3947
+ /**
3948
+ * Si tiene un mensaje de error, se indica a los items
3949
+ * @param hasError
3950
+ * @private
3951
+ */
3952
+ setErrorInItems(hasError) {
3953
+ var _a;
3954
+ if (((_a = this.allItems) === null || _a === void 0 ? void 0 : _a.length) > 0) {
3955
+ this.allItems.forEach(item => {
3956
+ item.inheritedHasError = hasError;
3957
+ item.detectChanges();
3958
+ });
3959
+ }
3960
+ }
3961
+ /**
3962
+ * Limpia un listado de subscripciones
3963
+ * @param subscriptionList
3964
+ * @private
3965
+ */
3966
+ clearSubscriptions(subscriptionList) {
3967
+ if (subscriptionList.length > 0) {
3968
+ subscriptionList.forEach(s => s.unsubscribe());
3969
+ subscriptionList.splice(0, subscriptionList.length);
3970
+ }
3971
+ }
3972
+ /**
3973
+ * Devuelve los items del árbol ordenados
3974
+ * @private
3975
+ */
3976
+ getAllItemsInOrder() {
3977
+ let list = [];
3978
+ if (this.allItems) {
3979
+ list = this.allItems.toArray().sort((a, b) => a.orderInTree > b.orderInTree ? 1 : -1);
3980
+ }
3981
+ return list;
3982
+ }
3983
+ }
3984
+ TreeComponent.decorators = [
3985
+ { type: Component, args: [{
3986
+ selector: 'desy-tree',
3987
+ 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",
3988
+ providers: [
3989
+ {
3990
+ provide: NG_VALUE_ACCESSOR,
3991
+ useExisting: forwardRef(() => TreeComponent),
3992
+ multi: true
3993
+ }
3994
+ ]
3995
+ },] }
3996
+ ];
3997
+ TreeComponent.ctorParameters = () => [
3998
+ { type: ChangeDetectorRef }
3999
+ ];
4000
+ TreeComponent.propDecorators = {
4001
+ idPrefix: [{ type: Input }],
4002
+ classes: [{ type: Input }],
4003
+ formGroupClasses: [{ type: Input }],
4004
+ name: [{ type: Input }],
4005
+ type: [{ type: Input }],
4006
+ describedBy: [{ type: Input }],
4007
+ expandedFirstLevel: [{ type: Input }],
4008
+ decoupleChildFromParent: [{ type: Input }],
4009
+ disableDefaultSearch: [{ type: Input }],
4010
+ searchMatchValues: [{ type: Input }],
4011
+ searchMatchValuesChange: [{ type: Output }],
4012
+ allItems: [{ type: ContentChildren, args: [TreeItemComponent, { descendants: true },] }],
4013
+ fieldsetComponent: [{ type: ContentChildren, args: [FieldsetComponent,] }],
4014
+ searchBarComponent: [{ type: ContentChildren, args: [SearchBarComponent,] }],
4015
+ innerHtml: [{ type: ViewChild, args: ['innerHtml', { static: true },] }]
4016
+ };
4017
+ __decorate([
4018
+ DesyOnInputChange('onSearchMatchValuesChange')
4019
+ ], TreeComponent.prototype, "searchMatchValues", void 0);
4020
+ __decorate([
4021
+ DesyOnInputChange('configureAllItems')
4022
+ ], TreeComponent.prototype, "allItems", void 0);
4023
+ __decorate([
4024
+ DesyContentChild({ onSetCallbackName: 'overrideFieldsetParams' })
4025
+ ], TreeComponent.prototype, "fieldsetComponent", void 0);
4026
+ __decorate([
4027
+ DesyContentChild({ onSetCallbackName: 'overrideSearchBarParams' })
4028
+ ], TreeComponent.prototype, "searchBarComponent", void 0);
4029
+
3054
4030
  class ConditionDirective {
3055
4031
  constructor(templateRef) {
3056
4032
  this.templateRef = templateRef;
@@ -3085,6 +4061,30 @@ ConditionDirective.propDecorators = {
3085
4061
  items: [{ type: Input }]
3086
4062
  };
3087
4063
 
4064
+ class TreeItemsGeneratorComponent {
4065
+ constructor(viewContainerRef) {
4066
+ this.viewContainerRef = viewContainerRef;
4067
+ }
4068
+ ngOnInit() {
4069
+ this.viewContainerRef.createEmbeddedView(this.content);
4070
+ }
4071
+ }
4072
+ TreeItemsGeneratorComponent.decorators = [
4073
+ { type: Component, args: [{
4074
+ selector: 'desy-tree-items-generator',
4075
+ 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",
4076
+ changeDetection: ChangeDetectionStrategy.OnPush
4077
+ },] }
4078
+ ];
4079
+ TreeItemsGeneratorComponent.ctorParameters = () => [
4080
+ { type: ViewContainerRef }
4081
+ ];
4082
+ TreeItemsGeneratorComponent.propDecorators = {
4083
+ content: [{ type: ViewChild, args: ['content', { static: true },] }],
4084
+ items: [{ type: Input }],
4085
+ itemTemplate: [{ type: Input }]
4086
+ };
4087
+
3088
4088
  class ModalButtonPrimaryComponent extends ContentBaseComponent {
3089
4089
  constructor() {
3090
4090
  super(...arguments);
@@ -3600,6 +4600,8 @@ class HeaderOffcanvasComponent {
3600
4600
  if (this.isOpen()) {
3601
4601
  this.dialogService.closeDialog(this.dialog);
3602
4602
  this.dialog = null;
4603
+ const elementToFocus = document.getElementById('header-offcanvas-button');
4604
+ elementToFocus === null || elementToFocus === void 0 ? void 0 : elementToFocus.focus();
3603
4605
  }
3604
4606
  }
3605
4607
  isOpen() {
@@ -3624,14 +4626,15 @@ class HeaderOffcanvasComponent {
3624
4626
  }
3625
4627
  HeaderOffcanvasComponent.dialogOptions = {
3626
4628
  id: 'header-offcanvas-dialog',
3627
- focusOnClose: 'header-offcanvas',
4629
+ focusOnClose: 'header-offcanvas-button',
3628
4630
  ariaModal: 'true',
3629
- ariaLabelledBy: 'header-offcanvas-button-text'
4631
+ ariaLabelledBy: 'header-offcanvas-button-text',
4632
+ role: 'dialog'
3630
4633
  };
3631
4634
  HeaderOffcanvasComponent.decorators = [
3632
4635
  { type: Component, args: [{
3633
4636
  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"
4637
+ 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
4638
  },] }
3636
4639
  ];
3637
4640
  HeaderOffcanvasComponent.ctorParameters = () => [
@@ -3798,11 +4801,47 @@ class NavComponent extends AccessibilityComponent {
3798
4801
  getIdPrefix() {
3799
4802
  return this.idPrefix ? this.idPrefix : 'nav-item';
3800
4803
  }
4804
+ movePrevious(event, currentIndex) {
4805
+ event.preventDefault();
4806
+ const items = this.getItemList();
4807
+ let nextIndex = currentIndex - 1;
4808
+ while (nextIndex >= 0 && !this.isFocusableItem(items[nextIndex])) {
4809
+ nextIndex--;
4810
+ }
4811
+ if (nextIndex < items.length) {
4812
+ const itemElem = document.getElementById(this.getItemId(items[nextIndex], nextIndex));
4813
+ if (itemElem) {
4814
+ itemElem.focus();
4815
+ }
4816
+ }
4817
+ }
4818
+ moveNext(event, currentIndex) {
4819
+ event.preventDefault();
4820
+ const items = this.getItemList();
4821
+ let nextIndex = currentIndex + 1;
4822
+ while (nextIndex < items.length && !this.isFocusableItem(items[nextIndex])) {
4823
+ nextIndex++;
4824
+ }
4825
+ if (nextIndex < items.length) {
4826
+ const itemElem = document.getElementById(this.getItemId(items[nextIndex], nextIndex));
4827
+ if (itemElem) {
4828
+ itemElem.focus();
4829
+ }
4830
+ }
4831
+ }
4832
+ simulateClick(event, item, index) {
4833
+ event.preventDefault();
4834
+ const element = document.getElementById(this.getItemId(item, index));
4835
+ element === null || element === void 0 ? void 0 : element.click();
4836
+ }
4837
+ isFocusableItem(item) {
4838
+ return !item.active && !item.disabled;
4839
+ }
3801
4840
  }
3802
4841
  NavComponent.decorators = [
3803
4842
  { type: Component, args: [{
3804
4843
  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"
4844
+ 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 (keydown.space)=\"simulateClick($event, item, i)\"\r\n (keydown.enter)=\"simulateClick($event, item, 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 <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 (keydown.space)=\"simulateClick($event, item, i)\"\r\n (keydown.enter)=\"simulateClick($event, item, i)\"\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
4845
  },] }
3807
4846
  ];
3808
4847
  NavComponent.propDecorators = {
@@ -3832,7 +4871,7 @@ class HeaderSubnavComponent extends AccessibilityComponent {
3832
4871
  HeaderSubnavComponent.decorators = [
3833
4872
  { type: Component, args: [{
3834
4873
  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"
4874
+ 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
4875
  },] }
3837
4876
  ];
3838
4877
  HeaderSubnavComponent.propDecorators = {
@@ -3861,7 +4900,7 @@ class HeaderDropdownComponent extends AccessibilityComponent {
3861
4900
  HeaderDropdownComponent.decorators = [
3862
4901
  { type: Component, args: [{
3863
4902
  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"
4903
+ 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
4904
  },] }
3866
4905
  ];
3867
4906
  HeaderDropdownComponent.propDecorators = {
@@ -3869,11 +4908,15 @@ HeaderDropdownComponent.propDecorators = {
3869
4908
  classesContainer: [{ type: Input }],
3870
4909
  classesTooltip: [{ type: Input }],
3871
4910
  classes: [{ type: Input }],
3872
- nav: [{ type: ContentChildren, args: [NavComponent,] }]
4911
+ nav: [{ type: ContentChildren, args: [NavComponent,] }],
4912
+ contentComponent: [{ type: ContentChildren, args: [ContentComponent,] }]
3873
4913
  };
3874
4914
  __decorate([
3875
4915
  DesyContentChild({ onSetCallbackName: 'overrideNavParams' })
3876
- ], HeaderDropdownComponent.prototype, "nav", void 0);
4916
+ ], HeaderDropdownComponent.prototype, "nav", void 0);
4917
+ __decorate([
4918
+ DesyContentChild()
4919
+ ], HeaderDropdownComponent.prototype, "contentComponent", void 0);
3877
4920
 
3878
4921
  class SkipLinkComponent extends AccessibilityComponent {
3879
4922
  constructor(changeDetectorRef) {
@@ -4306,7 +5349,7 @@ class MenuVerticalComponent extends AccessibilityComponent {
4306
5349
  else {
4307
5350
  const idPrefix = this.idPrefix ? this.idPrefix : 'nav-item';
4308
5351
  if (i === 0) {
4309
- return idPrefix;
5352
+ return idPrefix + '-0';
4310
5353
  }
4311
5354
  else {
4312
5355
  return idPrefix + '-' + i;
@@ -5374,63 +6417,6 @@ __decorate([
5374
6417
  DesyContentChild()
5375
6418
  ], TableComponent.prototype, "headerComponent", void 0);
5376
6419
 
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
6420
  var OrderBy;
5435
6421
  (function (OrderBy) {
5436
6422
  OrderBy["none"] = "none";
@@ -6799,7 +7785,7 @@ class PaginationComponent extends AccessibilityComponent {
6799
7785
  PaginationComponent.decorators = [
6800
7786
  { type: Component, args: [{
6801
7787
  selector: 'desy-pagination',
6802
- template: "<div [attr.id]=\"id ? id : null\" [class]=\"['lg:flex lg:flex-wrap lg:align-center', classesContainer] | makeHtmlList\">\r\n <ng-container *ngIf=\"hasSelect\">\r\n <p class=\"w-full mb-xs text-sm text-neutral-dark\">\r\n Selecciona una p\u00E1gina para cargar datos\r\n </p>\r\n <nav [class]=\"['flex flex-wrap items-center flex-1 mb-base lg:mb-0 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 <desy-button (clickEvent)=\"previous()\" [id]=\"getIdPrefix() + '-previous'\"\r\n [html]=\"previousIcon + prefix + previousText + getSuffix(currentPage - 2)\" [disabled]=\"currentPage === 1 || !hasPrevious\"\r\n classes=\"c-button--sm c-button--transparent mr-xs\"></desy-button>\r\n <desy-listbox [id]=\"id + '-listbox'\"\r\n [idPrefix]=\"idPrefix\"\r\n [text]=\"'P\u00E1gina ' + getActiveItemText()\"\r\n [classes]=\"'c-listbox--sm c-listbox--transparent mr-xs'\"\r\n [doesChangeButtonText]=\"true\"\r\n [label]=\"{ text: 'Selecciona una p\u00E1gina para cargar datos', classes: 'sr-only' }\"\r\n [(items)]=\"items\"\r\n (activeItemChange)=\"changePage(+$event.text)\"></desy-listbox>\r\n <desy-button (clickEvent)=\"next()\" [id]=\"getIdPrefix() + '-next'\"\r\n [html]=\"prefix + nextText + getSuffix(currentPage) + nextIcon\" [disabled]=\"currentPage === nPages || !hasNext\"\r\n classes=\"c-button--sm c-button--transparent mr-xs\"></desy-button>\r\n </nav>\r\n </ng-container>\r\n <ng-container *ngIf=\"!hasSelect\">\r\n <nav [class]=\"['flex flex-wrap items-center flex-1 mb-base lg:mb-0 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 class=\"flex flex-wrap\">\r\n <li *ngFor=\"let item of items; index as i\">\r\n <desy-button *ngIf=\"item.active\" [id]=\"getButtonId(i)\"\r\n [html]=\"'<strong>' + prefix + (i + 1) + getSuffix(i) + '</strong>'\"\r\n classes=\"c-button--primary c-button--disabled mb-sm mr-sm\"\r\n disabled=\"true\" ariaCurrent=\"page\" tabindex=\"-1\" ></desy-button>\r\n <desy-button *ngIf=\"!item.active\" [id]=\"getButtonId(i)\"\r\n [html]=\"prefix + (i + 1) + getSuffix(i)\"\r\n (clickEvent)=\"changePage(i + 1)\"\r\n classes=\"mb-sm mr-sm\"></desy-button>\r\n </li>\r\n </ul>\r\n </nav>\r\n </ng-container>\r\n <p class=\"block lg:ml-auto text-sm text-neutral-dark\">\r\n <span class=\"sr-only\">Posici\u00F3n de paginaci\u00F3n: </span>{{(currentPage - 1) * itemsPerPage + 1}} - {{getLastItemNumber(currentPage - 1)}} de {{totalItems}}\r\n </p>\r\n</div>\r\n"
7788
+ template: "<div [attr.id]=\"id ? id : null\" [class]=\"['lg:flex lg:flex-wrap lg:align-center', classesContainer] | makeHtmlList\">\r\n <ng-container *ngIf=\"hasSelect\">\r\n <p class=\"w-full mb-xs text-sm text-neutral-dark\">\r\n Selecciona una p\u00E1gina para cargar datos\r\n </p>\r\n <nav [class]=\"['flex flex-wrap items-center flex-1 mb-base lg:mb-0 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 <desy-button (clickEvent)=\"previous()\" [id]=\"getIdPrefix() + '-previous'\"\r\n [html]=\"previousIcon + prefix + previousText + getSuffix(currentPage - 2)\" [disabled]=\"currentPage === 1 || !hasPrevious\"\r\n classes=\"c-button--sm c-button--transparent mr-xs\"></desy-button>\r\n <desy-listbox [id]=\"id + '-listbox'\"\r\n [idPrefix]=\"idPrefix\"\r\n [text]=\"'P\u00E1gina ' + getActiveItemText()\"\r\n [classes]=\"'c-listbox--sm c-listbox--transparent mr-xs'\"\r\n [classesTooltip]=\"'max-h-52 overflow-y-auto'\"\r\n [doesChangeButtonText]=\"true\"\r\n [label]=\"{ text: 'Selecciona una p\u00E1gina para cargar datos', classes: 'sr-only' }\"\r\n [(items)]=\"items\"\r\n (activeItemChange)=\"changePage(+$event.text)\"></desy-listbox>\r\n <desy-button (clickEvent)=\"next()\" [id]=\"getIdPrefix() + '-next'\"\r\n [html]=\"prefix + nextText + getSuffix(currentPage) + nextIcon\" [disabled]=\"currentPage === nPages || !hasNext\"\r\n classes=\"c-button--sm c-button--transparent mr-xs\"></desy-button>\r\n </nav>\r\n </ng-container>\r\n <ng-container *ngIf=\"!hasSelect\">\r\n <nav [class]=\"['flex flex-wrap items-center flex-1 mb-base lg:mb-0 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 class=\"flex flex-wrap\">\r\n <li *ngFor=\"let item of items; index as i\">\r\n <desy-button *ngIf=\"item.active\" [id]=\"getButtonId(i)\"\r\n [html]=\"'<strong>' + prefix + (i + 1) + getSuffix(i) + '</strong>'\"\r\n classes=\"c-button--primary c-button--disabled mb-sm mr-sm\"\r\n disabled=\"true\" ariaCurrent=\"page\" tabindex=\"-1\" ></desy-button>\r\n <desy-button *ngIf=\"!item.active\" [id]=\"getButtonId(i)\"\r\n [html]=\"prefix + (i + 1) + getSuffix(i)\"\r\n (clickEvent)=\"changePage(i + 1)\"\r\n classes=\"mb-sm mr-sm\"></desy-button>\r\n </li>\r\n </ul>\r\n </nav>\r\n </ng-container>\r\n <p class=\"block lg:ml-auto text-sm text-neutral-dark\">\r\n <span class=\"sr-only\">Posici\u00F3n de paginaci\u00F3n: </span>{{(currentPage - 1) * itemsPerPage + 1}} - {{getLastItemNumber(currentPage - 1)}} de {{totalItems}}\r\n </p>\r\n</div>\r\n"
6803
7789
  },] }
6804
7790
  ];
6805
7791
  PaginationComponent.propDecorators = {
@@ -7278,6 +8264,11 @@ DesyFormsModule.decorators = [
7278
8264
  DateInputDayComponent,
7279
8265
  DateInputMonthComponent,
7280
8266
  DateInputYearComponent,
8267
+ TreeComponent,
8268
+ TreeSubComponent,
8269
+ TreeItemComponent,
8270
+ TreeCheckboxComponent,
8271
+ TreeItemsGeneratorComponent,
7281
8272
  ConditionDirective,
7282
8273
  ],
7283
8274
  imports: [
@@ -7314,6 +8305,10 @@ DesyFormsModule.decorators = [
7314
8305
  DateInputDayComponent,
7315
8306
  DateInputMonthComponent,
7316
8307
  DateInputYearComponent,
8308
+ TreeComponent,
8309
+ TreeSubComponent,
8310
+ TreeItemComponent,
8311
+ TreeItemsGeneratorComponent,
7317
8312
  ConditionDirective
7318
8313
  ]
7319
8314
  },] }
@@ -7508,6 +8503,67 @@ DesyViewsModule.decorators = [
7508
8503
  },] }
7509
8504
  ];
7510
8505
 
8506
+ class ToggleOffStateComponent extends AccessibilityComponent {
8507
+ }
8508
+ ToggleOffStateComponent.decorators = [
8509
+ { type: Component, args: [{
8510
+ selector: 'desy-toggle-off-state',
8511
+ template: "<ng-template #contentTemplateOffState>\r\n <ng-content></ng-content>\r\n</ng-template>"
8512
+ },] }
8513
+ ];
8514
+ ToggleOffStateComponent.propDecorators = {
8515
+ content: [{ type: ViewChild, args: ['contentTemplateOffState', { static: true },] }],
8516
+ classes: [{ type: Input }]
8517
+ };
8518
+
8519
+ class ToggleOnStateComponent extends AccessibilityComponent {
8520
+ }
8521
+ ToggleOnStateComponent.decorators = [
8522
+ { type: Component, args: [{
8523
+ selector: 'desy-toggle-on-state',
8524
+ template: "<ng-template #contentTemplateOnState>\r\n <ng-content></ng-content>\r\n</ng-template>"
8525
+ },] }
8526
+ ];
8527
+ ToggleOnStateComponent.propDecorators = {
8528
+ content: [{ type: ViewChild, args: ['contentTemplateOnState', { static: true },] }],
8529
+ classes: [{ type: Input }]
8530
+ };
8531
+
8532
+ class ToggleComponent extends AccessibilityComponent {
8533
+ constructor() {
8534
+ super(...arguments);
8535
+ this.clickEvent = new EventEmitter();
8536
+ this.pressedChange = new EventEmitter();
8537
+ }
8538
+ onClick(event) {
8539
+ this.pressed = !this.pressed;
8540
+ this.pressedChange.emit(this.pressed);
8541
+ this.clickEvent.emit(event);
8542
+ }
8543
+ }
8544
+ ToggleComponent.decorators = [
8545
+ { type: Component, args: [{
8546
+ selector: 'desy-toggle',
8547
+ 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 -->"
8548
+ },] }
8549
+ ];
8550
+ ToggleComponent.propDecorators = {
8551
+ id: [{ type: Input }],
8552
+ isSwitch: [{ type: Input }],
8553
+ pressed: [{ type: Input }],
8554
+ classes: [{ type: Input }],
8555
+ clickEvent: [{ type: Output }],
8556
+ pressedChange: [{ type: Output }],
8557
+ contentTemplateOnState: [{ type: ContentChildren, args: [ToggleOnStateComponent,] }],
8558
+ contentTemplateOffState: [{ type: ContentChildren, args: [ToggleOffStateComponent,] }]
8559
+ };
8560
+ __decorate([
8561
+ DesyContentChild()
8562
+ ], ToggleComponent.prototype, "contentTemplateOnState", void 0);
8563
+ __decorate([
8564
+ DesyContentChild()
8565
+ ], ToggleComponent.prototype, "contentTemplateOffState", void 0);
8566
+
7511
8567
  class DesyButtonsModule {
7512
8568
  }
7513
8569
  DesyButtonsModule.decorators = [
@@ -7519,7 +8575,10 @@ DesyButtonsModule.decorators = [
7519
8575
  ListboxComponent,
7520
8576
  PillComponent,
7521
8577
  ListboxItemComponent,
7522
- ListboxLabelComponent
8578
+ ListboxLabelComponent,
8579
+ ToggleComponent,
8580
+ ToggleOnStateComponent,
8581
+ ToggleOffStateComponent
7523
8582
  ],
7524
8583
  imports: [
7525
8584
  CommonModule,
@@ -7534,7 +8593,10 @@ DesyButtonsModule.decorators = [
7534
8593
  ListboxComponent,
7535
8594
  PillComponent,
7536
8595
  ListboxItemComponent,
7537
- ListboxLabelComponent
8596
+ ListboxLabelComponent,
8597
+ ToggleComponent,
8598
+ ToggleOnStateComponent,
8599
+ ToggleOffStateComponent
7538
8600
  ]
7539
8601
  },] }
7540
8602
  ];
@@ -7823,5 +8885,5 @@ DesyAngularModule.decorators = [
7823
8885
  * Generated bundle index. Do not edit.
7824
8886
  */
7825
8887
 
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 };
8888
+ 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
8889
  //# sourceMappingURL=desy-angular.js.map