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
@@ -3638,6 +3638,1022 @@
3638
3638
  clickEvent: [{ type: i0.Output }]
3639
3639
  };
3640
3640
 
3641
+ var TreeSubComponent = /** @class */ (function (_super) {
3642
+ __extends(TreeSubComponent, _super);
3643
+ function TreeSubComponent() {
3644
+ return _super !== null && _super.apply(this, arguments) || this;
3645
+ }
3646
+ return TreeSubComponent;
3647
+ }(ContentBaseComponent));
3648
+ TreeSubComponent.decorators = [
3649
+ { type: i0.Component, args: [{
3650
+ selector: 'desy-tree-sub',
3651
+ 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"
3652
+ },] }
3653
+ ];
3654
+ TreeSubComponent.propDecorators = {
3655
+ classes: [{ type: i0.Input }]
3656
+ };
3657
+
3658
+ var ITreeItem = /** @class */ (function () {
3659
+ function ITreeItem() {
3660
+ }
3661
+ return ITreeItem;
3662
+ }());
3663
+
3664
+ var SearchUtils = /** @class */ (function () {
3665
+ function SearchUtils() {
3666
+ }
3667
+ /**
3668
+ * Comprueba si una cadena de texto (target) contiene cualquier palabra de otro texto (text)
3669
+ * @param target - Texto en el que buscar
3670
+ * @param text - Texto a buscar
3671
+ * @param fullWord - Indica si las palabras del texto a buscar deben aparecer enteras
3672
+ */
3673
+ SearchUtils.containsAnyWordFrom = function (target, text, fullWord) {
3674
+ var _this = this;
3675
+ var words = [];
3676
+ var includes = false;
3677
+ var simplifiedTarget = this.getSimplifiedString(target);
3678
+ if (text && text.split(' ').length > 1) {
3679
+ words = text.split(' ');
3680
+ }
3681
+ words.push(text);
3682
+ words.forEach(function (word) {
3683
+ if (simplifiedTarget && word) {
3684
+ if ((fullWord && simplifiedTarget === _this.getSimplifiedString(word))
3685
+ || (!fullWord && simplifiedTarget.includes(_this.getSimplifiedString(word)))) {
3686
+ includes = true;
3687
+ }
3688
+ }
3689
+ });
3690
+ return includes;
3691
+ };
3692
+ /**
3693
+ * Convierte a mayúsculas, elimina espacios y reemplaza/elimina caracteres especiales para realizar comparaciones más tolerantes
3694
+ * @param str - cadena de entrada
3695
+ */
3696
+ SearchUtils.getSimplifiedString = function (str) {
3697
+ var res = str;
3698
+ if (str) {
3699
+ res = str.toLocaleUpperCase().trim();
3700
+ res = res.replace('Á', 'A');
3701
+ res = res.replace('É', 'E');
3702
+ res = res.replace('Í', 'I');
3703
+ res = res.replace('Ó', 'O');
3704
+ res = res.replace('Ú', 'U');
3705
+ res = res.replace('À', 'A');
3706
+ res = res.replace('È', 'E');
3707
+ res = res.replace('Ì', 'I');
3708
+ res = res.replace('Ò', 'O');
3709
+ res = res.replace('Ù', 'U');
3710
+ res = res.replace('Ä', 'A');
3711
+ res = res.replace('Ë', 'E');
3712
+ res = res.replace('Ï', 'I');
3713
+ res = res.replace('Ö', 'O');
3714
+ res = res.replace('Ü', 'U');
3715
+ res = res.replace(',', '');
3716
+ res = res.replace('.', '');
3717
+ res = res.replace('\'', '');
3718
+ res = res.replace('"', '');
3719
+ }
3720
+ return res;
3721
+ };
3722
+ return SearchUtils;
3723
+ }());
3724
+
3725
+ var TreeCheckboxComponent = /** @class */ (function (_super) {
3726
+ __extends(TreeCheckboxComponent, _super);
3727
+ function TreeCheckboxComponent(changeDetector) {
3728
+ var _this = _super.call(this) || this;
3729
+ _this.changeDetector = changeDetector;
3730
+ _this.checkedChange = new i0.EventEmitter();
3731
+ _this.indeterminateCheckedChange = new i0.EventEmitter();
3732
+ _this.hasError = false;
3733
+ _this._hasInit = false;
3734
+ return _this;
3735
+ }
3736
+ TreeCheckboxComponent.prototype.ngOnInit = function () {
3737
+ this._hasInit = true;
3738
+ this.onDescribedByChange();
3739
+ };
3740
+ TreeCheckboxComponent.prototype.detectChanges = function () {
3741
+ this.changeDetector.detectChanges();
3742
+ };
3743
+ TreeCheckboxComponent.prototype.hasChanged = function () {
3744
+ if (this._hasInit) {
3745
+ var input = this.inputElement.nativeElement;
3746
+ // Se establece el cambio a visualizar en el input
3747
+ if (this.isIndeterminate) {
3748
+ if (input.readOnly) {
3749
+ input.checked = false;
3750
+ input.readOnly = false;
3751
+ }
3752
+ else if (!input.checked) {
3753
+ input.readOnly = true;
3754
+ input.indeterminate = true;
3755
+ }
3756
+ }
3757
+ this.setIndeterminateChecked(input.indeterminate);
3758
+ this.checkedChange.emit(input.checked);
3759
+ }
3760
+ };
3761
+ TreeCheckboxComponent.prototype.onIdChange = function () {
3762
+ this.overrideLabelParams();
3763
+ this.overrideHintParams();
3764
+ };
3765
+ TreeCheckboxComponent.prototype.setIndeterminateStatus = function () {
3766
+ var _a;
3767
+ var input = (_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.nativeElement;
3768
+ if (input) {
3769
+ if (this.indeterminateChecked) {
3770
+ input.readOnly = true;
3771
+ input.indeterminate = true;
3772
+ }
3773
+ else if (input.readOnly) {
3774
+ input.readOnly = false;
3775
+ input.indeterminate = false;
3776
+ }
3777
+ }
3778
+ };
3779
+ TreeCheckboxComponent.prototype.setIndeterminateChecked = function (indeterminateChecked) {
3780
+ this.indeterminateChecked = indeterminateChecked;
3781
+ this._lastIndeterminate = indeterminateChecked;
3782
+ this.indeterminateCheckedChange.emit(indeterminateChecked);
3783
+ this.changeDetector.detectChanges(); // Avisa al elemento input para que actualice su estado
3784
+ };
3785
+ TreeCheckboxComponent.prototype.focus = function () {
3786
+ this.inputElement.nativeElement.focus();
3787
+ };
3788
+ TreeCheckboxComponent.prototype.matchesText = function (value) {
3789
+ var checkboxText = this.contentWrapper.nativeElement.textContent;
3790
+ return SearchUtils.containsAnyWordFrom(checkboxText, value);
3791
+ };
3792
+ TreeCheckboxComponent.prototype.preventDefault = function (event) {
3793
+ event.preventDefault();
3794
+ };
3795
+ TreeCheckboxComponent.prototype.getHintId = function () {
3796
+ return this.hintComponent ? this.hintComponent.id : '';
3797
+ };
3798
+ TreeCheckboxComponent.prototype.overrideLabelParams = function () {
3799
+ if (this.labelComponent) {
3800
+ this.labelComponent.for = this.id + '-input';
3801
+ if (!this.labelComponent.classes) {
3802
+ this.labelComponent.classes = 'block relative -top-xs -left-8 pl-8 py-xs';
3803
+ }
3804
+ this.labelComponent.detectChanges();
3805
+ }
3806
+ };
3807
+ TreeCheckboxComponent.prototype.overrideHintParams = function () {
3808
+ if (this.hintComponent) {
3809
+ if (!this.hintComponent.id) {
3810
+ this.hintComponent.id = this.id + '-item-hint';
3811
+ }
3812
+ this.hintComponent.detectChanges();
3813
+ }
3814
+ this.onDescribedByChange();
3815
+ };
3816
+ TreeCheckboxComponent.prototype.getItemDescribedBy = function () {
3817
+ return (this.describedBy ? this.describedBy : '') + ' ' + this.getHintId();
3818
+ };
3819
+ TreeCheckboxComponent.prototype.onDescribedByChange = function () {
3820
+ if (this.ariaDescribedBy) {
3821
+ this.itemDescribedBy = this.ariaDescribedBy;
3822
+ }
3823
+ else {
3824
+ this.itemDescribedBy = this.getItemDescribedBy();
3825
+ }
3826
+ };
3827
+ return TreeCheckboxComponent;
3828
+ }(AccessibilityComponent));
3829
+ TreeCheckboxComponent.decorators = [
3830
+ { type: i0.Component, args: [{
3831
+ selector: 'desy-tree-checkbox',
3832
+ 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"
3833
+ },] }
3834
+ ];
3835
+ TreeCheckboxComponent.ctorParameters = function () { return [
3836
+ { type: i0.ChangeDetectorRef }
3837
+ ]; };
3838
+ TreeCheckboxComponent.propDecorators = {
3839
+ inputElement: [{ type: i0.ViewChild, args: ['input', { static: true },] }],
3840
+ contentWrapper: [{ type: i0.ViewChild, args: ['contentWrapper', { static: true },] }],
3841
+ id: [{ type: i0.Input }],
3842
+ name: [{ type: i0.Input }],
3843
+ type: [{ type: i0.Input }],
3844
+ classes: [{ type: i0.Input }],
3845
+ value: [{ type: i0.Input }],
3846
+ checked: [{ type: i0.Input }],
3847
+ checkedChange: [{ type: i0.Output }],
3848
+ isIndeterminate: [{ type: i0.Input }],
3849
+ indeterminateChecked: [{ type: i0.Input }],
3850
+ indeterminateCheckedChange: [{ type: i0.Output }],
3851
+ disabled: [{ type: i0.Input }],
3852
+ hasDividers: [{ type: i0.Input }],
3853
+ describedBy: [{ type: i0.Input }],
3854
+ hasError: [{ type: i0.Input }],
3855
+ labelComponent: [{ type: i0.Input }],
3856
+ hintComponent: [{ type: i0.Input }]
3857
+ };
3858
+ __decorate([
3859
+ DesyOnInputChange('onIdChange')
3860
+ ], TreeCheckboxComponent.prototype, "id", void 0);
3861
+ __decorate([
3862
+ DesyOnInputChange('setIndeterminateStatus')
3863
+ ], TreeCheckboxComponent.prototype, "indeterminateChecked", void 0);
3864
+ __decorate([
3865
+ DesyOnInputChange('onDescribedByChange')
3866
+ ], TreeCheckboxComponent.prototype, "describedBy", void 0);
3867
+ __decorate([
3868
+ DesyOnInputChange('overrideLabelParams')
3869
+ ], TreeCheckboxComponent.prototype, "labelComponent", void 0);
3870
+ __decorate([
3871
+ DesyOnInputChange('overrideHintParams')
3872
+ ], TreeCheckboxComponent.prototype, "hintComponent", void 0);
3873
+
3874
+ var TreeItemComponent = /** @class */ (function (_super) {
3875
+ __extends(TreeItemComponent, _super);
3876
+ function TreeItemComponent(changeDetector, element) {
3877
+ var _this = _super.call(this) || this;
3878
+ _this.changeDetector = changeDetector;
3879
+ _this.element = element;
3880
+ _this.checkedChange = new i0.EventEmitter();
3881
+ _this.checkedChangeForTree = new i0.EventEmitter();
3882
+ _this.expandedChange = new i0.EventEmitter();
3883
+ _this.indeterminateCheckedChange = new i0.EventEmitter();
3884
+ /*
3885
+ * Identificador del wrapper del componente. Se utiliza para recorrer el árbol en sentido inverso y que cada item
3886
+ * sepa cuál es su item/árbol padre.
3887
+ * Esto es necesario ya que, a la hora de construir un árbol dinámico con templates,
3888
+ * el decorador @ContentChildren no funciona correctamente y no los detecta.
3889
+ * Dejo el enlace de un problema similar: https://github.com/angular/angular/issues/21751
3890
+ */
3891
+ _this.treeItemKey = TreeItemComponent.generateStaticItemKey();
3892
+ _this.allParentsExpanded = true; // True si el elemento es visible según los elementos expandidos
3893
+ _this.inheritedMatchesSearch = true; // True si el elemento es visible según los criterios de búsqueda
3894
+ // Evento para emitir al componente arbol cuando se pretende abandonar el foco del item
3895
+ _this.quitFocus = new i0.EventEmitter();
3896
+ _this.isFocus = false;
3897
+ _this.isHover = false;
3898
+ _this._matchesValidText = false; // True si el contenido del item encaja con los criterios de búsqueda y se está filtrando
3899
+ return _this;
3900
+ }
3901
+ TreeItemComponent.prototype.ngOnChanges = function (changes) {
3902
+ var _this = this;
3903
+ if (this.sub && this.sub.itemList) {
3904
+ this.sub.itemList.forEach(function (item) { return item.refreshAllParentsExpandedRecursive(_this.allParentsExpanded && _this.expanded); });
3905
+ }
3906
+ for (var propName in changes) {
3907
+ if (changes.hasOwnProperty(propName)) {
3908
+ switch (propName) {
3909
+ case 'checked': {
3910
+ // Reasignamos el valor de checked cuando detectamos el cambio en la entrada
3911
+ setTimeout(function () {
3912
+ _this.setChecked(_this.checked, false, false);
3913
+ if (_this.inheritedExpandedFirstLevel && _this.checked && !_this.expanded) {
3914
+ _this.expandSub(true);
3915
+ }
3916
+ });
3917
+ break;
3918
+ }
3919
+ }
3920
+ }
3921
+ }
3922
+ };
3923
+ /*
3924
+ * Métodos expuestos que permiten configurar al ítem de forma externa
3925
+ */
3926
+ TreeItemComponent.prototype.focus = function () {
3927
+ var _a;
3928
+ (_a = this.checkbox) === null || _a === void 0 ? void 0 : _a.focus();
3929
+ this.handleItemFocus(true);
3930
+ };
3931
+ TreeItemComponent.prototype.setCheckedAutomaticallyDependingOnChildren = function () {
3932
+ if (this.sub) {
3933
+ this.sub.itemList.forEach(function (item) { return item.setCheckedAutomaticallyDependingOnChildren(); });
3934
+ if (this.areAllChildrenChecked()) {
3935
+ if (this.indeterminateChecked) {
3936
+ this.setIndeterminateChecked(false);
3937
+ }
3938
+ if (!this.checked) {
3939
+ this.setChecked(true, true);
3940
+ }
3941
+ }
3942
+ else if (this.hasChildrenCheckedOrIndeterminate()) {
3943
+ if (!this.indeterminateChecked) {
3944
+ this.setIndeterminateChecked(true);
3945
+ }
3946
+ if (this.checked) {
3947
+ this.setChecked(false, true);
3948
+ }
3949
+ }
3950
+ else {
3951
+ if (this.indeterminateChecked) {
3952
+ this.setIndeterminateChecked(false);
3953
+ }
3954
+ if (this.checked) {
3955
+ this.setChecked(false, true);
3956
+ }
3957
+ }
3958
+ }
3959
+ };
3960
+ TreeItemComponent.prototype.refreshAllParentsExpandedRecursive = function (value) {
3961
+ var _this = this;
3962
+ this.allParentsExpanded = value;
3963
+ if (this.sub) {
3964
+ this.sub.itemList.forEach(function (item) { return item.refreshAllParentsExpandedRecursive(value && _this.expanded); });
3965
+ }
3966
+ };
3967
+ TreeItemComponent.prototype.detectChanges = function () {
3968
+ this.changeDetector.detectChanges();
3969
+ };
3970
+ TreeItemComponent.prototype.expandSub = function (value) {
3971
+ var _this = this;
3972
+ this.expanded = value;
3973
+ if (this.sub) {
3974
+ this.sub.itemList.forEach(function (item) { return item.refreshAllParentsExpandedRecursive(_this.allParentsExpanded && value); });
3975
+ }
3976
+ this.expandedChange.emit(value);
3977
+ };
3978
+ /*
3979
+ * Gestion de eventos
3980
+ */
3981
+ TreeItemComponent.prototype.handleCheckboxChange = function (checked) {
3982
+ this.setChecked(checked, false);
3983
+ if (this.inheritedExpandedFirstLevel && checked && !this.expanded) {
3984
+ this.expandSub(true);
3985
+ }
3986
+ };
3987
+ TreeItemComponent.prototype.handleIndeterminateCheckedChange = function (indeterminate) {
3988
+ this.indeterminateCheckedChange.emit(indeterminate);
3989
+ };
3990
+ TreeItemComponent.prototype.handleItemFocus = function (value, condition) {
3991
+ if (condition === void 0) { condition = true; }
3992
+ if (condition) {
3993
+ this.isFocus = value;
3994
+ }
3995
+ };
3996
+ TreeItemComponent.prototype.handleItemHover = function (value, condition) {
3997
+ if (condition === void 0) { condition = true; }
3998
+ if (condition) {
3999
+ this.isHover = value;
4000
+ }
4001
+ };
4002
+ TreeItemComponent.prototype.handleArrowUp = function (event, condition) {
4003
+ if (condition === void 0) { condition = true; }
4004
+ if (condition) {
4005
+ event.preventDefault();
4006
+ this.quitFocus.emit({
4007
+ nextElement: 'previous',
4008
+ currentItem: this
4009
+ });
4010
+ }
4011
+ };
4012
+ TreeItemComponent.prototype.handleHome = function (event, condition) {
4013
+ if (condition === void 0) { condition = true; }
4014
+ if (condition) {
4015
+ event.preventDefault();
4016
+ this.quitFocus.emit({
4017
+ nextElement: 'first',
4018
+ currentItem: this
4019
+ });
4020
+ }
4021
+ };
4022
+ TreeItemComponent.prototype.handleEnd = function (event, condition) {
4023
+ if (condition === void 0) { condition = true; }
4024
+ if (condition) {
4025
+ event.preventDefault();
4026
+ this.quitFocus.emit({
4027
+ nextElement: 'last',
4028
+ currentItem: this
4029
+ });
4030
+ }
4031
+ };
4032
+ TreeItemComponent.prototype.handleArrowDown = function (event, condition) {
4033
+ if (condition === void 0) { condition = true; }
4034
+ if (condition) {
4035
+ event.preventDefault();
4036
+ this.quitFocus.emit({
4037
+ nextElement: 'next',
4038
+ currentItem: this
4039
+ });
4040
+ }
4041
+ };
4042
+ TreeItemComponent.prototype.handleArrowRight = function (event, condition) {
4043
+ if (condition === void 0) { condition = true; }
4044
+ var _a;
4045
+ if (condition && this.sub && ((_a = this.sub.itemList) === null || _a === void 0 ? void 0 : _a.length) > 0) {
4046
+ event.preventDefault();
4047
+ if (this.expanded) {
4048
+ this.quitFocus.emit({
4049
+ nextElement: 'firstChild',
4050
+ currentItem: this
4051
+ });
4052
+ }
4053
+ else {
4054
+ this.expandSub(true);
4055
+ }
4056
+ }
4057
+ };
4058
+ TreeItemComponent.prototype.handleArrowLeft = function (event, condition) {
4059
+ if (condition === void 0) { condition = true; }
4060
+ if (condition) {
4061
+ event.preventDefault();
4062
+ if (this.expanded) {
4063
+ this.expandSub(false);
4064
+ }
4065
+ else if (this.subLevel > 0) {
4066
+ this.quitFocus.emit({
4067
+ nextElement: 'parent',
4068
+ currentItem: this
4069
+ });
4070
+ }
4071
+ }
4072
+ };
4073
+ /*
4074
+ * Setters and getters
4075
+ */
4076
+ TreeItemComponent.prototype.setChecked = function (checked, ignoreInTree, emitEvent) {
4077
+ if (emitEvent === void 0) { emitEvent = true; }
4078
+ if (!this.disabled) {
4079
+ this.checked = checked;
4080
+ }
4081
+ if (!this.inheritedDecoupleChildFromParent && this.sub && this.sub.itemList && !this.indeterminateChecked) {
4082
+ this.sub.itemList.forEach(function (item) {
4083
+ item.setIndeterminateChecked(false);
4084
+ item.setChecked(checked, true);
4085
+ });
4086
+ }
4087
+ if (emitEvent) {
4088
+ this.checkedChange.emit(checked);
4089
+ }
4090
+ if (!ignoreInTree) {
4091
+ this.checkedChangeForTree.emit(checked);
4092
+ }
4093
+ };
4094
+ TreeItemComponent.prototype.setIndeterminateChecked = function (indeterminate) {
4095
+ if (!this.disabled) {
4096
+ this.indeterminateChecked = indeterminate;
4097
+ this.indeterminateCheckedChange.emit(indeterminate);
4098
+ }
4099
+ };
4100
+ TreeItemComponent.prototype.setSubLevel = function (subLevel) {
4101
+ this.subLevel = subLevel;
4102
+ if (this.sub && this.sub.itemList) {
4103
+ this.sub.itemList.forEach(function (item) { return item.setSubLevel(subLevel + 1); });
4104
+ }
4105
+ };
4106
+ TreeItemComponent.prototype.setOrderRecursively = function (order) {
4107
+ this.orderInTree = order;
4108
+ var newOrder = order + 1;
4109
+ if (this.sub && this.sub.itemList) {
4110
+ this.sub.itemList.forEach(function (item) {
4111
+ newOrder = item.setOrderRecursively(newOrder);
4112
+ });
4113
+ }
4114
+ return newOrder;
4115
+ };
4116
+ TreeItemComponent.prototype.setDefaultId = function (defaultId) {
4117
+ this.defaultId = defaultId;
4118
+ this.setDefaultIdRecursive();
4119
+ };
4120
+ TreeItemComponent.prototype.setDefaultIdRecursive = function () {
4121
+ var _this = this;
4122
+ if (this.sub && this.sub.itemList) {
4123
+ this.sub.itemList.forEach(function (item, index) {
4124
+ item.setDefaultId("sub-" + _this.getId() + "-" + index);
4125
+ });
4126
+ }
4127
+ };
4128
+ TreeItemComponent.prototype.getId = function () {
4129
+ return this.id ? this.id : this.defaultId;
4130
+ };
4131
+ TreeItemComponent.prototype.isHidden = function () {
4132
+ return !this.inheritedMatchesSearch && (!this.sub || this.areAllChildrenHidden());
4133
+ };
4134
+ TreeItemComponent.prototype.areAllChildrenHidden = function () {
4135
+ var children = this.sub.itemList;
4136
+ return children.findIndex(function (child) { return !child.isHidden(); }) < 0;
4137
+ };
4138
+ TreeItemComponent.prototype.areAllChildrenChecked = function () {
4139
+ var children = this.sub.itemList;
4140
+ return children.findIndex(function (child) { return !child.checked; }) < 0;
4141
+ };
4142
+ TreeItemComponent.prototype.hasChildrenCheckedOrIndeterminate = function () {
4143
+ var children = this.sub.itemList;
4144
+ return children.findIndex(function (child) { return child.checked || child.indeterminateChecked; }) >= 0;
4145
+ };
4146
+ TreeItemComponent.prototype.matchesText = function (value) {
4147
+ var _a;
4148
+ var matches;
4149
+ if (this.allParentsExpanded && !this.isHidden()) {
4150
+ matches = (_a = this.checkbox) === null || _a === void 0 ? void 0 : _a.matchesText(value);
4151
+ }
4152
+ else {
4153
+ var itemText = this.hiddenWrapper.nativeElement.textContent;
4154
+ matches = SearchUtils.containsAnyWordFrom(itemText, value);
4155
+ }
4156
+ this._matchesValidText = value ? matches : false;
4157
+ return matches;
4158
+ };
4159
+ TreeItemComponent.prototype.getKey = function () {
4160
+ return this.treeItemKey;
4161
+ };
4162
+ TreeItemComponent.prototype.getParentKey = function () {
4163
+ var parentKey;
4164
+ var parentElement = this.element.nativeElement.parentElement;
4165
+ while (parentElement && parentElement.tagName !== 'BODY' && parentElement.tagName !== 'DESY-TREE-ITEM' && parentElement.tagName !== 'DESY-TREE') {
4166
+ parentElement = parentElement.parentElement;
4167
+ }
4168
+ if (parentElement.tagName === 'BODY') {
4169
+ throw new Error('Parent for tree-item not found');
4170
+ }
4171
+ if (parentElement.tagName === 'DESY-TREE') {
4172
+ parentKey = 'root';
4173
+ }
4174
+ if (parentElement.tagName === 'DESY-TREE-ITEM') {
4175
+ parentKey = parentElement.getAttribute('desy-tree-item-key');
4176
+ }
4177
+ return parentKey;
4178
+ };
4179
+ TreeItemComponent.prototype.isActive = function () {
4180
+ return this.active || this._matchesValidText;
4181
+ };
4182
+ /*
4183
+ * Métodos privados
4184
+ */
4185
+ /**
4186
+ * Genera una clave única para el componente
4187
+ * @private
4188
+ */
4189
+ TreeItemComponent.generateStaticItemKey = function () {
4190
+ var key = 'tree-item-key-' + TreeItemComponent._treeItemKeySuffix;
4191
+ TreeItemComponent._treeItemKeySuffix++;
4192
+ return key;
4193
+ };
4194
+ return TreeItemComponent;
4195
+ }(AccessibilityComponent));
4196
+ TreeItemComponent._treeItemKeySuffix = 0; // Sufijo estático para generar siempre claves distintas
4197
+ TreeItemComponent.decorators = [
4198
+ { type: i0.Component, args: [{
4199
+ selector: 'desy-tree-item',
4200
+ 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",
4201
+ providers: [
4202
+ {
4203
+ provide: ITreeItem,
4204
+ useExisting: i0.forwardRef(function () { return TreeItemComponent; })
4205
+ }
4206
+ ]
4207
+ },] }
4208
+ ];
4209
+ TreeItemComponent.ctorParameters = function () { return [
4210
+ { type: i0.ChangeDetectorRef },
4211
+ { type: i0.ElementRef }
4212
+ ]; };
4213
+ TreeItemComponent.propDecorators = {
4214
+ hiddenWrapper: [{ type: i0.ViewChild, args: ['hiddenWrapper',] }],
4215
+ id: [{ type: i0.Input }],
4216
+ name: [{ type: i0.Input }],
4217
+ value: [{ type: i0.Input }],
4218
+ classes: [{ type: i0.Input }],
4219
+ active: [{ type: i0.Input }],
4220
+ disabled: [{ type: i0.Input }],
4221
+ title: [{ type: i0.Input }],
4222
+ hasDividers: [{ type: i0.Input }],
4223
+ isIndeterminate: [{ type: i0.Input }],
4224
+ checked: [{ type: i0.Input }],
4225
+ checkedChange: [{ type: i0.Output }],
4226
+ expanded: [{ type: i0.Input }],
4227
+ expandedChange: [{ type: i0.Output }],
4228
+ indeterminateChecked: [{ type: i0.Input }],
4229
+ indeterminateCheckedChange: [{ type: i0.Output }],
4230
+ sub: [{ type: i0.ContentChildren, args: [TreeSubComponent,] }],
4231
+ hint: [{ type: i0.ContentChildren, args: [HintComponent,] }],
4232
+ label: [{ type: i0.ContentChildren, args: [LabelComponent,] }],
4233
+ checkbox: [{ type: i0.ViewChild, args: [TreeCheckboxComponent,] }],
4234
+ treeItemKey: [{ type: i0.HostBinding, args: ['attr.desy-tree-item-key',] }]
4235
+ };
4236
+ __decorate([
4237
+ DesyOnInputChange('setDefaultIdRecursive')
4238
+ ], TreeItemComponent.prototype, "id", void 0);
4239
+ __decorate([
4240
+ DesyContentChild({ onSetCallbackName: 'overrideSubValues' })
4241
+ ], TreeItemComponent.prototype, "sub", void 0);
4242
+ __decorate([
4243
+ DesyContentChild()
4244
+ ], TreeItemComponent.prototype, "hint", void 0);
4245
+ __decorate([
4246
+ DesyContentChild()
4247
+ ], TreeItemComponent.prototype, "label", void 0);
4248
+
4249
+ var TreeComponent = /** @class */ (function (_super) {
4250
+ __extends(TreeComponent, _super);
4251
+ function TreeComponent(changeDetector) {
4252
+ var _this = _super.call(this) || this;
4253
+ _this.changeDetector = changeDetector;
4254
+ _this.expandedFirstLevel = true;
4255
+ _this.decoupleChildFromParent = false;
4256
+ _this.disableDefaultSearch = false;
4257
+ _this.searchMatchValuesChange = new i0.EventEmitter();
4258
+ _this.rootItems = [];
4259
+ _this._itemListCheckedSubscriptions = [];
4260
+ _this._itemListQuitFocusSubscriptions = [];
4261
+ _this._alreadyConfiguringItems = false;
4262
+ return _this;
4263
+ }
4264
+ TreeComponent.prototype.ngOnDestroy = function () {
4265
+ var _a, _b;
4266
+ this.clearSubscriptions(this._itemListCheckedSubscriptions);
4267
+ this.clearSubscriptions(this._itemListQuitFocusSubscriptions);
4268
+ (_a = this._itemListSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
4269
+ (_b = this._allItemListSubscription) === null || _b === void 0 ? void 0 : _b.unsubscribe();
4270
+ };
4271
+ TreeComponent.prototype.ngOnChanges = function (changes) {
4272
+ this.configureAllItems();
4273
+ };
4274
+ /**
4275
+ * Se sobrescribe el valor para actualizar los items
4276
+ * @Override
4277
+ */
4278
+ TreeComponent.prototype.writeValue = function (value) {
4279
+ this.value = value;
4280
+ this.configureAllItems(true);
4281
+ this.onChange(this.value);
4282
+ };
4283
+ /*
4284
+ * Eventos
4285
+ */
4286
+ /**
4287
+ * Actualiza el valor del componente al checkquearse un ítem
4288
+ * @param originItem ítem modificado
4289
+ */
4290
+ TreeComponent.prototype.updateValueFromItems = function (originItem) {
4291
+ var _this = this;
4292
+ // Si es radio, se desactivan el resto de items cuando se activa otro item
4293
+ if (this.type !== 'checkbox') {
4294
+ var items_1 = this.getAllItemsInOrder();
4295
+ items_1.forEach(function (item) {
4296
+ if (item !== originItem && item.checked) {
4297
+ item.setChecked(false, true);
4298
+ }
4299
+ });
4300
+ }
4301
+ else if (!this.decoupleChildFromParent) {
4302
+ this.rootItems.forEach(function (item) { return item.setCheckedAutomaticallyDependingOnChildren(); });
4303
+ }
4304
+ this.value = [];
4305
+ var items = this.getAllItemsInOrder();
4306
+ items.forEach(function (item) {
4307
+ if (item.checked) {
4308
+ _this.value.push(item.value);
4309
+ }
4310
+ });
4311
+ this.onChange(this.value);
4312
+ };
4313
+ /**
4314
+ * Gestiona cuando el foco abandona un ítem desde un evento de teclado controlado
4315
+ * @param options
4316
+ */
4317
+ TreeComponent.prototype.handleItemQuitFocus = function (options) {
4318
+ if (options && options.nextElement) {
4319
+ var items = this.getAllItemsInOrder();
4320
+ var focusableItems = items.filter(function (item) { return !item.isHidden() && !item.disabled && item.allParentsExpanded; });
4321
+ switch (options.nextElement) {
4322
+ case "first":
4323
+ focusableItems[0].focus();
4324
+ break;
4325
+ case "last":
4326
+ focusableItems[focusableItems.length - 1].focus();
4327
+ break;
4328
+ case "parent":
4329
+ var currentSubLevel_1 = options.currentItem.subLevel;
4330
+ if (currentSubLevel_1 > 0) {
4331
+ var currentItemIndex = focusableItems.findIndex(function (item) { return item === options.currentItem; });
4332
+ var parent = focusableItems.slice(0, currentItemIndex).reverse().find(function (item) { return item.subLevel < currentSubLevel_1; });
4333
+ if (parent) {
4334
+ parent.focus();
4335
+ }
4336
+ }
4337
+ break;
4338
+ case "firstChild":
4339
+ case "next":
4340
+ if (options.currentItem) {
4341
+ var currentItemIndex = focusableItems.findIndex(function (item) { return item === options.currentItem; });
4342
+ if (currentItemIndex < focusableItems.length - 1) {
4343
+ focusableItems[currentItemIndex + 1].focus();
4344
+ }
4345
+ }
4346
+ break;
4347
+ case "previous":
4348
+ if (options.currentItem) {
4349
+ var currentItemIndex = focusableItems.findIndex(function (item) { return item === options.currentItem; });
4350
+ if (currentItemIndex > 0) {
4351
+ focusableItems[currentItemIndex - 1].focus();
4352
+ }
4353
+ }
4354
+ break;
4355
+ }
4356
+ }
4357
+ };
4358
+ /**
4359
+ * Realiza la búsqueda interna de los items en el componente
4360
+ * @param value texto de búsqueda
4361
+ */
4362
+ TreeComponent.prototype.onSearch = function (value) {
4363
+ if (!this.disableDefaultSearch) {
4364
+ if (value && value.length > 0) {
4365
+ this.searchMatchValues = this.allItems.filter(function (item) { return item.matchesText(value); }).map(function (item) { return item.value; });
4366
+ }
4367
+ else {
4368
+ this.searchMatchValues = null;
4369
+ }
4370
+ this.searchMatchValuesChange.emit(this.searchMatchValues);
4371
+ }
4372
+ };
4373
+ /*
4374
+ * Eventos al cambiar propiedades
4375
+ */
4376
+ /**
4377
+ * Configura los items del árbol
4378
+ */
4379
+ TreeComponent.prototype.configureAllItems = function (isValueChange) {
4380
+ var _this = this;
4381
+ if (isValueChange === void 0) { isValueChange = false; }
4382
+ if (!this._alreadyConfiguringItems) {
4383
+ this._alreadyConfiguringItems = true;
4384
+ // Lo realizamos desde un setTimeout para que todos los inputs, values y demás vivan en paz y armonía
4385
+ setTimeout(function () {
4386
+ var _a;
4387
+ if (((_a = _this.allItems) === null || _a === void 0 ? void 0 : _a.length) > 0) {
4388
+ _this.clearSubscriptions(_this._itemListCheckedSubscriptions);
4389
+ _this.clearSubscriptions(_this._itemListQuitFocusSubscriptions);
4390
+ _this.allItems.forEach(function (item) {
4391
+ item.parentName = _this.name;
4392
+ item.type = _this.type;
4393
+ item.inheritedDescribedBy = _this.getDescribedByForItems();
4394
+ item.inheritedExpandedFirstLevel = _this.expandedFirstLevel;
4395
+ item.inheritedDecoupleChildFromParent = _this.decoupleChildFromParent;
4396
+ if ((_this.value && _this.value.length > 0) || isValueChange) {
4397
+ var valueList = _this.value ? _this.value : [];
4398
+ item.setChecked(!!valueList.find(function (v) { return v === item.value; }), true);
4399
+ }
4400
+ item.detectChanges();
4401
+ var checkedSubscription = item.checkedChangeForTree.subscribe(function () { return _this.updateValueFromItems(item); });
4402
+ _this._itemListCheckedSubscriptions.push(checkedSubscription);
4403
+ var quitFocusSubscription = item.quitFocus.subscribe(function (options) { return _this.handleItemQuitFocus(options); });
4404
+ _this._itemListQuitFocusSubscriptions.push(quitFocusSubscription);
4405
+ });
4406
+ _this.setErrorInItems(_this.hasErrorMessageComponent());
4407
+ _this.buildTree();
4408
+ if (!_this.value) {
4409
+ _this.updateValueFromItems();
4410
+ }
4411
+ if (_this.searchMatchValues) {
4412
+ _this.onSearchMatchValuesChange();
4413
+ }
4414
+ }
4415
+ if (_this.allItems && !_this._allItemListSubscription) {
4416
+ _this._allItemListSubscription = _this.allItems.changes.subscribe(function () { return _this.configureAllItems(); });
4417
+ }
4418
+ _this.changeDetector.detectChanges();
4419
+ _this._alreadyConfiguringItems = false;
4420
+ });
4421
+ }
4422
+ };
4423
+ /**
4424
+ * Modifica los items visibles según el filtro de búsqueda
4425
+ */
4426
+ TreeComponent.prototype.onSearchMatchValuesChange = function () {
4427
+ var _this = this;
4428
+ if (this.allItems) {
4429
+ this.allItems.forEach(function (item) {
4430
+ item.inheritedMatchesSearch = true;
4431
+ });
4432
+ if (this.searchMatchValues !== null && this.searchMatchValues !== undefined) {
4433
+ this.allItems.forEach(function (item) {
4434
+ if (_this.searchMatchValues.findIndex(function (value) { return item.value === value; }) < 0) {
4435
+ item.inheritedMatchesSearch = false;
4436
+ }
4437
+ });
4438
+ }
4439
+ }
4440
+ };
4441
+ /*
4442
+ * Getters and setters
4443
+ */
4444
+ TreeComponent.prototype.getIdPrefix = function () {
4445
+ return this.idPrefix ? this.idPrefix : this.name;
4446
+ };
4447
+ TreeComponent.prototype.getDescribedBy = function () {
4448
+ var describedBy = '';
4449
+ if (this.describedBy) {
4450
+ describedBy = this.describedBy;
4451
+ }
4452
+ if (this.hasHintComponent() && this.hintComponent.id) {
4453
+ describedBy = describedBy + ' ' + this.hintComponent.id;
4454
+ }
4455
+ if (this.hasErrorMessageComponent() && this.errorMessageComponent.id) {
4456
+ describedBy = describedBy + ' ' + this.errorMessageComponent.id;
4457
+ }
4458
+ return describedBy;
4459
+ };
4460
+ /**
4461
+ * Devuelve el valor de describedBy que se transmitirá a los items
4462
+ */
4463
+ TreeComponent.prototype.getDescribedByForItems = function () {
4464
+ var describedBy;
4465
+ if (this.hasFieldsetComponent()) {
4466
+ describedBy = this.fieldsetComponent.describedBy;
4467
+ }
4468
+ else {
4469
+ describedBy = this.getDescribedBy();
4470
+ }
4471
+ return describedBy;
4472
+ };
4473
+ TreeComponent.prototype.hasFieldsetComponent = function () {
4474
+ return !!this.fieldsetComponent;
4475
+ };
4476
+ /**
4477
+ * Overrides super.getHintId();
4478
+ */
4479
+ TreeComponent.prototype.getHintId = function () {
4480
+ var _a;
4481
+ return this.idPrefix ? this.idPrefix + '-hint' : (_a = this.hintComponent) === null || _a === void 0 ? void 0 : _a.id;
4482
+ };
4483
+ /**
4484
+ * Overrides super.getHintId();
4485
+ */
4486
+ TreeComponent.prototype.getErrorId = function () {
4487
+ var _a;
4488
+ return this.idPrefix ? this.idPrefix + '-error' : (_a = this.errorMessageComponent) === null || _a === void 0 ? void 0 : _a.id;
4489
+ };
4490
+ /*
4491
+ * Funciones para reemplazar el contenido del fieldset, label, hint o errormessage
4492
+ */
4493
+ TreeComponent.prototype.overrideFieldsetParams = function (fieldset) {
4494
+ fieldset.caller = this.innerHtml;
4495
+ fieldset.errorId = this.getErrorId();
4496
+ fieldset.describedBy = this.getDescribedBy();
4497
+ fieldset.detectChanges();
4498
+ };
4499
+ TreeComponent.prototype.overrideSearchBarParams = function (searchbar) {
4500
+ var _this = this;
4501
+ var defaultOnChange = searchbar.onChange;
4502
+ var newOnChange = function (value) {
4503
+ _this.onSearch(value);
4504
+ defaultOnChange(value);
4505
+ };
4506
+ searchbar.registerOnChange(newOnChange);
4507
+ };
4508
+ /**
4509
+ * Se llama desde FormField
4510
+ */
4511
+ TreeComponent.prototype.overrideHintParams = function (hint) {
4512
+ hint.id = this.getHintId();
4513
+ hint.detectChanges();
4514
+ };
4515
+ /**
4516
+ * Se llama desde FormField
4517
+ */
4518
+ TreeComponent.prototype.overrideErrorMessageParams = function (errorMessage) {
4519
+ errorMessage.id = this.getErrorId();
4520
+ this.setErrorInItems(this.hasErrorMessageComponent());
4521
+ errorMessage.detectChanges();
4522
+ };
4523
+ /**
4524
+ * Se llama desde FormField
4525
+ */
4526
+ TreeComponent.prototype.onDeleteErrorMessage = function (errorMessage) {
4527
+ this.setErrorInItems(this.hasErrorMessageComponent());
4528
+ };
4529
+ /*
4530
+ * Métodos privados
4531
+ */
4532
+ /**
4533
+ * Configura la estructura del árbol
4534
+ * @private
4535
+ */
4536
+ TreeComponent.prototype.buildTree = function () {
4537
+ var _this = this;
4538
+ // Se crea un mapa para tener accesibles los items por key y se borran los listados existentes
4539
+ var itemMap = {};
4540
+ this.rootItems = [];
4541
+ this.allItems.forEach(function (item) {
4542
+ var key = item.getKey();
4543
+ itemMap[key] = item;
4544
+ if (item.sub) {
4545
+ item.sub.itemList = [];
4546
+ }
4547
+ });
4548
+ // Se añaden los items a los listados correspondientes
4549
+ this.allItems.forEach(function (item) {
4550
+ var parentKey = item.getParentKey();
4551
+ if (parentKey === 'root') {
4552
+ _this.rootItems.push(item);
4553
+ }
4554
+ else if (parentKey) {
4555
+ var sub = itemMap[parentKey].sub;
4556
+ if (sub) {
4557
+ sub.itemList.push(item);
4558
+ }
4559
+ }
4560
+ });
4561
+ // Se configuran los items desde root
4562
+ var order = 0;
4563
+ this.rootItems.forEach(function (item, index) {
4564
+ item.setSubLevel(0);
4565
+ item.setDefaultId(_this.idPrefix + "-" + index);
4566
+ item.refreshAllParentsExpandedRecursive(true);
4567
+ if (!_this.decoupleChildFromParent) {
4568
+ item.setCheckedAutomaticallyDependingOnChildren();
4569
+ }
4570
+ order = item.setOrderRecursively(order);
4571
+ });
4572
+ };
4573
+ /**
4574
+ * Si tiene un mensaje de error, se indica a los items
4575
+ * @param hasError
4576
+ * @private
4577
+ */
4578
+ TreeComponent.prototype.setErrorInItems = function (hasError) {
4579
+ var _a;
4580
+ if (((_a = this.allItems) === null || _a === void 0 ? void 0 : _a.length) > 0) {
4581
+ this.allItems.forEach(function (item) {
4582
+ item.inheritedHasError = hasError;
4583
+ item.detectChanges();
4584
+ });
4585
+ }
4586
+ };
4587
+ /**
4588
+ * Limpia un listado de subscripciones
4589
+ * @param subscriptionList
4590
+ * @private
4591
+ */
4592
+ TreeComponent.prototype.clearSubscriptions = function (subscriptionList) {
4593
+ if (subscriptionList.length > 0) {
4594
+ subscriptionList.forEach(function (s) { return s.unsubscribe(); });
4595
+ subscriptionList.splice(0, subscriptionList.length);
4596
+ }
4597
+ };
4598
+ /**
4599
+ * Devuelve los items del árbol ordenados
4600
+ * @private
4601
+ */
4602
+ TreeComponent.prototype.getAllItemsInOrder = function () {
4603
+ var list = [];
4604
+ if (this.allItems) {
4605
+ list = this.allItems.toArray().sort(function (a, b) { return a.orderInTree > b.orderInTree ? 1 : -1; });
4606
+ }
4607
+ return list;
4608
+ };
4609
+ return TreeComponent;
4610
+ }(FormFieldComponent));
4611
+ TreeComponent.decorators = [
4612
+ { type: i0.Component, args: [{
4613
+ selector: 'desy-tree',
4614
+ 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",
4615
+ providers: [
4616
+ {
4617
+ provide: forms.NG_VALUE_ACCESSOR,
4618
+ useExisting: i0.forwardRef(function () { return TreeComponent; }),
4619
+ multi: true
4620
+ }
4621
+ ]
4622
+ },] }
4623
+ ];
4624
+ TreeComponent.ctorParameters = function () { return [
4625
+ { type: i0.ChangeDetectorRef }
4626
+ ]; };
4627
+ TreeComponent.propDecorators = {
4628
+ idPrefix: [{ type: i0.Input }],
4629
+ classes: [{ type: i0.Input }],
4630
+ formGroupClasses: [{ type: i0.Input }],
4631
+ name: [{ type: i0.Input }],
4632
+ type: [{ type: i0.Input }],
4633
+ describedBy: [{ type: i0.Input }],
4634
+ expandedFirstLevel: [{ type: i0.Input }],
4635
+ decoupleChildFromParent: [{ type: i0.Input }],
4636
+ disableDefaultSearch: [{ type: i0.Input }],
4637
+ searchMatchValues: [{ type: i0.Input }],
4638
+ searchMatchValuesChange: [{ type: i0.Output }],
4639
+ allItems: [{ type: i0.ContentChildren, args: [TreeItemComponent, { descendants: true },] }],
4640
+ fieldsetComponent: [{ type: i0.ContentChildren, args: [FieldsetComponent,] }],
4641
+ searchBarComponent: [{ type: i0.ContentChildren, args: [SearchBarComponent,] }],
4642
+ innerHtml: [{ type: i0.ViewChild, args: ['innerHtml', { static: true },] }]
4643
+ };
4644
+ __decorate([
4645
+ DesyOnInputChange('onSearchMatchValuesChange')
4646
+ ], TreeComponent.prototype, "searchMatchValues", void 0);
4647
+ __decorate([
4648
+ DesyOnInputChange('configureAllItems')
4649
+ ], TreeComponent.prototype, "allItems", void 0);
4650
+ __decorate([
4651
+ DesyContentChild({ onSetCallbackName: 'overrideFieldsetParams' })
4652
+ ], TreeComponent.prototype, "fieldsetComponent", void 0);
4653
+ __decorate([
4654
+ DesyContentChild({ onSetCallbackName: 'overrideSearchBarParams' })
4655
+ ], TreeComponent.prototype, "searchBarComponent", void 0);
4656
+
3641
4657
  var ConditionDirective = /** @class */ (function () {
3642
4658
  function ConditionDirective(templateRef) {
3643
4659
  this.templateRef = templateRef;
@@ -3684,6 +4700,31 @@
3684
4700
  items: [{ type: i0.Input }]
3685
4701
  };
3686
4702
 
4703
+ var TreeItemsGeneratorComponent = /** @class */ (function () {
4704
+ function TreeItemsGeneratorComponent(viewContainerRef) {
4705
+ this.viewContainerRef = viewContainerRef;
4706
+ }
4707
+ TreeItemsGeneratorComponent.prototype.ngOnInit = function () {
4708
+ this.viewContainerRef.createEmbeddedView(this.content);
4709
+ };
4710
+ return TreeItemsGeneratorComponent;
4711
+ }());
4712
+ TreeItemsGeneratorComponent.decorators = [
4713
+ { type: i0.Component, args: [{
4714
+ selector: 'desy-tree-items-generator',
4715
+ 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",
4716
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
4717
+ },] }
4718
+ ];
4719
+ TreeItemsGeneratorComponent.ctorParameters = function () { return [
4720
+ { type: i0.ViewContainerRef }
4721
+ ]; };
4722
+ TreeItemsGeneratorComponent.propDecorators = {
4723
+ content: [{ type: i0.ViewChild, args: ['content', { static: true },] }],
4724
+ items: [{ type: i0.Input }],
4725
+ itemTemplate: [{ type: i0.Input }]
4726
+ };
4727
+
3687
4728
  var ModalButtonPrimaryComponent = /** @class */ (function (_super) {
3688
4729
  __extends(ModalButtonPrimaryComponent, _super);
3689
4730
  function ModalButtonPrimaryComponent() {
@@ -4252,6 +5293,8 @@
4252
5293
  if (this.isOpen()) {
4253
5294
  this.dialogService.closeDialog(this.dialog);
4254
5295
  this.dialog = null;
5296
+ var elementToFocus = document.getElementById('header-offcanvas-button');
5297
+ elementToFocus === null || elementToFocus === void 0 ? void 0 : elementToFocus.focus();
4255
5298
  }
4256
5299
  };
4257
5300
  HeaderOffcanvasComponent.prototype.isOpen = function () {
@@ -4277,14 +5320,15 @@
4277
5320
  }());
4278
5321
  HeaderOffcanvasComponent.dialogOptions = {
4279
5322
  id: 'header-offcanvas-dialog',
4280
- focusOnClose: 'header-offcanvas',
5323
+ focusOnClose: 'header-offcanvas-button',
4281
5324
  ariaModal: 'true',
4282
- ariaLabelledBy: 'header-offcanvas-button-text'
5325
+ ariaLabelledBy: 'header-offcanvas-button-text',
5326
+ role: 'dialog'
4283
5327
  };
4284
5328
  HeaderOffcanvasComponent.decorators = [
4285
5329
  { type: i0.Component, args: [{
4286
5330
  selector: 'desy-header-offcanvas',
4287
- 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"
5331
+ 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"
4288
5332
  },] }
4289
5333
  ];
4290
5334
  HeaderOffcanvasComponent.ctorParameters = function () { return [
@@ -4466,12 +5510,48 @@
4466
5510
  NavComponent.prototype.getIdPrefix = function () {
4467
5511
  return this.idPrefix ? this.idPrefix : 'nav-item';
4468
5512
  };
5513
+ NavComponent.prototype.movePrevious = function (event, currentIndex) {
5514
+ event.preventDefault();
5515
+ var items = this.getItemList();
5516
+ var nextIndex = currentIndex - 1;
5517
+ while (nextIndex >= 0 && !this.isFocusableItem(items[nextIndex])) {
5518
+ nextIndex--;
5519
+ }
5520
+ if (nextIndex < items.length) {
5521
+ var itemElem = document.getElementById(this.getItemId(items[nextIndex], nextIndex));
5522
+ if (itemElem) {
5523
+ itemElem.focus();
5524
+ }
5525
+ }
5526
+ };
5527
+ NavComponent.prototype.moveNext = function (event, currentIndex) {
5528
+ event.preventDefault();
5529
+ var items = this.getItemList();
5530
+ var nextIndex = currentIndex + 1;
5531
+ while (nextIndex < items.length && !this.isFocusableItem(items[nextIndex])) {
5532
+ nextIndex++;
5533
+ }
5534
+ if (nextIndex < items.length) {
5535
+ var itemElem = document.getElementById(this.getItemId(items[nextIndex], nextIndex));
5536
+ if (itemElem) {
5537
+ itemElem.focus();
5538
+ }
5539
+ }
5540
+ };
5541
+ NavComponent.prototype.simulateClick = function (event, item, index) {
5542
+ event.preventDefault();
5543
+ var element = document.getElementById(this.getItemId(item, index));
5544
+ element === null || element === void 0 ? void 0 : element.click();
5545
+ };
5546
+ NavComponent.prototype.isFocusableItem = function (item) {
5547
+ return !item.active && !item.disabled;
5548
+ };
4469
5549
  return NavComponent;
4470
5550
  }(AccessibilityComponent));
4471
5551
  NavComponent.decorators = [
4472
5552
  { type: i0.Component, args: [{
4473
5553
  selector: 'desy-nav',
4474
- 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"
5554
+ 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"
4475
5555
  },] }
4476
5556
  ];
4477
5557
  NavComponent.propDecorators = {
@@ -4506,7 +5586,7 @@
4506
5586
  HeaderSubnavComponent.decorators = [
4507
5587
  { type: i0.Component, args: [{
4508
5588
  selector: 'desy-header-subnav',
4509
- 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"
5589
+ 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"
4510
5590
  },] }
4511
5591
  ];
4512
5592
  HeaderSubnavComponent.propDecorators = {
@@ -4540,7 +5620,7 @@
4540
5620
  HeaderDropdownComponent.decorators = [
4541
5621
  { type: i0.Component, args: [{
4542
5622
  selector: 'desy-header-dropdown',
4543
- 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"
5623
+ 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"
4544
5624
  },] }
4545
5625
  ];
4546
5626
  HeaderDropdownComponent.propDecorators = {
@@ -4548,11 +5628,15 @@
4548
5628
  classesContainer: [{ type: i0.Input }],
4549
5629
  classesTooltip: [{ type: i0.Input }],
4550
5630
  classes: [{ type: i0.Input }],
4551
- nav: [{ type: i0.ContentChildren, args: [NavComponent,] }]
5631
+ nav: [{ type: i0.ContentChildren, args: [NavComponent,] }],
5632
+ contentComponent: [{ type: i0.ContentChildren, args: [ContentComponent,] }]
4552
5633
  };
4553
5634
  __decorate([
4554
5635
  DesyContentChild({ onSetCallbackName: 'overrideNavParams' })
4555
- ], HeaderDropdownComponent.prototype, "nav", void 0);
5636
+ ], HeaderDropdownComponent.prototype, "nav", void 0);
5637
+ __decorate([
5638
+ DesyContentChild()
5639
+ ], HeaderDropdownComponent.prototype, "contentComponent", void 0);
4556
5640
 
4557
5641
  var SkipLinkComponent = /** @class */ (function (_super) {
4558
5642
  __extends(SkipLinkComponent, _super);
@@ -5051,7 +6135,7 @@
5051
6135
  else {
5052
6136
  var idPrefix = this.idPrefix ? this.idPrefix : 'nav-item';
5053
6137
  if (i === 0) {
5054
- return idPrefix;
6138
+ return idPrefix + '-0';
5055
6139
  }
5056
6140
  else {
5057
6141
  return idPrefix + '-' + i;
@@ -6171,67 +7255,6 @@
6171
7255
  DesyContentChild()
6172
7256
  ], TableComponent.prototype, "headerComponent", void 0);
6173
7257
 
6174
- var SearchUtils = /** @class */ (function () {
6175
- function SearchUtils() {
6176
- }
6177
- /**
6178
- * Comprueba si una cadena de texto (target) contiene cualquier palabra de otro texto (text)
6179
- * @param target - Texto en el que buscar
6180
- * @param text - Texto a buscar
6181
- * @param fullWord - Indica si las palabras del texto a buscar deben aparecer enteras
6182
- */
6183
- SearchUtils.containsAnyWordFrom = function (target, text, fullWord) {
6184
- var _this = this;
6185
- var words = [];
6186
- var includes = false;
6187
- var simplifiedTarget = this.getSimplifiedString(target);
6188
- if (text && text.split(' ').length > 1) {
6189
- words = text.split(' ');
6190
- }
6191
- words.push(text);
6192
- words.forEach(function (word) {
6193
- if (simplifiedTarget && word) {
6194
- if ((fullWord && simplifiedTarget === _this.getSimplifiedString(word))
6195
- || (!fullWord && simplifiedTarget.includes(_this.getSimplifiedString(word)))) {
6196
- includes = true;
6197
- }
6198
- }
6199
- });
6200
- return includes;
6201
- };
6202
- /**
6203
- * Convierte a mayúsculas, elimina espacios y reemplaza/elimina caracteres especiales para realizar comparaciones más tolerantes
6204
- * @param str - cadena de entrada
6205
- */
6206
- SearchUtils.getSimplifiedString = function (str) {
6207
- var res = str;
6208
- if (str) {
6209
- res = str.toLocaleUpperCase().trim();
6210
- res = res.replace('Á', 'A');
6211
- res = res.replace('É', 'E');
6212
- res = res.replace('Í', 'I');
6213
- res = res.replace('Ó', 'O');
6214
- res = res.replace('Ú', 'U');
6215
- res = res.replace('À', 'A');
6216
- res = res.replace('È', 'E');
6217
- res = res.replace('Ì', 'I');
6218
- res = res.replace('Ò', 'O');
6219
- res = res.replace('Ù', 'U');
6220
- res = res.replace('Ä', 'A');
6221
- res = res.replace('Ë', 'E');
6222
- res = res.replace('Ï', 'I');
6223
- res = res.replace('Ö', 'O');
6224
- res = res.replace('Ü', 'U');
6225
- res = res.replace(',', '');
6226
- res = res.replace('.', '');
6227
- res = res.replace('\'', '');
6228
- res = res.replace('"', '');
6229
- }
6230
- return res;
6231
- };
6232
- return SearchUtils;
6233
- }());
6234
-
6235
7258
  exports.OrderBy = void 0;
6236
7259
  (function (OrderBy) {
6237
7260
  OrderBy["none"] = "none";
@@ -7734,7 +8757,7 @@
7734
8757
  PaginationComponent.decorators = [
7735
8758
  { type: i0.Component, args: [{
7736
8759
  selector: 'desy-pagination',
7737
- 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"
8760
+ 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"
7738
8761
  },] }
7739
8762
  ];
7740
8763
  PaginationComponent.propDecorators = {
@@ -8238,6 +9261,11 @@
8238
9261
  DateInputDayComponent,
8239
9262
  DateInputMonthComponent,
8240
9263
  DateInputYearComponent,
9264
+ TreeComponent,
9265
+ TreeSubComponent,
9266
+ TreeItemComponent,
9267
+ TreeCheckboxComponent,
9268
+ TreeItemsGeneratorComponent,
8241
9269
  ConditionDirective,
8242
9270
  ],
8243
9271
  imports: [
@@ -8274,6 +9302,10 @@
8274
9302
  DateInputDayComponent,
8275
9303
  DateInputMonthComponent,
8276
9304
  DateInputYearComponent,
9305
+ TreeComponent,
9306
+ TreeSubComponent,
9307
+ TreeItemComponent,
9308
+ TreeItemsGeneratorComponent,
8277
9309
  ConditionDirective
8278
9310
  ]
8279
9311
  },] }
@@ -8475,6 +9507,80 @@
8475
9507
  },] }
8476
9508
  ];
8477
9509
 
9510
+ var ToggleOffStateComponent = /** @class */ (function (_super) {
9511
+ __extends(ToggleOffStateComponent, _super);
9512
+ function ToggleOffStateComponent() {
9513
+ return _super !== null && _super.apply(this, arguments) || this;
9514
+ }
9515
+ return ToggleOffStateComponent;
9516
+ }(AccessibilityComponent));
9517
+ ToggleOffStateComponent.decorators = [
9518
+ { type: i0.Component, args: [{
9519
+ selector: 'desy-toggle-off-state',
9520
+ template: "<ng-template #contentTemplateOffState>\r\n <ng-content></ng-content>\r\n</ng-template>"
9521
+ },] }
9522
+ ];
9523
+ ToggleOffStateComponent.propDecorators = {
9524
+ content: [{ type: i0.ViewChild, args: ['contentTemplateOffState', { static: true },] }],
9525
+ classes: [{ type: i0.Input }]
9526
+ };
9527
+
9528
+ var ToggleOnStateComponent = /** @class */ (function (_super) {
9529
+ __extends(ToggleOnStateComponent, _super);
9530
+ function ToggleOnStateComponent() {
9531
+ return _super !== null && _super.apply(this, arguments) || this;
9532
+ }
9533
+ return ToggleOnStateComponent;
9534
+ }(AccessibilityComponent));
9535
+ ToggleOnStateComponent.decorators = [
9536
+ { type: i0.Component, args: [{
9537
+ selector: 'desy-toggle-on-state',
9538
+ template: "<ng-template #contentTemplateOnState>\r\n <ng-content></ng-content>\r\n</ng-template>"
9539
+ },] }
9540
+ ];
9541
+ ToggleOnStateComponent.propDecorators = {
9542
+ content: [{ type: i0.ViewChild, args: ['contentTemplateOnState', { static: true },] }],
9543
+ classes: [{ type: i0.Input }]
9544
+ };
9545
+
9546
+ var ToggleComponent = /** @class */ (function (_super) {
9547
+ __extends(ToggleComponent, _super);
9548
+ function ToggleComponent() {
9549
+ var _this = _super.apply(this, __spread(arguments)) || this;
9550
+ _this.clickEvent = new i0.EventEmitter();
9551
+ _this.pressedChange = new i0.EventEmitter();
9552
+ return _this;
9553
+ }
9554
+ ToggleComponent.prototype.onClick = function (event) {
9555
+ this.pressed = !this.pressed;
9556
+ this.pressedChange.emit(this.pressed);
9557
+ this.clickEvent.emit(event);
9558
+ };
9559
+ return ToggleComponent;
9560
+ }(AccessibilityComponent));
9561
+ ToggleComponent.decorators = [
9562
+ { type: i0.Component, args: [{
9563
+ selector: 'desy-toggle',
9564
+ 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 -->"
9565
+ },] }
9566
+ ];
9567
+ ToggleComponent.propDecorators = {
9568
+ id: [{ type: i0.Input }],
9569
+ isSwitch: [{ type: i0.Input }],
9570
+ pressed: [{ type: i0.Input }],
9571
+ classes: [{ type: i0.Input }],
9572
+ clickEvent: [{ type: i0.Output }],
9573
+ pressedChange: [{ type: i0.Output }],
9574
+ contentTemplateOnState: [{ type: i0.ContentChildren, args: [ToggleOnStateComponent,] }],
9575
+ contentTemplateOffState: [{ type: i0.ContentChildren, args: [ToggleOffStateComponent,] }]
9576
+ };
9577
+ __decorate([
9578
+ DesyContentChild()
9579
+ ], ToggleComponent.prototype, "contentTemplateOnState", void 0);
9580
+ __decorate([
9581
+ DesyContentChild()
9582
+ ], ToggleComponent.prototype, "contentTemplateOffState", void 0);
9583
+
8478
9584
  var DesyButtonsModule = /** @class */ (function () {
8479
9585
  function DesyButtonsModule() {
8480
9586
  }
@@ -8489,7 +9595,10 @@
8489
9595
  ListboxComponent,
8490
9596
  PillComponent,
8491
9597
  ListboxItemComponent,
8492
- ListboxLabelComponent
9598
+ ListboxLabelComponent,
9599
+ ToggleComponent,
9600
+ ToggleOnStateComponent,
9601
+ ToggleOffStateComponent
8493
9602
  ],
8494
9603
  imports: [
8495
9604
  common.CommonModule,
@@ -8504,7 +9613,10 @@
8504
9613
  ListboxComponent,
8505
9614
  PillComponent,
8506
9615
  ListboxItemComponent,
8507
- ListboxLabelComponent
9616
+ ListboxLabelComponent,
9617
+ ToggleComponent,
9618
+ ToggleOnStateComponent,
9619
+ ToggleOffStateComponent
8508
9620
  ]
8509
9621
  },] }
8510
9622
  ];
@@ -8932,17 +10044,26 @@
8932
10044
  exports.TextareaComponent = TextareaComponent;
8933
10045
  exports.TitleComponent = TitleComponent;
8934
10046
  exports.TooltipContentComponent = TooltipContentComponent;
10047
+ exports.TreeComponent = TreeComponent;
10048
+ exports.TreeItemComponent = TreeItemComponent;
10049
+ exports.TreeItemsGeneratorComponent = TreeItemsGeneratorComponent;
10050
+ exports.TreeSubComponent = TreeSubComponent;
8935
10051
  exports.summaryTextOrSummaryHtmlRequiredFunction = summaryTextOrSummaryHtmlRequiredFunction;
8936
10052
  exports.ɵa = AccessibilityComponent;
8937
10053
  exports.ɵb = AccessibilityAndContentRequiredComponent;
8938
- exports.ɵba = CustomInnerContentDirective;
8939
- exports.ɵbb = TooltipComponent;
8940
- exports.ɵbc = TemplateDrivenWrapperComponent;
8941
- exports.ɵbd = DateInputDividerComponent;
8942
- exports.ɵbe = DateInputDayComponent;
8943
- exports.ɵbf = DateInputMonthComponent;
8944
- exports.ɵbg = DateInputYearComponent;
8945
- exports.ɵbh = FocusClickedCellDirective;
10054
+ exports.ɵba = AttributeChangeDirective;
10055
+ exports.ɵbb = InnerContentDirective;
10056
+ exports.ɵbc = ClickOutsideDirective;
10057
+ exports.ɵbd = ContentChangeDirective;
10058
+ exports.ɵbe = ContentEmptyDirective;
10059
+ exports.ɵbf = CustomInnerContentDirective;
10060
+ exports.ɵbg = TooltipComponent;
10061
+ exports.ɵbh = TemplateDrivenWrapperComponent;
10062
+ exports.ɵbi = DateInputDividerComponent;
10063
+ exports.ɵbj = DateInputDayComponent;
10064
+ exports.ɵbk = DateInputMonthComponent;
10065
+ exports.ɵbl = DateInputYearComponent;
10066
+ exports.ɵbm = FocusClickedCellDirective;
8946
10067
  exports.ɵc = AccessibilityAndTextOrHtmlRequiredComponent;
8947
10068
  exports.ɵd = DesyContentChild;
8948
10069
  exports.ɵe = ContentBaseComponent;
@@ -8951,22 +10072,22 @@
8951
10072
  exports.ɵh = DesyOnInputChange;
8952
10073
  exports.ɵi = InputGroupItemComponent;
8953
10074
  exports.ɵj = DateInputItemComponent;
8954
- exports.ɵk = HeaderNavigationItemComponent;
8955
- exports.ɵl = MenubaritemDirective;
8956
- exports.ɵm = RowDirective;
8957
- exports.ɵn = CellDirective;
8958
- exports.ɵo = TabItemComponent;
8959
- exports.ɵp = PanelComponent;
8960
- exports.ɵq = SharedModule;
8961
- exports.ɵr = TextOrHtmlRequiredComponent;
8962
- exports.ɵs = InnerHtmlPipe;
8963
- exports.ɵt = MakeHtmlListPipe;
8964
- exports.ɵu = ExternalHrefPipe;
8965
- exports.ɵv = AttributeChangeDirective;
8966
- exports.ɵw = InnerContentDirective;
8967
- exports.ɵx = ClickOutsideDirective;
8968
- exports.ɵy = ContentChangeDirective;
8969
- exports.ɵz = ContentEmptyDirective;
10075
+ exports.ɵk = ITreeItem;
10076
+ exports.ɵl = TreeCheckboxComponent;
10077
+ exports.ɵm = HeaderNavigationItemComponent;
10078
+ exports.ɵn = MenubaritemDirective;
10079
+ exports.ɵo = RowDirective;
10080
+ exports.ɵp = CellDirective;
10081
+ exports.ɵq = TabItemComponent;
10082
+ exports.ɵr = PanelComponent;
10083
+ exports.ɵs = ToggleComponent;
10084
+ exports.ɵt = ToggleOnStateComponent;
10085
+ exports.ɵu = ToggleOffStateComponent;
10086
+ exports.ɵv = SharedModule;
10087
+ exports.ɵw = TextOrHtmlRequiredComponent;
10088
+ exports.ɵx = InnerHtmlPipe;
10089
+ exports.ɵy = MakeHtmlListPipe;
10090
+ exports.ɵz = ExternalHrefPipe;
8970
10091
 
8971
10092
  Object.defineProperty(exports, '__esModule', { value: true });
8972
10093