desy-angular 5.0.2 → 5.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/desy-angular.umd.js +1204 -97
- package/bundles/desy-angular.umd.js.map +1 -1
- package/bundles/desy-angular.umd.min.js +2 -2
- package/bundles/desy-angular.umd.min.js.map +1 -1
- package/desy-angular.d.ts +29 -24
- package/desy-angular.metadata.json +1 -1
- package/esm2015/desy-angular.js +30 -25
- package/esm2015/lib/desy-buttons/components/toggle/toggle-off-state/toggle-off-state.component.js +15 -0
- package/esm2015/lib/desy-buttons/components/toggle/toggle-on-state/toggle-on-state.component.js +15 -0
- package/esm2015/lib/desy-buttons/components/toggle/toggle.component.js +41 -0
- package/esm2015/lib/desy-buttons/desy-buttons.module.js +12 -3
- package/esm2015/lib/desy-forms/components/tree/interfaces/itree-item.js +3 -0
- package/esm2015/lib/desy-forms/components/tree/interfaces/quit-tree-item-focus-options.js +2 -0
- package/esm2015/lib/desy-forms/components/tree/tree-checkbox/tree-checkbox.component.js +151 -0
- package/esm2015/lib/desy-forms/components/tree/tree-item/tree-item.component.js +365 -0
- package/esm2015/lib/desy-forms/components/tree/tree-items-generator/tree-items-generator.component.js +25 -0
- package/esm2015/lib/desy-forms/components/tree/tree-sub/tree-sub.component.js +14 -0
- package/esm2015/lib/desy-forms/components/tree/tree.component.js +396 -0
- package/esm2015/lib/desy-forms/desy-forms.module.js +15 -1
- package/esm2015/lib/desy-nav/components/header/header-dropdown/header-dropdown.component.js +8 -3
- package/esm2015/lib/desy-nav/components/header/header-offcanvas/header-offcanvas.component.js +7 -4
- package/esm2015/lib/desy-nav/components/header/header-subnav/header-subnav.component.js +2 -2
- package/esm2015/lib/desy-nav/components/menu-vertical/menu-vertical.component.js +12 -3
- package/esm2015/lib/desy-nav/components/nav/nav.component.js +33 -2
- package/esm2015/public-api.js +5 -1
- package/fesm2015/desy-angular.js +1120 -71
- package/fesm2015/desy-angular.js.map +1 -1
- package/lib/desy-buttons/components/toggle/toggle-off-state/toggle-off-state.component.d.ts +5 -0
- package/lib/desy-buttons/components/toggle/toggle-on-state/toggle-on-state.component.d.ts +5 -0
- package/lib/desy-buttons/components/toggle/toggle.component.d.ts +15 -0
- package/lib/desy-forms/components/tree/interfaces/itree-item.d.ts +5 -0
- package/lib/desy-forms/components/tree/interfaces/quit-tree-item-focus-options.d.ts +5 -0
- package/lib/desy-forms/components/tree/tree-checkbox/tree-checkbox.component.d.ts +43 -0
- package/lib/desy-forms/components/tree/tree-item/tree-item.component.d.ts +85 -0
- package/lib/desy-forms/components/tree/tree-items-generator/tree-items-generator.component.d.ts +10 -0
- package/lib/desy-forms/components/tree/tree-sub/tree-sub.component.d.ts +6 -0
- package/lib/desy-forms/components/tree/tree.component.d.ts +107 -0
- package/lib/desy-nav/components/header/header-dropdown/header-dropdown.component.d.ts +2 -0
- package/lib/desy-nav/components/menu-vertical/menu-vertical.component.d.ts +1 -0
- package/lib/desy-nav/components/nav/nav.component.d.ts +3 -0
- package/package.json +2 -2
- package/public-api.d.ts +4 -0
|
@@ -3638,6 +3638,1004 @@
|
|
|
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
|
+
return _this;
|
|
3899
|
+
}
|
|
3900
|
+
TreeItemComponent.prototype.ngOnChanges = function (changes) {
|
|
3901
|
+
var _this = this;
|
|
3902
|
+
if (this.sub && this.sub.itemList) {
|
|
3903
|
+
this.sub.itemList.forEach(function (item) { return item.refreshAllParentsExpandedRecursive(_this.allParentsExpanded && _this.expanded); });
|
|
3904
|
+
}
|
|
3905
|
+
for (var propName in changes) {
|
|
3906
|
+
if (changes.hasOwnProperty(propName)) {
|
|
3907
|
+
switch (propName) {
|
|
3908
|
+
case 'checked': {
|
|
3909
|
+
// Reasignamos el valor de checked cuando detectamos el cambio en la entrada
|
|
3910
|
+
setTimeout(function () {
|
|
3911
|
+
_this.setChecked(_this.checked, false, false);
|
|
3912
|
+
if (_this.inheritedExpandedFirstLevel && _this.checked && !_this.expanded) {
|
|
3913
|
+
_this.expandSub(true);
|
|
3914
|
+
}
|
|
3915
|
+
});
|
|
3916
|
+
break;
|
|
3917
|
+
}
|
|
3918
|
+
}
|
|
3919
|
+
}
|
|
3920
|
+
}
|
|
3921
|
+
};
|
|
3922
|
+
/*
|
|
3923
|
+
* Métodos expuestos que permiten configurar al ítem de forma externa
|
|
3924
|
+
*/
|
|
3925
|
+
TreeItemComponent.prototype.focus = function () {
|
|
3926
|
+
var _a;
|
|
3927
|
+
(_a = this.checkbox) === null || _a === void 0 ? void 0 : _a.focus();
|
|
3928
|
+
this.handleItemFocus(true);
|
|
3929
|
+
};
|
|
3930
|
+
TreeItemComponent.prototype.setCheckedAutomaticallyDependingOnChildren = function () {
|
|
3931
|
+
if (this.sub) {
|
|
3932
|
+
this.sub.itemList.forEach(function (item) { return item.setCheckedAutomaticallyDependingOnChildren(); });
|
|
3933
|
+
if (this.areAllChildrenChecked()) {
|
|
3934
|
+
if (this.indeterminateChecked) {
|
|
3935
|
+
this.setIndeterminateChecked(false);
|
|
3936
|
+
}
|
|
3937
|
+
if (!this.checked) {
|
|
3938
|
+
this.setChecked(true, true);
|
|
3939
|
+
}
|
|
3940
|
+
}
|
|
3941
|
+
else if (this.hasChildrenCheckedOrIndeterminate()) {
|
|
3942
|
+
if (!this.indeterminateChecked) {
|
|
3943
|
+
this.setIndeterminateChecked(true);
|
|
3944
|
+
}
|
|
3945
|
+
if (this.checked) {
|
|
3946
|
+
this.setChecked(false, true);
|
|
3947
|
+
}
|
|
3948
|
+
}
|
|
3949
|
+
else {
|
|
3950
|
+
if (this.indeterminateChecked) {
|
|
3951
|
+
this.setIndeterminateChecked(false);
|
|
3952
|
+
}
|
|
3953
|
+
if (this.checked) {
|
|
3954
|
+
this.setChecked(false, true);
|
|
3955
|
+
}
|
|
3956
|
+
}
|
|
3957
|
+
}
|
|
3958
|
+
};
|
|
3959
|
+
TreeItemComponent.prototype.refreshAllParentsExpandedRecursive = function (value) {
|
|
3960
|
+
var _this = this;
|
|
3961
|
+
this.allParentsExpanded = value;
|
|
3962
|
+
if (this.sub) {
|
|
3963
|
+
this.sub.itemList.forEach(function (item) { return item.refreshAllParentsExpandedRecursive(value && _this.expanded); });
|
|
3964
|
+
}
|
|
3965
|
+
};
|
|
3966
|
+
TreeItemComponent.prototype.detectChanges = function () {
|
|
3967
|
+
this.changeDetector.detectChanges();
|
|
3968
|
+
};
|
|
3969
|
+
TreeItemComponent.prototype.expandSub = function (value) {
|
|
3970
|
+
var _this = this;
|
|
3971
|
+
this.expanded = value;
|
|
3972
|
+
if (this.sub) {
|
|
3973
|
+
this.sub.itemList.forEach(function (item) { return item.refreshAllParentsExpandedRecursive(_this.allParentsExpanded && value); });
|
|
3974
|
+
}
|
|
3975
|
+
this.expandedChange.emit(value);
|
|
3976
|
+
};
|
|
3977
|
+
/*
|
|
3978
|
+
* Gestion de eventos
|
|
3979
|
+
*/
|
|
3980
|
+
TreeItemComponent.prototype.handleCheckboxChange = function (checked) {
|
|
3981
|
+
this.setChecked(checked, false);
|
|
3982
|
+
if (this.inheritedExpandedFirstLevel && checked && !this.expanded) {
|
|
3983
|
+
this.expandSub(true);
|
|
3984
|
+
}
|
|
3985
|
+
};
|
|
3986
|
+
TreeItemComponent.prototype.handleIndeterminateCheckedChange = function (indeterminate) {
|
|
3987
|
+
this.indeterminateCheckedChange.emit(indeterminate);
|
|
3988
|
+
};
|
|
3989
|
+
TreeItemComponent.prototype.handleItemFocus = function (value, condition) {
|
|
3990
|
+
if (condition === void 0) { condition = true; }
|
|
3991
|
+
if (condition) {
|
|
3992
|
+
this.isFocus = value;
|
|
3993
|
+
}
|
|
3994
|
+
};
|
|
3995
|
+
TreeItemComponent.prototype.handleItemHover = function (value, condition) {
|
|
3996
|
+
if (condition === void 0) { condition = true; }
|
|
3997
|
+
if (condition) {
|
|
3998
|
+
this.isHover = value;
|
|
3999
|
+
}
|
|
4000
|
+
};
|
|
4001
|
+
TreeItemComponent.prototype.handleArrowUp = function (event, condition) {
|
|
4002
|
+
if (condition === void 0) { condition = true; }
|
|
4003
|
+
if (condition) {
|
|
4004
|
+
event.preventDefault();
|
|
4005
|
+
this.quitFocus.emit({
|
|
4006
|
+
nextElement: 'previous',
|
|
4007
|
+
currentItem: this
|
|
4008
|
+
});
|
|
4009
|
+
}
|
|
4010
|
+
};
|
|
4011
|
+
TreeItemComponent.prototype.handleHome = function (event, condition) {
|
|
4012
|
+
if (condition === void 0) { condition = true; }
|
|
4013
|
+
if (condition) {
|
|
4014
|
+
event.preventDefault();
|
|
4015
|
+
this.quitFocus.emit({
|
|
4016
|
+
nextElement: 'first',
|
|
4017
|
+
currentItem: this
|
|
4018
|
+
});
|
|
4019
|
+
}
|
|
4020
|
+
};
|
|
4021
|
+
TreeItemComponent.prototype.handleEnd = function (event, condition) {
|
|
4022
|
+
if (condition === void 0) { condition = true; }
|
|
4023
|
+
if (condition) {
|
|
4024
|
+
event.preventDefault();
|
|
4025
|
+
this.quitFocus.emit({
|
|
4026
|
+
nextElement: 'last',
|
|
4027
|
+
currentItem: this
|
|
4028
|
+
});
|
|
4029
|
+
}
|
|
4030
|
+
};
|
|
4031
|
+
TreeItemComponent.prototype.handleArrowDown = function (event, condition) {
|
|
4032
|
+
if (condition === void 0) { condition = true; }
|
|
4033
|
+
if (condition) {
|
|
4034
|
+
event.preventDefault();
|
|
4035
|
+
this.quitFocus.emit({
|
|
4036
|
+
nextElement: 'next',
|
|
4037
|
+
currentItem: this
|
|
4038
|
+
});
|
|
4039
|
+
}
|
|
4040
|
+
};
|
|
4041
|
+
TreeItemComponent.prototype.handleArrowRight = function (event, condition) {
|
|
4042
|
+
if (condition === void 0) { condition = true; }
|
|
4043
|
+
var _a;
|
|
4044
|
+
if (condition && this.sub && ((_a = this.sub.itemList) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
4045
|
+
event.preventDefault();
|
|
4046
|
+
if (this.expanded) {
|
|
4047
|
+
this.quitFocus.emit({
|
|
4048
|
+
nextElement: 'firstChild',
|
|
4049
|
+
currentItem: this
|
|
4050
|
+
});
|
|
4051
|
+
}
|
|
4052
|
+
else {
|
|
4053
|
+
this.expandSub(true);
|
|
4054
|
+
}
|
|
4055
|
+
}
|
|
4056
|
+
};
|
|
4057
|
+
TreeItemComponent.prototype.handleArrowLeft = function (event, condition) {
|
|
4058
|
+
if (condition === void 0) { condition = true; }
|
|
4059
|
+
if (condition) {
|
|
4060
|
+
event.preventDefault();
|
|
4061
|
+
if (this.expanded) {
|
|
4062
|
+
this.expandSub(false);
|
|
4063
|
+
}
|
|
4064
|
+
else if (this.subLevel > 0) {
|
|
4065
|
+
this.quitFocus.emit({
|
|
4066
|
+
nextElement: 'parent',
|
|
4067
|
+
currentItem: this
|
|
4068
|
+
});
|
|
4069
|
+
}
|
|
4070
|
+
}
|
|
4071
|
+
};
|
|
4072
|
+
/*
|
|
4073
|
+
* Setters and getters
|
|
4074
|
+
*/
|
|
4075
|
+
TreeItemComponent.prototype.setChecked = function (checked, ignoreInTree, emitEvent) {
|
|
4076
|
+
if (emitEvent === void 0) { emitEvent = true; }
|
|
4077
|
+
if (!this.disabled) {
|
|
4078
|
+
this.checked = checked;
|
|
4079
|
+
}
|
|
4080
|
+
if (!this.inheritedDecoupleChildFromParent && this.sub && this.sub.itemList && !this.indeterminateChecked) {
|
|
4081
|
+
this.sub.itemList.forEach(function (item) {
|
|
4082
|
+
item.setIndeterminateChecked(false);
|
|
4083
|
+
item.setChecked(checked, true);
|
|
4084
|
+
});
|
|
4085
|
+
}
|
|
4086
|
+
if (emitEvent) {
|
|
4087
|
+
this.checkedChange.emit(checked);
|
|
4088
|
+
}
|
|
4089
|
+
if (!ignoreInTree) {
|
|
4090
|
+
this.checkedChangeForTree.emit(checked);
|
|
4091
|
+
}
|
|
4092
|
+
};
|
|
4093
|
+
TreeItemComponent.prototype.setIndeterminateChecked = function (indeterminate) {
|
|
4094
|
+
if (!this.disabled) {
|
|
4095
|
+
this.indeterminateChecked = indeterminate;
|
|
4096
|
+
this.indeterminateCheckedChange.emit(indeterminate);
|
|
4097
|
+
}
|
|
4098
|
+
};
|
|
4099
|
+
TreeItemComponent.prototype.setSubLevel = function (subLevel) {
|
|
4100
|
+
this.subLevel = subLevel;
|
|
4101
|
+
if (this.sub && this.sub.itemList) {
|
|
4102
|
+
this.sub.itemList.forEach(function (item) { return item.setSubLevel(subLevel + 1); });
|
|
4103
|
+
}
|
|
4104
|
+
};
|
|
4105
|
+
TreeItemComponent.prototype.setOrderRecursively = function (order) {
|
|
4106
|
+
this.orderInTree = order;
|
|
4107
|
+
var newOrder = order + 1;
|
|
4108
|
+
if (this.sub && this.sub.itemList) {
|
|
4109
|
+
this.sub.itemList.forEach(function (item) {
|
|
4110
|
+
newOrder = item.setOrderRecursively(newOrder);
|
|
4111
|
+
});
|
|
4112
|
+
}
|
|
4113
|
+
return newOrder;
|
|
4114
|
+
};
|
|
4115
|
+
TreeItemComponent.prototype.setDefaultId = function (defaultId) {
|
|
4116
|
+
this.defaultId = defaultId;
|
|
4117
|
+
this.setDefaultIdRecursive();
|
|
4118
|
+
};
|
|
4119
|
+
TreeItemComponent.prototype.setDefaultIdRecursive = function () {
|
|
4120
|
+
var _this = this;
|
|
4121
|
+
if (this.sub && this.sub.itemList) {
|
|
4122
|
+
this.sub.itemList.forEach(function (item, index) {
|
|
4123
|
+
item.setDefaultId("sub-" + _this.getId() + "-" + index);
|
|
4124
|
+
});
|
|
4125
|
+
}
|
|
4126
|
+
};
|
|
4127
|
+
TreeItemComponent.prototype.getId = function () {
|
|
4128
|
+
return this.id ? this.id : this.defaultId;
|
|
4129
|
+
};
|
|
4130
|
+
TreeItemComponent.prototype.isHidden = function () {
|
|
4131
|
+
return !this.inheritedMatchesSearch && (!this.sub || this.areAllChildrenHidden());
|
|
4132
|
+
};
|
|
4133
|
+
TreeItemComponent.prototype.areAllChildrenHidden = function () {
|
|
4134
|
+
var children = this.sub.itemList;
|
|
4135
|
+
return children.findIndex(function (child) { return !child.isHidden(); }) < 0;
|
|
4136
|
+
};
|
|
4137
|
+
TreeItemComponent.prototype.areAllChildrenChecked = function () {
|
|
4138
|
+
var children = this.sub.itemList;
|
|
4139
|
+
return children.findIndex(function (child) { return !child.checked; }) < 0;
|
|
4140
|
+
};
|
|
4141
|
+
TreeItemComponent.prototype.hasChildrenCheckedOrIndeterminate = function () {
|
|
4142
|
+
var children = this.sub.itemList;
|
|
4143
|
+
return children.findIndex(function (child) { return child.checked || child.indeterminateChecked; }) >= 0;
|
|
4144
|
+
};
|
|
4145
|
+
TreeItemComponent.prototype.matchesText = function (value) {
|
|
4146
|
+
var _a;
|
|
4147
|
+
var matches;
|
|
4148
|
+
if (this.allParentsExpanded && !this.isHidden()) {
|
|
4149
|
+
matches = (_a = this.checkbox) === null || _a === void 0 ? void 0 : _a.matchesText(value);
|
|
4150
|
+
}
|
|
4151
|
+
else {
|
|
4152
|
+
var itemText = this.hiddenWrapper.nativeElement.textContent;
|
|
4153
|
+
matches = SearchUtils.containsAnyWordFrom(itemText, value);
|
|
4154
|
+
}
|
|
4155
|
+
return matches;
|
|
4156
|
+
};
|
|
4157
|
+
TreeItemComponent.prototype.getKey = function () {
|
|
4158
|
+
return this.treeItemKey;
|
|
4159
|
+
};
|
|
4160
|
+
TreeItemComponent.prototype.getParentKey = function () {
|
|
4161
|
+
var parentKey;
|
|
4162
|
+
var parentElement = this.element.nativeElement.parentElement;
|
|
4163
|
+
while (parentElement && parentElement.tagName !== 'BODY' && parentElement.tagName !== 'DESY-TREE-ITEM' && parentElement.tagName !== 'DESY-TREE') {
|
|
4164
|
+
parentElement = parentElement.parentElement;
|
|
4165
|
+
}
|
|
4166
|
+
if (parentElement.tagName === 'BODY') {
|
|
4167
|
+
throw new Error('Parent for tree-item not found');
|
|
4168
|
+
}
|
|
4169
|
+
if (parentElement.tagName === 'DESY-TREE') {
|
|
4170
|
+
parentKey = 'root';
|
|
4171
|
+
}
|
|
4172
|
+
if (parentElement.tagName === 'DESY-TREE-ITEM') {
|
|
4173
|
+
parentKey = parentElement.getAttribute('desy-tree-item-key');
|
|
4174
|
+
}
|
|
4175
|
+
return parentKey;
|
|
4176
|
+
};
|
|
4177
|
+
/*
|
|
4178
|
+
* Métodos privados
|
|
4179
|
+
*/
|
|
4180
|
+
/**
|
|
4181
|
+
* Genera una clave única para el componente
|
|
4182
|
+
* @private
|
|
4183
|
+
*/
|
|
4184
|
+
TreeItemComponent.generateStaticItemKey = function () {
|
|
4185
|
+
var key = 'tree-item-key-' + TreeItemComponent._treeItemKeySuffix;
|
|
4186
|
+
TreeItemComponent._treeItemKeySuffix++;
|
|
4187
|
+
return key;
|
|
4188
|
+
};
|
|
4189
|
+
return TreeItemComponent;
|
|
4190
|
+
}(AccessibilityComponent));
|
|
4191
|
+
TreeItemComponent._treeItemKeySuffix = 0; // Sufijo estático para generar siempre claves distintas
|
|
4192
|
+
TreeItemComponent.decorators = [
|
|
4193
|
+
{ type: i0.Component, args: [{
|
|
4194
|
+
selector: 'desy-tree-item',
|
|
4195
|
+
template: "<li *ngIf=\"allParentsExpanded && !isHidden(); else hidden\"\r\n [id]=\"id\"\r\n [class]=\"'c-tree__item focus:outline-none'\"\r\n [ngClass]=\"{\r\n 'ml-4': subLevel === 0,\r\n 'ml-8': subLevel !== 0,\r\n 'c-tree__item--focus': isFocus && !sub,\r\n 'c-tree__item--hover': isHover && !sub,\r\n 'font-bold': active && subLevel === 0\r\n }\"\r\n (focusin)=\"handleItemFocus(true, !sub)\"\r\n (focusout)=\"handleItemFocus(false, !sub)\"\r\n (mouseover)=\"handleItemHover(true, !sub)\"\r\n (mouseout)=\"handleItemHover(false, !sub)\"\r\n (keydown.home)=\"handleHome($event, !sub)\"\r\n (keydown.end)=\"handleEnd($event, !sub)\"\r\n (keydown.arrowup)=\"handleArrowUp($event, !sub)\"\r\n (keydown.arrowdown)=\"handleArrowDown($event, !sub)\"\r\n (keydown.arrowright)=\"handleArrowRight($event, !sub)\"\r\n (keydown.arrowleft)=\"handleArrowLeft($event, !sub)\"\r\n role=\"treeitem\"\r\n [attr.aria-expanded]=\"sub ? (expanded ? 'true' : 'false') : null\"\r\n [attr.aria-current]=\"active && subLevel === 0 ? 'page' : null\"\r\n [attr.disabled]=\"disabled && subLevel === 0 ? 'disabled' : null\"\r\n [attr.aria-disabled]=\"disabled && subLevel === 0 ? 'true' : null\"\r\n [attr.tabIndex]=\"disabled && subLevel === 0 ? '-1' : null\">\r\n <div *ngIf=\"!sub && subLevel !== 0; else childrenTree\"\r\n [id]=\"id\"\r\n [class]=\"['block', classes] | makeHtmlList\"\r\n [ngClass]=\"{'font-bold': active}\"\r\n [attr.title]=\"title ? title : null\"\r\n [attr.disabled]=\"disabled ? 'disabled' : null\"\r\n\r\n [attr.role]=\"role ? role : 'tree'\"\r\n [attr.aria-describedby]=\"ariaDescribedBy ? ariaDescribedBy : null\"\r\n [attr.aria-labelledby]=\"ariaLabelledBy ? ariaLabelledBy : null\"\r\n [attr.aria-hidden]=\"ariaHidden ? ariaHidden : null\"\r\n [attr.aria-disabled]=\"ariaDisabled ? ariaDisabled : (disabled ? 'true' : null)\"\r\n [attr.aria-controls]=\"ariaControls ? ariaControls : null\"\r\n [attr.aria-current]=\"ariaCurrent ? ariaCurrent : (active ? 'page' : null)\"\r\n [attr.aria-live]=\"ariaLive ? ariaLive : null\"\r\n [attr.aria-expanded]=\"ariaExpanded ? ariaExpanded : null\"\r\n [attr.aria-errormessage]=\"ariaErrorMessage ? ariaErrorMessage : null\"\r\n [attr.aria-haspopup]=\"ariaHasPopup ? ariaHasPopup : null\"\r\n [attr.aria-modal]=\"ariaModal ? ariaModal : null\"\r\n [attr.tabindex]=\"tabindex ? tabindex : (disabled ? '-1' : null)\">\r\n <div class=\"font-bold\" *ngIf=\"active; else checkbox\">\r\n <ng-container *ngTemplateOutlet=\"checkbox\"></ng-container>\r\n </div>\r\n </div>\r\n</li>\r\n\r\n<ng-template #childrenTree>\r\n <div *ngIf=\"sub; else checkbox\" class=\"w-full h-full\"\r\n [ngClass]=\"{'c-tree__item--focus': isFocus && sub, 'c-tree__item--hover': isHover && sub}\"\r\n (focusin)=\"handleItemFocus(true)\"\r\n (focusout)=\"handleItemFocus(false)\"\r\n (mouseover)=\"handleItemHover(true)\"\r\n (mouseout)=\"handleItemHover(false)\"\r\n (keydown.home)=\"handleHome($event)\"\r\n (keydown.end)=\"handleEnd($event)\"\r\n (keydown.arrowup)=\"handleArrowUp($event)\"\r\n (keydown.arrowdown)=\"handleArrowDown($event)\"\r\n (keydown.arrowright)=\"handleArrowRight($event)\"\r\n (keydown.arrowLeft)=\"handleArrowLeft($event)\">\r\n <div [class]=\"['w-full flex items-center relative focus:bg-warning-base focus:outline-none focus:shadow-outline-focus focus:text-black text-left', classes] | makeHtmlList\"\r\n\r\n [attr.role]=\"role ? role : null\"\r\n [attr.aria-describedby]=\"ariaDescribedBy ? ariaDescribedBy : null\"\r\n [attr.aria-labelledby]=\"ariaLabelledBy ? ariaLabelledBy : null\"\r\n [attr.aria-hidden]=\"ariaHidden ? ariaHidden : null\"\r\n [attr.aria-disabled]=\"ariaDisabled ? ariaDisabled : null\"\r\n [attr.aria-controls]=\"ariaControls ? ariaControls : null\"\r\n [attr.aria-current]=\"ariaCurrent ? ariaCurrent : null\"\r\n [attr.aria-live]=\"ariaLive ? ariaLive : null\"\r\n [attr.aria-expanded]=\"ariaExpanded ? ariaExpanded : null\"\r\n [attr.aria-errormessage]=\"ariaErrorMessage ? ariaErrorMessage : null\"\r\n [attr.aria-haspopup]=\"ariaHasPopup ? ariaHasPopup : null\"\r\n [attr.aria-modal]=\"ariaModal ? ariaModal : null\"\r\n [attr.tabindex]=\"tabindex ? tabindex : null\">\r\n <span class=\"absolute top-3 -left-4 flex items-center w-4 h-2.5 text-primary-base font-bold\">\r\n <svg (click)=\"expandSub(false)\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 10 10\" width=\"10\" height=\"10\" aria-hidden=\"true\" class=\"c-tree__minus\"><path fill=\"currentColor\" d=\"M9.286 5.714H.714a.714.714 0 010-1.428h8.572a.714.714 0 010 1.428z\"/></svg>\r\n <svg (click)=\"expandSub(true)\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 10 10\" width=\"10\" height=\"10\" aria-hidden=\"true\" class=\"c-tree__plus\"><path fill=\"currentColor\" d=\"M9.286 4.286H5.893a.179.179 0 01-.179-.179V.714a.714.714 0 00-1.428 0v3.393a.179.179 0 01-.179.179H.714a.714.714 0 000 1.428h3.393a.179.179 0 01.179.179v3.393a.714.714 0 001.428 0V5.893a.179.179 0 01.179-.179h3.393a.714.714 0 000-1.428z\"/></svg>\r\n </span>\r\n <ng-container *ngTemplateOutlet=\"checkbox\"></ng-container>\r\n </div>\r\n </div>\r\n\r\n <ng-container *desyCustomInnerContent=\"{ component: sub }\"></ng-container>\r\n</ng-template>\r\n\r\n<!-- Se incorpora el contenido m\u00EDnimo para funcionar con el objetivo de mejorar el rendimiento -->\r\n<ng-template #hidden>\r\n <li class=\"hidden\">\r\n <div #hiddenWrapper>\r\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\r\n </div>\r\n <ng-container *desyCustomInnerContent=\"{ component: sub }\"></ng-container>\r\n </li>\r\n</ng-template>\r\n\r\n<ng-template #checkbox>\r\n <desy-tree-checkbox [name]=\"name ? name : parentName\"\r\n [id]=\"getId()\"\r\n [value]=\"value\"\r\n [classes]=\"classes\"\r\n [type]=\"type\"\r\n [(checked)]=\"checked\" (checkedChange)=\"handleCheckboxChange($event)\"\r\n [hasError]=\"inheritedHasError\"\r\n [disabled]=\"disabled\"\r\n [hasDividers]=\"hasDividers\"\r\n [describedBy]=\"[inheritedDescribedBy, hint?.id] | makeHtmlList\"\r\n [isIndeterminate]=\"isIndeterminate\"\r\n [(indeterminateChecked)]=\"indeterminateChecked\"\r\n (indeterminateCheckedChange)=\"handleIndeterminateCheckedChange($event)\"\r\n\r\n [labelComponent]=\"label\"\r\n [hintComponent]=\"hint\"\r\n\r\n [role]=\"role\"\r\n [ariaLabel]=\"ariaLabel\"\r\n [ariaDescribedBy]=\"ariaDescribedBy\"\r\n [ariaLabelledBy]=\"ariaLabelledBy\"\r\n [ariaHidden]=\"ariaHidden\"\r\n [ariaDisabled]=\"ariaDisabled\"\r\n [ariaControls]=\"ariaControls\"\r\n [ariaCurrent]=\"ariaCurrent\"\r\n [ariaLive]=\"ariaLive\"\r\n [ariaExpanded]=\"ariaExpanded\"\r\n [ariaErrorMessage]=\"ariaErrorMessage\"\r\n [ariaHasPopup]=\"ariaHasPopup\"\r\n [ariaModal]=\"ariaModal\"\r\n [tabindex]=\"tabindex\">\r\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\r\n </desy-tree-checkbox>\r\n</ng-template>\r\n\r\n<ng-template #content>\r\n <ng-content select=\"desy-label\"></ng-content>\r\n <ng-content select=\"desy-hint\"></ng-content>\r\n</ng-template>\r\n",
|
|
4196
|
+
providers: [
|
|
4197
|
+
{
|
|
4198
|
+
provide: ITreeItem,
|
|
4199
|
+
useExisting: i0.forwardRef(function () { return TreeItemComponent; })
|
|
4200
|
+
}
|
|
4201
|
+
]
|
|
4202
|
+
},] }
|
|
4203
|
+
];
|
|
4204
|
+
TreeItemComponent.ctorParameters = function () { return [
|
|
4205
|
+
{ type: i0.ChangeDetectorRef },
|
|
4206
|
+
{ type: i0.ElementRef }
|
|
4207
|
+
]; };
|
|
4208
|
+
TreeItemComponent.propDecorators = {
|
|
4209
|
+
hiddenWrapper: [{ type: i0.ViewChild, args: ['hiddenWrapper',] }],
|
|
4210
|
+
id: [{ type: i0.Input }],
|
|
4211
|
+
name: [{ type: i0.Input }],
|
|
4212
|
+
value: [{ type: i0.Input }],
|
|
4213
|
+
classes: [{ type: i0.Input }],
|
|
4214
|
+
active: [{ type: i0.Input }],
|
|
4215
|
+
disabled: [{ type: i0.Input }],
|
|
4216
|
+
title: [{ type: i0.Input }],
|
|
4217
|
+
hasDividers: [{ type: i0.Input }],
|
|
4218
|
+
isIndeterminate: [{ type: i0.Input }],
|
|
4219
|
+
checked: [{ type: i0.Input }],
|
|
4220
|
+
checkedChange: [{ type: i0.Output }],
|
|
4221
|
+
expanded: [{ type: i0.Input }],
|
|
4222
|
+
expandedChange: [{ type: i0.Output }],
|
|
4223
|
+
indeterminateChecked: [{ type: i0.Input }],
|
|
4224
|
+
indeterminateCheckedChange: [{ type: i0.Output }],
|
|
4225
|
+
sub: [{ type: i0.ContentChildren, args: [TreeSubComponent,] }],
|
|
4226
|
+
hint: [{ type: i0.ContentChildren, args: [HintComponent,] }],
|
|
4227
|
+
label: [{ type: i0.ContentChildren, args: [LabelComponent,] }],
|
|
4228
|
+
checkbox: [{ type: i0.ViewChild, args: [TreeCheckboxComponent,] }],
|
|
4229
|
+
treeItemKey: [{ type: i0.HostBinding, args: ['attr.desy-tree-item-key',] }]
|
|
4230
|
+
};
|
|
4231
|
+
__decorate([
|
|
4232
|
+
DesyOnInputChange('setDefaultIdRecursive')
|
|
4233
|
+
], TreeItemComponent.prototype, "id", void 0);
|
|
4234
|
+
__decorate([
|
|
4235
|
+
DesyContentChild({ onSetCallbackName: 'overrideSubValues' })
|
|
4236
|
+
], TreeItemComponent.prototype, "sub", void 0);
|
|
4237
|
+
__decorate([
|
|
4238
|
+
DesyContentChild()
|
|
4239
|
+
], TreeItemComponent.prototype, "hint", void 0);
|
|
4240
|
+
__decorate([
|
|
4241
|
+
DesyContentChild()
|
|
4242
|
+
], TreeItemComponent.prototype, "label", void 0);
|
|
4243
|
+
|
|
4244
|
+
var TreeComponent = /** @class */ (function (_super) {
|
|
4245
|
+
__extends(TreeComponent, _super);
|
|
4246
|
+
function TreeComponent(changeDetector) {
|
|
4247
|
+
var _this = _super.call(this) || this;
|
|
4248
|
+
_this.changeDetector = changeDetector;
|
|
4249
|
+
_this.expandedFirstLevel = true;
|
|
4250
|
+
_this.decoupleChildFromParent = false;
|
|
4251
|
+
_this.disableDefaultSearch = false;
|
|
4252
|
+
_this.searchMatchValuesChange = new i0.EventEmitter();
|
|
4253
|
+
_this.rootItems = [];
|
|
4254
|
+
_this._itemListCheckedSubscriptions = [];
|
|
4255
|
+
_this._itemListQuitFocusSubscriptions = [];
|
|
4256
|
+
_this._alreadyConfiguringItems = false;
|
|
4257
|
+
return _this;
|
|
4258
|
+
}
|
|
4259
|
+
TreeComponent.prototype.ngOnDestroy = function () {
|
|
4260
|
+
var _a, _b;
|
|
4261
|
+
this.clearSubscriptions(this._itemListCheckedSubscriptions);
|
|
4262
|
+
this.clearSubscriptions(this._itemListQuitFocusSubscriptions);
|
|
4263
|
+
(_a = this._itemListSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
4264
|
+
(_b = this._allItemListSubscription) === null || _b === void 0 ? void 0 : _b.unsubscribe();
|
|
4265
|
+
};
|
|
4266
|
+
TreeComponent.prototype.ngOnChanges = function (changes) {
|
|
4267
|
+
this.configureAllItems();
|
|
4268
|
+
};
|
|
4269
|
+
/*
|
|
4270
|
+
* Eventos
|
|
4271
|
+
*/
|
|
4272
|
+
/**
|
|
4273
|
+
* Actualiza el valor del componente al checkquearse un ítem
|
|
4274
|
+
* @param originItem ítem modificado
|
|
4275
|
+
*/
|
|
4276
|
+
TreeComponent.prototype.updateValueFromItems = function (originItem) {
|
|
4277
|
+
var _this = this;
|
|
4278
|
+
// Si es radio, se desactivan el resto de items cuando se activa otro item
|
|
4279
|
+
if (this.type !== 'checkbox') {
|
|
4280
|
+
var items = this.getAllItemsInOrder();
|
|
4281
|
+
items.forEach(function (item) {
|
|
4282
|
+
if (item !== originItem && item.checked) {
|
|
4283
|
+
item.setChecked(false, true);
|
|
4284
|
+
}
|
|
4285
|
+
});
|
|
4286
|
+
}
|
|
4287
|
+
else if (!this.decoupleChildFromParent) {
|
|
4288
|
+
this.rootItems.forEach(function (item) { return item.setCheckedAutomaticallyDependingOnChildren(); });
|
|
4289
|
+
}
|
|
4290
|
+
// Si es checkbox se modifica el valor y se emite
|
|
4291
|
+
if (this.type === 'checkbox') {
|
|
4292
|
+
this.value = [];
|
|
4293
|
+
var items = this.getAllItemsInOrder();
|
|
4294
|
+
items.forEach(function (item) {
|
|
4295
|
+
if (item.checked) {
|
|
4296
|
+
_this.value.push(item.value);
|
|
4297
|
+
}
|
|
4298
|
+
});
|
|
4299
|
+
this.onChange(this.value);
|
|
4300
|
+
}
|
|
4301
|
+
};
|
|
4302
|
+
/**
|
|
4303
|
+
* Gestiona cuando el foco abandona un ítem desde un evento de teclado controlado
|
|
4304
|
+
* @param options
|
|
4305
|
+
*/
|
|
4306
|
+
TreeComponent.prototype.handleItemQuitFocus = function (options) {
|
|
4307
|
+
if (options && options.nextElement) {
|
|
4308
|
+
var items = this.getAllItemsInOrder();
|
|
4309
|
+
var focusableItems = items.filter(function (item) { return !item.isHidden() && !item.disabled && item.allParentsExpanded; });
|
|
4310
|
+
switch (options.nextElement) {
|
|
4311
|
+
case "first":
|
|
4312
|
+
focusableItems[0].focus();
|
|
4313
|
+
break;
|
|
4314
|
+
case "last":
|
|
4315
|
+
focusableItems[focusableItems.length - 1].focus();
|
|
4316
|
+
break;
|
|
4317
|
+
case "parent":
|
|
4318
|
+
var currentSubLevel_1 = options.currentItem.subLevel;
|
|
4319
|
+
if (currentSubLevel_1 > 0) {
|
|
4320
|
+
var currentItemIndex = focusableItems.findIndex(function (item) { return item === options.currentItem; });
|
|
4321
|
+
var parent = focusableItems.slice(0, currentItemIndex).reverse().find(function (item) { return item.subLevel < currentSubLevel_1; });
|
|
4322
|
+
if (parent) {
|
|
4323
|
+
parent.focus();
|
|
4324
|
+
}
|
|
4325
|
+
}
|
|
4326
|
+
break;
|
|
4327
|
+
case "firstChild":
|
|
4328
|
+
case "next":
|
|
4329
|
+
if (options.currentItem) {
|
|
4330
|
+
var currentItemIndex = focusableItems.findIndex(function (item) { return item === options.currentItem; });
|
|
4331
|
+
if (currentItemIndex < focusableItems.length - 1) {
|
|
4332
|
+
focusableItems[currentItemIndex + 1].focus();
|
|
4333
|
+
}
|
|
4334
|
+
}
|
|
4335
|
+
break;
|
|
4336
|
+
case "previous":
|
|
4337
|
+
if (options.currentItem) {
|
|
4338
|
+
var currentItemIndex = focusableItems.findIndex(function (item) { return item === options.currentItem; });
|
|
4339
|
+
if (currentItemIndex > 0) {
|
|
4340
|
+
focusableItems[currentItemIndex - 1].focus();
|
|
4341
|
+
}
|
|
4342
|
+
}
|
|
4343
|
+
break;
|
|
4344
|
+
}
|
|
4345
|
+
}
|
|
4346
|
+
};
|
|
4347
|
+
/**
|
|
4348
|
+
* Realiza la búsqueda interna de los items en el componente
|
|
4349
|
+
* @param value texto de búsqueda
|
|
4350
|
+
*/
|
|
4351
|
+
TreeComponent.prototype.onSearch = function (value) {
|
|
4352
|
+
if (!this.disableDefaultSearch) {
|
|
4353
|
+
if (value && value.length > 0) {
|
|
4354
|
+
this.searchMatchValues = this.allItems.filter(function (item) { return item.matchesText(value); }).map(function (item) { return item.value; });
|
|
4355
|
+
}
|
|
4356
|
+
else {
|
|
4357
|
+
this.searchMatchValues = null;
|
|
4358
|
+
}
|
|
4359
|
+
this.searchMatchValuesChange.emit(this.searchMatchValues);
|
|
4360
|
+
}
|
|
4361
|
+
};
|
|
4362
|
+
/*
|
|
4363
|
+
* Eventos al cambiar propiedades
|
|
4364
|
+
*/
|
|
4365
|
+
/**
|
|
4366
|
+
* Configura los items del árbol
|
|
4367
|
+
*/
|
|
4368
|
+
TreeComponent.prototype.configureAllItems = function () {
|
|
4369
|
+
var _this = this;
|
|
4370
|
+
if (!this._alreadyConfiguringItems) {
|
|
4371
|
+
this._alreadyConfiguringItems = true;
|
|
4372
|
+
// Lo realizamos desde un setTimeout para que todos los inputs, values y demás vivan en paz y armonía
|
|
4373
|
+
setTimeout(function () {
|
|
4374
|
+
var _a;
|
|
4375
|
+
if (((_a = _this.allItems) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
4376
|
+
_this.clearSubscriptions(_this._itemListCheckedSubscriptions);
|
|
4377
|
+
_this.clearSubscriptions(_this._itemListQuitFocusSubscriptions);
|
|
4378
|
+
_this.allItems.forEach(function (item) {
|
|
4379
|
+
item.parentName = _this.name;
|
|
4380
|
+
item.type = _this.type;
|
|
4381
|
+
item.inheritedDescribedBy = _this.getDescribedByForItems();
|
|
4382
|
+
item.inheritedExpandedFirstLevel = _this.expandedFirstLevel;
|
|
4383
|
+
item.inheritedDecoupleChildFromParent = _this.decoupleChildFromParent;
|
|
4384
|
+
if (_this.value && _this.value.length > 0) {
|
|
4385
|
+
item.setChecked(!!_this.value.find(function (v) { return v === item.value; }), true);
|
|
4386
|
+
}
|
|
4387
|
+
item.detectChanges();
|
|
4388
|
+
var checkedSubscription = item.checkedChangeForTree.subscribe(function () { return _this.updateValueFromItems(item); });
|
|
4389
|
+
_this._itemListCheckedSubscriptions.push(checkedSubscription);
|
|
4390
|
+
var quitFocusSubscription = item.quitFocus.subscribe(function (options) { return _this.handleItemQuitFocus(options); });
|
|
4391
|
+
_this._itemListQuitFocusSubscriptions.push(quitFocusSubscription);
|
|
4392
|
+
});
|
|
4393
|
+
_this.setErrorInItems(_this.hasErrorMessageComponent());
|
|
4394
|
+
_this.buildTree();
|
|
4395
|
+
if (!_this.value) {
|
|
4396
|
+
_this.updateValueFromItems();
|
|
4397
|
+
}
|
|
4398
|
+
}
|
|
4399
|
+
if (_this.allItems && !_this._allItemListSubscription) {
|
|
4400
|
+
_this._allItemListSubscription = _this.allItems.changes.subscribe(function () { return _this.configureAllItems(); });
|
|
4401
|
+
}
|
|
4402
|
+
_this.changeDetector.detectChanges();
|
|
4403
|
+
_this._alreadyConfiguringItems = false;
|
|
4404
|
+
});
|
|
4405
|
+
}
|
|
4406
|
+
};
|
|
4407
|
+
/**
|
|
4408
|
+
* Modifica los items visibles según el filtro de búsqueda
|
|
4409
|
+
*/
|
|
4410
|
+
TreeComponent.prototype.onSearchMatchValuesChange = function () {
|
|
4411
|
+
var _this = this;
|
|
4412
|
+
if (this.allItems) {
|
|
4413
|
+
this.allItems.forEach(function (item) {
|
|
4414
|
+
item.inheritedMatchesSearch = true;
|
|
4415
|
+
});
|
|
4416
|
+
if (this.searchMatchValues !== null && this.searchMatchValues !== undefined) {
|
|
4417
|
+
this.allItems.forEach(function (item) {
|
|
4418
|
+
if (_this.searchMatchValues.findIndex(function (value) { return item.value === value; }) < 0) {
|
|
4419
|
+
item.inheritedMatchesSearch = false;
|
|
4420
|
+
}
|
|
4421
|
+
});
|
|
4422
|
+
}
|
|
4423
|
+
}
|
|
4424
|
+
};
|
|
4425
|
+
/*
|
|
4426
|
+
* Getters and setters
|
|
4427
|
+
*/
|
|
4428
|
+
TreeComponent.prototype.getIdPrefix = function () {
|
|
4429
|
+
return this.idPrefix ? this.idPrefix : this.name;
|
|
4430
|
+
};
|
|
4431
|
+
TreeComponent.prototype.getDescribedBy = function () {
|
|
4432
|
+
var describedBy = '';
|
|
4433
|
+
if (this.describedBy) {
|
|
4434
|
+
describedBy = this.describedBy;
|
|
4435
|
+
}
|
|
4436
|
+
if (this.hasHintComponent() && this.hintComponent.id) {
|
|
4437
|
+
describedBy = describedBy + ' ' + this.hintComponent.id;
|
|
4438
|
+
}
|
|
4439
|
+
if (this.hasErrorMessageComponent() && this.errorMessageComponent.id) {
|
|
4440
|
+
describedBy = describedBy + ' ' + this.errorMessageComponent.id;
|
|
4441
|
+
}
|
|
4442
|
+
return describedBy;
|
|
4443
|
+
};
|
|
4444
|
+
/**
|
|
4445
|
+
* Devuelve el valor de describedBy que se transmitirá a los items
|
|
4446
|
+
*/
|
|
4447
|
+
TreeComponent.prototype.getDescribedByForItems = function () {
|
|
4448
|
+
var describedBy;
|
|
4449
|
+
if (this.hasFieldsetComponent()) {
|
|
4450
|
+
describedBy = this.fieldsetComponent.describedBy;
|
|
4451
|
+
}
|
|
4452
|
+
else {
|
|
4453
|
+
describedBy = this.getDescribedBy();
|
|
4454
|
+
}
|
|
4455
|
+
return describedBy;
|
|
4456
|
+
};
|
|
4457
|
+
TreeComponent.prototype.hasFieldsetComponent = function () {
|
|
4458
|
+
return !!this.fieldsetComponent;
|
|
4459
|
+
};
|
|
4460
|
+
/**
|
|
4461
|
+
* Overrides super.getHintId();
|
|
4462
|
+
*/
|
|
4463
|
+
TreeComponent.prototype.getHintId = function () {
|
|
4464
|
+
var _a;
|
|
4465
|
+
return this.idPrefix ? this.idPrefix + '-hint' : (_a = this.hintComponent) === null || _a === void 0 ? void 0 : _a.id;
|
|
4466
|
+
};
|
|
4467
|
+
/**
|
|
4468
|
+
* Overrides super.getHintId();
|
|
4469
|
+
*/
|
|
4470
|
+
TreeComponent.prototype.getErrorId = function () {
|
|
4471
|
+
var _a;
|
|
4472
|
+
return this.idPrefix ? this.idPrefix + '-error' : (_a = this.errorMessageComponent) === null || _a === void 0 ? void 0 : _a.id;
|
|
4473
|
+
};
|
|
4474
|
+
/*
|
|
4475
|
+
* Funciones para reemplazar el contenido del fieldset, label, hint o errormessage
|
|
4476
|
+
*/
|
|
4477
|
+
TreeComponent.prototype.overrideFieldsetParams = function (fieldset) {
|
|
4478
|
+
fieldset.caller = this.innerHtml;
|
|
4479
|
+
fieldset.errorId = this.getErrorId();
|
|
4480
|
+
fieldset.describedBy = this.getDescribedBy();
|
|
4481
|
+
fieldset.detectChanges();
|
|
4482
|
+
};
|
|
4483
|
+
TreeComponent.prototype.overrideSearchBarParams = function (searchbar) {
|
|
4484
|
+
var _this = this;
|
|
4485
|
+
var defaultOnChange = searchbar.onChange;
|
|
4486
|
+
var newOnChange = function (value) {
|
|
4487
|
+
_this.onSearch(value);
|
|
4488
|
+
defaultOnChange(value);
|
|
4489
|
+
};
|
|
4490
|
+
searchbar.registerOnChange(newOnChange);
|
|
4491
|
+
};
|
|
4492
|
+
/**
|
|
4493
|
+
* Se llama desde FormField
|
|
4494
|
+
*/
|
|
4495
|
+
TreeComponent.prototype.overrideHintParams = function (hint) {
|
|
4496
|
+
hint.id = this.getHintId();
|
|
4497
|
+
hint.detectChanges();
|
|
4498
|
+
};
|
|
4499
|
+
/**
|
|
4500
|
+
* Se llama desde FormField
|
|
4501
|
+
*/
|
|
4502
|
+
TreeComponent.prototype.overrideErrorMessageParams = function (errorMessage) {
|
|
4503
|
+
errorMessage.id = this.getErrorId();
|
|
4504
|
+
this.setErrorInItems(this.hasErrorMessageComponent());
|
|
4505
|
+
errorMessage.detectChanges();
|
|
4506
|
+
};
|
|
4507
|
+
/**
|
|
4508
|
+
* Se llama desde FormField
|
|
4509
|
+
*/
|
|
4510
|
+
TreeComponent.prototype.onDeleteErrorMessage = function (errorMessage) {
|
|
4511
|
+
this.setErrorInItems(this.hasErrorMessageComponent());
|
|
4512
|
+
};
|
|
4513
|
+
/*
|
|
4514
|
+
* Métodos privados
|
|
4515
|
+
*/
|
|
4516
|
+
/**
|
|
4517
|
+
* Configura la estructura del árbol
|
|
4518
|
+
* @private
|
|
4519
|
+
*/
|
|
4520
|
+
TreeComponent.prototype.buildTree = function () {
|
|
4521
|
+
var _this = this;
|
|
4522
|
+
// Se crea un mapa para tener accesibles los items por key y se borran los listados existentes
|
|
4523
|
+
var itemMap = {};
|
|
4524
|
+
this.rootItems = [];
|
|
4525
|
+
this.allItems.forEach(function (item) {
|
|
4526
|
+
var key = item.getKey();
|
|
4527
|
+
itemMap[key] = item;
|
|
4528
|
+
if (item.sub) {
|
|
4529
|
+
item.sub.itemList = [];
|
|
4530
|
+
}
|
|
4531
|
+
});
|
|
4532
|
+
// Se añaden los items a los listados correspondientes
|
|
4533
|
+
this.allItems.forEach(function (item) {
|
|
4534
|
+
var parentKey = item.getParentKey();
|
|
4535
|
+
if (parentKey === 'root') {
|
|
4536
|
+
_this.rootItems.push(item);
|
|
4537
|
+
}
|
|
4538
|
+
else if (parentKey) {
|
|
4539
|
+
var sub = itemMap[parentKey].sub;
|
|
4540
|
+
if (sub) {
|
|
4541
|
+
sub.itemList.push(item);
|
|
4542
|
+
}
|
|
4543
|
+
}
|
|
4544
|
+
});
|
|
4545
|
+
// Se configuran los items desde root
|
|
4546
|
+
var order = 0;
|
|
4547
|
+
this.rootItems.forEach(function (item, index) {
|
|
4548
|
+
item.setSubLevel(0);
|
|
4549
|
+
item.setDefaultId(_this.idPrefix + "-" + index);
|
|
4550
|
+
item.refreshAllParentsExpandedRecursive(true);
|
|
4551
|
+
item.setCheckedAutomaticallyDependingOnChildren();
|
|
4552
|
+
order = item.setOrderRecursively(order);
|
|
4553
|
+
});
|
|
4554
|
+
};
|
|
4555
|
+
/**
|
|
4556
|
+
* Si tiene un mensaje de error, se indica a los items
|
|
4557
|
+
* @param hasError
|
|
4558
|
+
* @private
|
|
4559
|
+
*/
|
|
4560
|
+
TreeComponent.prototype.setErrorInItems = function (hasError) {
|
|
4561
|
+
var _a;
|
|
4562
|
+
if (((_a = this.allItems) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
4563
|
+
this.allItems.forEach(function (item) {
|
|
4564
|
+
item.inheritedHasError = hasError;
|
|
4565
|
+
item.detectChanges();
|
|
4566
|
+
});
|
|
4567
|
+
}
|
|
4568
|
+
};
|
|
4569
|
+
/**
|
|
4570
|
+
* Limpia un listado de subscripciones
|
|
4571
|
+
* @param subscriptionList
|
|
4572
|
+
* @private
|
|
4573
|
+
*/
|
|
4574
|
+
TreeComponent.prototype.clearSubscriptions = function (subscriptionList) {
|
|
4575
|
+
if (subscriptionList.length > 0) {
|
|
4576
|
+
subscriptionList.forEach(function (s) { return s.unsubscribe(); });
|
|
4577
|
+
subscriptionList.splice(0, subscriptionList.length);
|
|
4578
|
+
}
|
|
4579
|
+
};
|
|
4580
|
+
/**
|
|
4581
|
+
* Devuelve los items del árbol ordenados
|
|
4582
|
+
* @private
|
|
4583
|
+
*/
|
|
4584
|
+
TreeComponent.prototype.getAllItemsInOrder = function () {
|
|
4585
|
+
var list = [];
|
|
4586
|
+
if (this.allItems) {
|
|
4587
|
+
list = this.allItems.toArray().sort(function (a, b) { return a.orderInTree > b.orderInTree ? 1 : -1; });
|
|
4588
|
+
}
|
|
4589
|
+
return list;
|
|
4590
|
+
};
|
|
4591
|
+
return TreeComponent;
|
|
4592
|
+
}(FormFieldComponent));
|
|
4593
|
+
TreeComponent.decorators = [
|
|
4594
|
+
{ type: i0.Component, args: [{
|
|
4595
|
+
selector: 'desy-tree',
|
|
4596
|
+
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",
|
|
4597
|
+
providers: [
|
|
4598
|
+
{
|
|
4599
|
+
provide: forms.NG_VALUE_ACCESSOR,
|
|
4600
|
+
useExisting: i0.forwardRef(function () { return TreeComponent; }),
|
|
4601
|
+
multi: true
|
|
4602
|
+
}
|
|
4603
|
+
]
|
|
4604
|
+
},] }
|
|
4605
|
+
];
|
|
4606
|
+
TreeComponent.ctorParameters = function () { return [
|
|
4607
|
+
{ type: i0.ChangeDetectorRef }
|
|
4608
|
+
]; };
|
|
4609
|
+
TreeComponent.propDecorators = {
|
|
4610
|
+
idPrefix: [{ type: i0.Input }],
|
|
4611
|
+
classes: [{ type: i0.Input }],
|
|
4612
|
+
formGroupClasses: [{ type: i0.Input }],
|
|
4613
|
+
name: [{ type: i0.Input }],
|
|
4614
|
+
type: [{ type: i0.Input }],
|
|
4615
|
+
describedBy: [{ type: i0.Input }],
|
|
4616
|
+
expandedFirstLevel: [{ type: i0.Input }],
|
|
4617
|
+
decoupleChildFromParent: [{ type: i0.Input }],
|
|
4618
|
+
disableDefaultSearch: [{ type: i0.Input }],
|
|
4619
|
+
searchMatchValues: [{ type: i0.Input }],
|
|
4620
|
+
searchMatchValuesChange: [{ type: i0.Output }],
|
|
4621
|
+
allItems: [{ type: i0.ContentChildren, args: [TreeItemComponent, { descendants: true },] }],
|
|
4622
|
+
fieldsetComponent: [{ type: i0.ContentChildren, args: [FieldsetComponent,] }],
|
|
4623
|
+
searchBarComponent: [{ type: i0.ContentChildren, args: [SearchBarComponent,] }],
|
|
4624
|
+
innerHtml: [{ type: i0.ViewChild, args: ['innerHtml', { static: true },] }]
|
|
4625
|
+
};
|
|
4626
|
+
__decorate([
|
|
4627
|
+
DesyOnInputChange('onSearchMatchValuesChange')
|
|
4628
|
+
], TreeComponent.prototype, "searchMatchValues", void 0);
|
|
4629
|
+
__decorate([
|
|
4630
|
+
DesyOnInputChange('configureAllItems')
|
|
4631
|
+
], TreeComponent.prototype, "allItems", void 0);
|
|
4632
|
+
__decorate([
|
|
4633
|
+
DesyContentChild({ onSetCallbackName: 'overrideFieldsetParams' })
|
|
4634
|
+
], TreeComponent.prototype, "fieldsetComponent", void 0);
|
|
4635
|
+
__decorate([
|
|
4636
|
+
DesyContentChild({ onSetCallbackName: 'overrideSearchBarParams' })
|
|
4637
|
+
], TreeComponent.prototype, "searchBarComponent", void 0);
|
|
4638
|
+
|
|
3641
4639
|
var ConditionDirective = /** @class */ (function () {
|
|
3642
4640
|
function ConditionDirective(templateRef) {
|
|
3643
4641
|
this.templateRef = templateRef;
|
|
@@ -3684,6 +4682,31 @@
|
|
|
3684
4682
|
items: [{ type: i0.Input }]
|
|
3685
4683
|
};
|
|
3686
4684
|
|
|
4685
|
+
var TreeItemsGeneratorComponent = /** @class */ (function () {
|
|
4686
|
+
function TreeItemsGeneratorComponent(viewContainerRef) {
|
|
4687
|
+
this.viewContainerRef = viewContainerRef;
|
|
4688
|
+
}
|
|
4689
|
+
TreeItemsGeneratorComponent.prototype.ngOnInit = function () {
|
|
4690
|
+
this.viewContainerRef.createEmbeddedView(this.content);
|
|
4691
|
+
};
|
|
4692
|
+
return TreeItemsGeneratorComponent;
|
|
4693
|
+
}());
|
|
4694
|
+
TreeItemsGeneratorComponent.decorators = [
|
|
4695
|
+
{ type: i0.Component, args: [{
|
|
4696
|
+
selector: 'desy-tree-items-generator',
|
|
4697
|
+
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",
|
|
4698
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
4699
|
+
},] }
|
|
4700
|
+
];
|
|
4701
|
+
TreeItemsGeneratorComponent.ctorParameters = function () { return [
|
|
4702
|
+
{ type: i0.ViewContainerRef }
|
|
4703
|
+
]; };
|
|
4704
|
+
TreeItemsGeneratorComponent.propDecorators = {
|
|
4705
|
+
content: [{ type: i0.ViewChild, args: ['content', { static: true },] }],
|
|
4706
|
+
items: [{ type: i0.Input }],
|
|
4707
|
+
itemTemplate: [{ type: i0.Input }]
|
|
4708
|
+
};
|
|
4709
|
+
|
|
3687
4710
|
var ModalButtonPrimaryComponent = /** @class */ (function (_super) {
|
|
3688
4711
|
__extends(ModalButtonPrimaryComponent, _super);
|
|
3689
4712
|
function ModalButtonPrimaryComponent() {
|
|
@@ -4252,6 +5275,8 @@
|
|
|
4252
5275
|
if (this.isOpen()) {
|
|
4253
5276
|
this.dialogService.closeDialog(this.dialog);
|
|
4254
5277
|
this.dialog = null;
|
|
5278
|
+
var elementToFocus = document.getElementById('header-offcanvas-button');
|
|
5279
|
+
elementToFocus === null || elementToFocus === void 0 ? void 0 : elementToFocus.focus();
|
|
4255
5280
|
}
|
|
4256
5281
|
};
|
|
4257
5282
|
HeaderOffcanvasComponent.prototype.isOpen = function () {
|
|
@@ -4277,14 +5302,15 @@
|
|
|
4277
5302
|
}());
|
|
4278
5303
|
HeaderOffcanvasComponent.dialogOptions = {
|
|
4279
5304
|
id: 'header-offcanvas-dialog',
|
|
4280
|
-
focusOnClose: 'header-offcanvas',
|
|
5305
|
+
focusOnClose: 'header-offcanvas-button',
|
|
4281
5306
|
ariaModal: 'true',
|
|
4282
|
-
ariaLabelledBy: 'header-offcanvas-button-text'
|
|
5307
|
+
ariaLabelledBy: 'header-offcanvas-button-text',
|
|
5308
|
+
role: 'dialog'
|
|
4283
5309
|
};
|
|
4284
5310
|
HeaderOffcanvasComponent.decorators = [
|
|
4285
5311
|
{ type: i0.Component, args: [{
|
|
4286
5312
|
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"
|
|
5313
|
+
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
5314
|
},] }
|
|
4289
5315
|
];
|
|
4290
5316
|
HeaderOffcanvasComponent.ctorParameters = function () { return [
|
|
@@ -4466,12 +5492,43 @@
|
|
|
4466
5492
|
NavComponent.prototype.getIdPrefix = function () {
|
|
4467
5493
|
return this.idPrefix ? this.idPrefix : 'nav-item';
|
|
4468
5494
|
};
|
|
5495
|
+
NavComponent.prototype.movePrevious = function (event, currentIndex) {
|
|
5496
|
+
event.preventDefault();
|
|
5497
|
+
var items = this.getItemList();
|
|
5498
|
+
var nextIndex = currentIndex - 1;
|
|
5499
|
+
while (nextIndex >= 0 && !this.isFocusableItem(items[nextIndex])) {
|
|
5500
|
+
nextIndex--;
|
|
5501
|
+
}
|
|
5502
|
+
if (nextIndex < items.length) {
|
|
5503
|
+
var itemElem = document.getElementById(this.getItemId(items[nextIndex], nextIndex));
|
|
5504
|
+
if (itemElem) {
|
|
5505
|
+
itemElem.focus();
|
|
5506
|
+
}
|
|
5507
|
+
}
|
|
5508
|
+
};
|
|
5509
|
+
NavComponent.prototype.moveNext = function (event, currentIndex) {
|
|
5510
|
+
event.preventDefault();
|
|
5511
|
+
var items = this.getItemList();
|
|
5512
|
+
var nextIndex = currentIndex + 1;
|
|
5513
|
+
while (nextIndex < items.length && !this.isFocusableItem(items[nextIndex])) {
|
|
5514
|
+
nextIndex++;
|
|
5515
|
+
}
|
|
5516
|
+
if (nextIndex < items.length) {
|
|
5517
|
+
var itemElem = document.getElementById(this.getItemId(items[nextIndex], nextIndex));
|
|
5518
|
+
if (itemElem) {
|
|
5519
|
+
itemElem.focus();
|
|
5520
|
+
}
|
|
5521
|
+
}
|
|
5522
|
+
};
|
|
5523
|
+
NavComponent.prototype.isFocusableItem = function (item) {
|
|
5524
|
+
return !item.active && !item.disabled;
|
|
5525
|
+
};
|
|
4469
5526
|
return NavComponent;
|
|
4470
5527
|
}(AccessibilityComponent));
|
|
4471
5528
|
NavComponent.decorators = [
|
|
4472
5529
|
{ type: i0.Component, args: [{
|
|
4473
5530
|
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"
|
|
5531
|
+
template: "<ng-template #innerHtml>\r\n <ng-container *ngFor=\"let item of getItemList(); index as i\">\r\n <li>\r\n <span *ngIf=\"item.active\"\r\n [class]=\"['flex items-center px-base py-sm font-semibold', item.classes] | makeHtmlList\"\r\n [attr.id]=\"getItemId(item, i)\"\r\n [attr.title]=\"item.title ? item.title : null\"\r\n [attr.role]=\"item.role ? item.role : null\"\r\n [attr.aria-label]=\"item.ariaLabel ? item.ariaLabel : null\"\r\n [attr.aria-describedby]=\"item.ariaDescribedBy ? item.ariaDescribedBy : null\"\r\n [attr.aria-labelledby]=\"item.ariaLabelledBy ? item.ariaLabelledBy : null\"\r\n [attr.aria-hidden]=\"item.ariaHidden ? item.ariaHidden : null\"\r\n [attr.aria-disabled]=\"item.disabled ? item.disabled : null\"\r\n [attr.aria-controls]=\"item.ariaControls ? item.ariaControls : null\"\r\n [attr.aria-current]=\"hasNav ? 'true' : 'page'\"\r\n [attr.aria-live]=\"item.ariaLive ? item.ariaLive : null\"\r\n [attr.aria-expanded]=\"item.ariaExpanded ? item.ariaExpanded : null\"\r\n [attr.aria-errormessage]=\"item.ariaErrorMessage ? item.ariaErrorMessage : null\"\r\n [attr.aria-haspopup]=\"item.ariaHasPopup ? item.ariaHasPopup : null\"\r\n [attr.tabindex]=\"item.tabindex\"\r\n (click)=\"onClick($event, item)\">\r\n <strong>\r\n <ng-container *desyCustomInnerContent=\"{ component: item, html: item.html, text: item.text }\"></ng-container>\r\n </strong>\r\n </span>\r\n <a *ngIf=\"!item.active && item.href\"\r\n [href]=\"item.href | externalHref\" [target]=\"item.target\"\r\n [class]=\"['flex items-center px-base py-sm hover:bg-primary-base hover:text-white focus:bg-warning-base focus:outline-none focus:shadow-outline-focus focus:text-black', item.classes] | makeHtmlList\"\r\n [ngClass]=\"{'pointer-events-none': item.disabled}\"\r\n [attr.aria-disabled]=\"item.disabled ? 'true' : null\"\r\n [attr.tabindex]=\"item.disabled ? -1 : item.tabindex\"\r\n [attr.id]=\"getItemId(item, i)\"\r\n [attr.title]=\"item.title ? item.title : null\"\r\n [attr.role]=\"item.role ? item.role : null\"\r\n [attr.aria-label]=\"item.ariaLabel ? item.ariaLabel : null\"\r\n [attr.aria-describedby]=\"item.ariaDescribedBy ? item.ariaDescribedBy : null\"\r\n [attr.aria-labelledby]=\"item.ariaLabelledBy ? item.ariaLabelledBy : null\"\r\n [attr.aria-hidden]=\"item.ariaHidden ? item.ariaHidden : null\"\r\n [attr.aria-controls]=\"item.ariaControls ? item.ariaControls : null\"\r\n [attr.aria-current]=\"item.ariaCurrent ? item.ariaCurrent : null\"\r\n [attr.aria-live]=\"item.ariaLive ? item.ariaLive : null\"\r\n [attr.aria-expanded]=\"item.ariaExpanded ? item.ariaExpanded : null\"\r\n [attr.aria-errormessage]=\"item.ariaErrorMessage ? item.ariaErrorMessage : null\"\r\n [attr.aria-haspopup]=\"item.ariaHasPopup ? item.ariaHasPopup : null\"\r\n (desyContentEmpty)=\"handleContentEmpty(i)\"\r\n (keydown.arrowUp)=\"movePrevious($event, i)\"\r\n (keydown.arrowDown)=\"moveNext($event, i)\"\r\n (click)=\"onClick($event, item)\">\r\n <ng-container *desyCustomInnerContent=\"{ component: item, html: item.html, text: item.text }\"></ng-container>\r\n <svg #desyContentEmptyIgnore *ngIf=\"item.disabled\" viewBox=\"0 0 140 140\" height=\"1em\" width=\"1em\" xmlns=\"http://www.w3.org/2000/svg\" class=\"inline-block align-middle ml-sm text-neutral-base fill-current\" aria-hidden=\"true\" focusable=\"false\" ><path d=\"M70 0a70 70 0 1070 70A70.08 70.08 0 0070 0zM20 70a50 50 0 0174.8-43.4 2.51 2.51 0 011.23 1.84 2.48 2.48 0 01-.71 2.1L30.54 95.32a2.51 2.51 0 01-3.94-.52A49.63 49.63 0 0120 70zm100 0a50 50 0 01-74.8 43.4 2.51 2.51 0 01-1.23-1.84 2.48 2.48 0 01.71-2.1l64.78-64.78a2.51 2.51 0 013.94.52A49.63 49.63 0 01120 70z\"/></svg>\r\n </a>\r\n <a *ngIf=\"!item.active && !item.href\"\r\n [routerLink]=\"item.routerLink\" [fragment]=\"item.fragment\"\r\n [class]=\"['flex items-center px-base py-sm hover:bg-primary-base hover:text-white focus:bg-warning-base focus:outline-none focus:shadow-outline-focus focus:text-black', item.classes] | makeHtmlList\"\r\n [ngClass]=\"{'pointer-events-none': item.disabled}\"\r\n [attr.aria-disabled]=\"item.disabled ? 'true' : null\"\r\n [attr.tabindex]=\"item.disabled ? -1 : item.tabindex\"\r\n [attr.id]=\"getItemId(item, i)\"\r\n [attr.title]=\"item.title ? item.title : null\"\r\n [attr.role]=\"item.role ? item.role : null\"\r\n [attr.aria-label]=\"item.ariaLabel ? item.ariaLabel : null\"\r\n [attr.aria-describedby]=\"item.ariaDescribedBy ? item.ariaDescribedBy : null\"\r\n [attr.aria-labelledby]=\"item.ariaLabelledBy ? item.ariaLabelledBy : null\"\r\n [attr.aria-hidden]=\"item.ariaHidden ? item.ariaHidden : null\"\r\n [attr.aria-controls]=\"item.ariaControls ? item.ariaControls : null\"\r\n [attr.aria-current]=\"item.ariaCurrent ? item.ariaCurrent : null\"\r\n [attr.aria-live]=\"item.ariaLive ? item.ariaLive : null\"\r\n [attr.aria-expanded]=\"item.ariaExpanded ? item.ariaExpanded : null\"\r\n [attr.aria-errormessage]=\"item.ariaErrorMessage ? item.ariaErrorMessage : null\"\r\n [attr.aria-haspopup]=\"item.ariaHasPopup ? item.ariaHasPopup : null\"\r\n (keydown.arrowUp)=\"movePrevious($event, i)\"\r\n (keydown.arrowDown)=\"moveNext($event, i)\"\r\n (click)=\"onClick($event, item)\"\r\n (desyContentEmpty)=\"handleContentEmpty(i)\">\r\n <ng-container *desyCustomInnerContent=\"{ component: item, html: item.html, text: item.text }\"></ng-container>\r\n <svg #desyContentEmptyIgnore *ngIf=\"item.disabled\" viewBox=\"0 0 140 140\" height=\"1em\" width=\"1em\" xmlns=\"http://www.w3.org/2000/svg\" class=\"inline-block align-middle ml-sm text-neutral-base fill-current\" aria-hidden=\"true\" focusable=\"false\" ><path d=\"M70 0a70 70 0 1070 70A70.08 70.08 0 0070 0zM20 70a50 50 0 0174.8-43.4 2.51 2.51 0 011.23 1.84 2.48 2.48 0 01-.71 2.1L30.54 95.32a2.51 2.51 0 01-3.94-.52A49.63 49.63 0 0120 70zm100 0a50 50 0 01-74.8 43.4 2.51 2.51 0 01-1.23-1.84 2.48 2.48 0 01.71-2.1l64.78-64.78a2.51 2.51 0 013.94.52A49.63 49.63 0 01120 70z\"/></svg>\r\n </a>\r\n </li>\r\n <li *ngIf=\"item.divider\" class=\"my-sm border-b border-neutral-base\" aria-hidden=\"true\">\r\n <div class=\"sr-only\">Separador</div>\r\n </li>\r\n </ng-container>\r\n</ng-template>\r\n\r\n\r\n<ul *ngIf=\"!hasNav; else wrapIntoNav\"\r\n [class]=\"['text-sm', classes] | makeHtmlList\"\r\n [attr.aria-label]=\"ariaLabel ? ariaLabel : null\"\r\n [attr.aria-describedby]=\"ariaDescribedBy ? ariaDescribedBy : null\"\r\n [attr.aria-labelledby]=\"ariaLabelledBy ? ariaLabelledBy : null\"\r\n [attr.aria-hidden]=\"ariaHidden ? ariaHidden : null\"\r\n [attr.aria-disabled]=\"ariaDisabled ? ariaDisabled : null\"\r\n [attr.aria-controls]=\"ariaControls ? ariaControls : null\"\r\n [attr.aria-current]=\"ariaCurrent ? ariaCurrent : null\"\r\n [attr.aria-live]=\"ariaLive ? ariaLive : null\"\r\n [attr.aria-expanded]=\"ariaExpanded ? ariaExpanded : null\"\r\n [attr.aria-errormessage]=\"ariaErrorMessage ? ariaErrorMessage : null\"\r\n [attr.aria-haspopup]=\"ariaHasPopup ? ariaHasPopup : null\"\r\n [attr.tabindex]=\"tabindex ? tabindex : null\">\r\n <ng-container *ngTemplateOutlet=\"innerHtml\"></ng-container>\r\n</ul>\r\n<ng-template #wrapIntoNav>\r\n <nav [class]=\"['text-sm', classes] | makeHtmlList\"\r\n [attr.role]=\"role ? role : null\"\r\n [attr.aria-label]=\"ariaLabel ? ariaLabel : null\"\r\n [attr.aria-describedby]=\"ariaDescribedBy ? ariaDescribedBy : null\"\r\n [attr.aria-labelledby]=\"ariaLabelledBy ? ariaLabelledBy : null\"\r\n [attr.aria-hidden]=\"ariaHidden ? ariaHidden : null\"\r\n [attr.aria-disabled]=\"ariaDisabled ? ariaDisabled : null\"\r\n [attr.aria-controls]=\"ariaControls ? ariaControls : null\"\r\n [attr.aria-current]=\"ariaCurrent ? ariaCurrent : null\"\r\n [attr.aria-live]=\"ariaLive ? ariaLive : null\"\r\n [attr.aria-expanded]=\"ariaExpanded ? ariaExpanded : null\"\r\n [attr.aria-errormessage]=\"ariaErrorMessage ? ariaErrorMessage : null\"\r\n [attr.aria-haspopup]=\"ariaHasPopup ? ariaHasPopup : null\"\r\n [attr.tabindex]=\"tabindex ? tabindex : null\">\r\n <ul>\r\n <ng-container *ngTemplateOutlet=\"innerHtml\"></ng-container>\r\n </ul>\r\n </nav>\r\n</ng-template>\r\n"
|
|
4475
5532
|
},] }
|
|
4476
5533
|
];
|
|
4477
5534
|
NavComponent.propDecorators = {
|
|
@@ -4506,7 +5563,7 @@
|
|
|
4506
5563
|
HeaderSubnavComponent.decorators = [
|
|
4507
5564
|
{ type: i0.Component, args: [{
|
|
4508
5565
|
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 <
|
|
5566
|
+
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
5567
|
},] }
|
|
4511
5568
|
];
|
|
4512
5569
|
HeaderSubnavComponent.propDecorators = {
|
|
@@ -4540,7 +5597,7 @@
|
|
|
4540
5597
|
HeaderDropdownComponent.decorators = [
|
|
4541
5598
|
{ type: i0.Component, args: [{
|
|
4542
5599
|
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-
|
|
5600
|
+
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
5601
|
},] }
|
|
4545
5602
|
];
|
|
4546
5603
|
HeaderDropdownComponent.propDecorators = {
|
|
@@ -4548,11 +5605,15 @@
|
|
|
4548
5605
|
classesContainer: [{ type: i0.Input }],
|
|
4549
5606
|
classesTooltip: [{ type: i0.Input }],
|
|
4550
5607
|
classes: [{ type: i0.Input }],
|
|
4551
|
-
nav: [{ type: i0.ContentChildren, args: [NavComponent,] }]
|
|
5608
|
+
nav: [{ type: i0.ContentChildren, args: [NavComponent,] }],
|
|
5609
|
+
contentComponent: [{ type: i0.ContentChildren, args: [ContentComponent,] }]
|
|
4552
5610
|
};
|
|
4553
5611
|
__decorate([
|
|
4554
5612
|
DesyContentChild({ onSetCallbackName: 'overrideNavParams' })
|
|
4555
|
-
], HeaderDropdownComponent.prototype, "nav", void 0);
|
|
5613
|
+
], HeaderDropdownComponent.prototype, "nav", void 0);
|
|
5614
|
+
__decorate([
|
|
5615
|
+
DesyContentChild()
|
|
5616
|
+
], HeaderDropdownComponent.prototype, "contentComponent", void 0);
|
|
4556
5617
|
|
|
4557
5618
|
var SkipLinkComponent = /** @class */ (function (_super) {
|
|
4558
5619
|
__extends(SkipLinkComponent, _super);
|
|
@@ -5051,7 +6112,7 @@
|
|
|
5051
6112
|
else {
|
|
5052
6113
|
var idPrefix = this.idPrefix ? this.idPrefix : 'nav-item';
|
|
5053
6114
|
if (i === 0) {
|
|
5054
|
-
return idPrefix;
|
|
6115
|
+
return idPrefix + '-0';
|
|
5055
6116
|
}
|
|
5056
6117
|
else {
|
|
5057
6118
|
return idPrefix + '-' + i;
|
|
@@ -5088,12 +6149,21 @@
|
|
|
5088
6149
|
var subItems = sub instanceof MenuVerticalItemSubComponent ? sub.itemComponents.toArray() : sub.items;
|
|
5089
6150
|
return subItems && subItems.length > 0 ? subItems : null;
|
|
5090
6151
|
};
|
|
6152
|
+
MenuVerticalComponent.prototype.focus = function (id, idFocus) {
|
|
6153
|
+
var elementToQuitFocus = document.getElementById(id);
|
|
6154
|
+
elementToQuitFocus.blur();
|
|
6155
|
+
if (idFocus) {
|
|
6156
|
+
var elementToFocus = document.getElementById(idFocus);
|
|
6157
|
+
elementToFocus.tabIndex = 0;
|
|
6158
|
+
elementToFocus === null || elementToFocus === void 0 ? void 0 : elementToFocus.focus();
|
|
6159
|
+
}
|
|
6160
|
+
};
|
|
5091
6161
|
return MenuVerticalComponent;
|
|
5092
6162
|
}(AccessibilityComponent));
|
|
5093
6163
|
MenuVerticalComponent.decorators = [
|
|
5094
6164
|
{ type: i0.Component, args: [{
|
|
5095
6165
|
selector: 'desy-menu-vertical',
|
|
5096
|
-
template: "<!--\r\n Template para ser utilizado tanto por los items como por los subitems:\r\n - item: Item que representa\r\n - index: indice del item en la lista\r\n - id: identificador del item\r\n - isRoot: si pertenece al nivel raiz\r\n-->\r\n<ng-template #itemTemplate let-item=\"item\" let-index=\"index\" let-id=\"id\" let-sub=\"sub\" let-isRoot=\"isRoot\">\r\n <ng-container *ngIf=\"item\">\r\n <li class=\"m-base\" [ngClass]=\"{'origin-top-left text-sm': !isRoot}\">\r\n <ng-container *ngIf=\"item.href || item.routerLink; else notHref\">\r\n <a *ngIf=\"item.href; else hasRouterLink\" [attr.id]=\"id\"\r\n (desyContentEmpty)=\"handleItemContentEmpty(index, isRoot)\"\r\n [href]=\"item.href | externalHref\"\r\n [class]=\"['block px-xs focus:bg-warning-base focus:outline-none focus:shadow-outline-focus focus:text-black', item.classes] | makeHtmlList\"\r\n [ngClass]=\"{\r\n 'underline': hasUnderline,\r\n 'hover:text-primary-base hover:underline': !item.disabled,\r\n 'no-underline pointer-events-none': item.disabled,\r\n 'font-bold': item.active\r\n }\"\r\n [attr.title]=\"item.title\"\r\n [attr.tabindex]=\"item.disabled ? -1 : null\"\r\n [attr.target]=\"item.target ? item.target : null\"\r\n [attr.aria-current]=\"item.active ? 'page' : null\"\r\n [attr.aria-disabled]=\"item.disabled\"\r\n [attr.aria-describedby]=\"item.ariaDescribedBy\"\r\n [attr.aria-errormessage]=\"item.ariaErrorMessage\"\r\n [attr.aria-label]=\"item.ariaLabel\"\r\n [attr.aria-labelledby]=\"item.ariaLabelledBy\"\r\n [attr.aria-hidden]=\"item.ariaHidden\"\r\n [attr.aria-controls]=\"item.ariaControls\"\r\n [attr.aria-live]=\"item.ariaLive\"\r\n [attr.aria-expanded]=\"item.ariaExpanded\"\r\n [attr.aria-haspopup]=\"item.ariaHasPopup\"\r\n [attr.disabled]=\"item.disabled\">\r\n <ng-container *desyCustomInnerContent=\"{ component: item, html: getItemHtml(item), text: item.text }\"></ng-container>\r\n </a>\r\n <ng-template #hasRouterLink>\r\n <!-- Todos los enlaces que admiten o href o routerLink estar\u00EDa bien unificarlos (en todos los componentes).\r\n Para ello, ser\u00EDa necesario crear una directiva para a\u00F1adir o quitar la directiva routerLink si no tiene href.\r\n Sin embargo, esto no es posible actualmente, ya que Angular todav\u00EDa no permite a\u00F1adir directivas din\u00E1micamente:\r\n https://angular.io/guide/roadmap#support-adding-directives-to-host-elements -->\r\n <a [attr.id]=\"id\"\r\n (desyContentEmpty)=\"handleItemContentEmpty(index, isRoot)\"\r\n [routerLink]=\"item.routerLink\" [fragment]=\"item.fragment ? item.fragment : null\"\r\n [routerLinkActive]=\"item.routerLinkActiveClasses ? item.routerLinkActiveClasses : []\"\r\n [class]=\"['block px-xs focus:bg-warning-base focus:outline-none focus:shadow-outline-focus focus:text-black', item.classes] | makeHtmlList\"\r\n [ngClass]=\"{\r\n 'underline': hasUnderline,\r\n 'hover:text-primary-base hover:underline': !item.disabled,\r\n 'no-underline pointer-events-none': item.disabled,\r\n 'font-bold': item.active\r\n }\"\r\n [attr.title]=\"item.title\"\r\n [attr.tabindex]=\"item.disabled ? -1 : null\"\r\n [attr.target]=\"item.target ? item.target : null\"\r\n [attr.aria-current]=\"item.active ? 'page' : null\"\r\n [attr.aria-disabled]=\"item.disabled\"\r\n [attr.aria-describedby]=\"item.ariaDescribedBy\"\r\n [attr.aria-errormessage]=\"item.ariaErrorMessage\"\r\n [attr.aria-label]=\"item.ariaLabel\"\r\n [attr.aria-labelledby]=\"item.ariaLabelledBy\"\r\n [attr.aria-hidden]=\"item.ariaHidden\"\r\n [attr.aria-controls]=\"item.ariaControls\"\r\n [attr.aria-live]=\"item.ariaLive\"\r\n [attr.aria-expanded]=\"item.ariaExpanded\"\r\n [attr.aria-haspopup]=\"item.ariaHasPopup\"\r\n [attr.disabled]=\"item.disabled\">\r\n <ng-container *desyCustomInnerContent=\"{ component: item, html: getItemHtml(item), text: item.text }\"></ng-container>\r\n </a>\r\n </ng-template>\r\n </ng-container>\r\n <ng-template #notHref>\r\n <span [attr.id]=\"id\"\r\n (desyContentEmpty)=\"handleItemContentEmpty(index, isRoot)\"\r\n [class]=\"['block px-xs', item.classes] | makeHtmlList\"\r\n [ngClass]=\"{'font-bold': item.active}\"\r\n\r\n [attr.title]=\"item.title\"\r\n [attr.tabindex]=\"item.disabled ? -1 : null\"\r\n [attr.aria-current]=\"item.active ? 'page' : null\"\r\n [attr.aria-disabled]=\"item.disabled\"\r\n [attr.aria-describedby]=\"item.ariaDescribedBy\"\r\n [attr.aria-errormessage]=\"item.ariaErrorMessage\"\r\n [attr.aria-label]=\"item.ariaLabel\"\r\n [attr.aria-labelledby]=\"item.ariaLabelledBy\"\r\n [attr.aria-hidden]=\"item.ariaHidden\"\r\n [attr.aria-controls]=\"item.ariaControls\"\r\n [attr.aria-live]=\"item.ariaLive\"\r\n [attr.aria-expanded]=\"item.ariaExpanded\"\r\n [attr.aria-haspopup]=\"item.ariaHasPopup\"\r\n [attr.disabled]=\"item.disabled\">\r\n <ng-container *desyCustomInnerContent=\"{ component: item, html: getItemHtml(item), text: item.text }\"></ng-container>\r\n </span>\r\n </ng-template>\r\n <ng-container *ngIf=\"isRoot && sub\">\r\n <ul *ngIf=\"getSubItems(sub)\" [ngClass]=\"sub.classes\"\r\n [attr.aria-describedby]=\"sub.ariaDescribedBy\"\r\n [attr.aria-errormessage]=\"sub.ariaErrorMessage\"\r\n [attr.aria-label]=\"sub.ariaLabel\"\r\n [attr.aria-labelledby]=\"sub.ariaLabelledBy\"\r\n [attr.aria-hidden]=\"sub.ariaHidden\"\r\n [attr.aria-disabled]=\"sub.ariaDisabled\"\r\n [attr.aria-controls]=\"sub.ariaControls\"\r\n [attr.aria-current]=\"sub.ariaCurrent\"\r\n [attr.aria-live]=\"sub.ariaLive\"\r\n [attr.aria-expanded]=\"sub.ariaExpanded\"\r\n [attr.aria-haspopup]=\"sub.ariaHasPopup\"\r\n [attr.tabindex]=\"sub.tabindex\">\r\n <ng-container *ngFor=\"let subItem of getSubItems(sub); index as subIndex\">\r\n <ng-container [ngTemplateOutlet]=\"itemTemplate\"\r\n [ngTemplateOutletContext]=\"{\r\n item: subItem,\r\n id: getSubItemId(item, index, subIndex),\r\n index: subIndex,\r\n isRoot: false\r\n }\">\r\n </ng-container>\r\n </ng-container>\r\n </ul>\r\n <div *ngIf=\"!getSubItems(sub)\"\r\n [class]=\"['mb-base px-xs origin-top-left text-sm text-neutral-dark', sub.classes] | makeHtmlList\"\r\n [id]=\"'sub-' + id\">\r\n <ng-container *desyCustomInnerContent=\"{ component: sub, html: sub.html }\"></ng-container>\r\n </div>\r\n </ng-container>\r\n </li>\r\n <li *ngIf=\"item.divider\" class=\"my-sm border-b border-neutral-base\" aria-hidden=\"true\">\r\n <div class=\"sr-only\">Separador</div>\r\n </li>\r\n </ng-container>\r\n</ng-template>\r\n\r\n<nav [ngClass]=\"classes\"\r\n [attr.role]=\"(role ? role : null)\"\r\n [attr.aria-describedby]=\"ariaDescribedBy\"\r\n [attr.aria-errormessage]=\"ariaErrorMessage\"\r\n [attr.aria-label]=\"ariaLabel\"\r\n [attr.aria-labelledby]=\"ariaLabelledBy\"\r\n [attr.aria-hidden]=\"ariaHidden\"\r\n [attr.aria-disabled]=\"ariaDisabled\"\r\n [attr.aria-controls]=\"ariaControls\"\r\n [attr.aria-current]=\"ariaCurrent\"\r\n [attr.aria-live]=\"ariaLive\"\r\n [attr.aria-expanded]=\"ariaExpanded\"\r\n [attr.aria-haspopup]=\"ariaHasPopup\"\r\n [attr.tabindex]=\"tabindex\">\r\n <ul class=\"text-base\">\r\n <ng-container *ngFor=\"let item of getItems(); index as index\">\r\n <ng-container [ngTemplateOutlet]=\"itemTemplate\"\r\n [ngTemplateOutletContext]=\"{ item: item, id: getId(item, index), index: index, sub: getItemSub(item), isRoot: true }\">\r\n </ng-container>\r\n </ng-container>\r\n </ul>\r\n</nav>\r\n",
|
|
6166
|
+
template: "<!--\r\n Template para ser utilizado tanto por los items como por los subitems:\r\n - item: Item que representa\r\n - index: indice del item en la lista\r\n - id: identificador del item\r\n - isRoot: si pertenece al nivel raiz\r\n-->\r\n<ng-template #itemTemplate let-item=\"item\" let-index=\"index\" let-id=\"id\" let-sub=\"sub\" let-isRoot=\"isRoot\">\r\n <ng-container *ngIf=\"item\">\r\n <li class=\"m-base\" [ngClass]=\"{'origin-top-left text-sm': !isRoot}\">\r\n <ng-container *ngIf=\"item.href || item.routerLink; else notHref\">\r\n <a *ngIf=\"item.href; else hasRouterLink\" [attr.id]=\"id\"\r\n (desyContentEmpty)=\"handleItemContentEmpty(index, isRoot)\"\r\n [href]=\"item.href | externalHref\"\r\n [class]=\"['block px-xs focus:bg-warning-base focus:outline-none focus:shadow-outline-focus focus:text-black', item.classes] | makeHtmlList\"\r\n [ngClass]=\"{\r\n 'underline': hasUnderline,\r\n 'hover:text-primary-base hover:underline': !item.disabled,\r\n 'no-underline pointer-events-none': item.disabled,\r\n 'font-bold': item.active\r\n }\"\r\n [attr.title]=\"item.title\"\r\n [attr.tabindex]=\"item.disabled ? -1 : null\"\r\n [attr.target]=\"item.target ? item.target : null\"\r\n [attr.aria-current]=\"item.active ? 'page' : null\"\r\n [attr.aria-disabled]=\"item.disabled\"\r\n [attr.aria-describedby]=\"item.ariaDescribedBy\"\r\n [attr.aria-errormessage]=\"item.ariaErrorMessage\"\r\n [attr.aria-label]=\"item.ariaLabel\"\r\n [attr.aria-labelledby]=\"item.ariaLabelledBy\"\r\n [attr.aria-hidden]=\"item.ariaHidden\"\r\n [attr.aria-controls]=\"item.ariaControls\"\r\n [attr.aria-live]=\"item.ariaLive\"\r\n [attr.aria-expanded]=\"item.ariaExpanded\"\r\n [attr.aria-haspopup]=\"item.ariaHasPopup\"\r\n [attr.disabled]=\"item.disabled\">\r\n <ng-container *desyCustomInnerContent=\"{ component: item, html: getItemHtml(item), text: item.text }\"></ng-container>\r\n </a>\r\n <ng-template #hasRouterLink>\r\n <!-- Todos los enlaces que admiten o href o routerLink estar\u00EDa bien unificarlos (en todos los componentes).\r\n Para ello, ser\u00EDa necesario crear una directiva para a\u00F1adir o quitar la directiva routerLink si no tiene href.\r\n Sin embargo, esto no es posible actualmente, ya que Angular todav\u00EDa no permite a\u00F1adir directivas din\u00E1micamente:\r\n https://angular.io/guide/roadmap#support-adding-directives-to-host-elements -->\r\n <a [attr.id]=\"id\"\r\n (desyContentEmpty)=\"handleItemContentEmpty(index, isRoot)\"\r\n [routerLink]=\"item.routerLink\" [fragment]=\"item.fragment ? item.fragment : null\"\r\n [routerLinkActive]=\"item.routerLinkActiveClasses ? item.routerLinkActiveClasses : []\"\r\n [class]=\"['block px-xs focus:bg-warning-base focus:outline-none focus:shadow-outline-focus focus:text-black', item.classes] | makeHtmlList\"\r\n [ngClass]=\"{\r\n 'underline': hasUnderline,\r\n 'hover:text-primary-base hover:underline': !item.disabled,\r\n 'no-underline pointer-events-none': item.disabled,\r\n 'font-bold': item.active\r\n }\"\r\n [attr.title]=\"item.title\"\r\n [attr.tabindex]=\"item.disabled ? -1 : null\"\r\n [attr.target]=\"item.target ? item.target : null\"\r\n [attr.aria-current]=\"item.active ? 'page' : null\"\r\n [attr.aria-disabled]=\"item.disabled\"\r\n [attr.aria-describedby]=\"item.ariaDescribedBy\"\r\n [attr.aria-errormessage]=\"item.ariaErrorMessage\"\r\n [attr.aria-label]=\"item.ariaLabel\"\r\n [attr.aria-labelledby]=\"item.ariaLabelledBy\"\r\n [attr.aria-hidden]=\"item.ariaHidden\"\r\n [attr.aria-controls]=\"item.ariaControls\"\r\n [attr.aria-live]=\"item.ariaLive\"\r\n [attr.aria-expanded]=\"item.ariaExpanded\"\r\n [attr.aria-haspopup]=\"item.ariaHasPopup\"\r\n [attr.disabled]=\"item.disabled\"\r\n \r\n (click)=\"focus(id, item.fragment ? item.fragment : null)\">\r\n <ng-container *desyCustomInnerContent=\"{ component: item, html: getItemHtml(item), text: item.text }\"></ng-container>\r\n </a>\r\n </ng-template>\r\n </ng-container>\r\n <ng-template #notHref>\r\n <span [attr.id]=\"id\"\r\n (desyContentEmpty)=\"handleItemContentEmpty(index, isRoot)\"\r\n [class]=\"['block px-xs', item.classes] | makeHtmlList\"\r\n [ngClass]=\"{'font-bold': item.active}\"\r\n\r\n [attr.title]=\"item.title\"\r\n [attr.tabindex]=\"item.disabled ? -1 : null\"\r\n [attr.aria-current]=\"item.active ? 'page' : null\"\r\n [attr.aria-disabled]=\"item.disabled\"\r\n [attr.aria-describedby]=\"item.ariaDescribedBy\"\r\n [attr.aria-errormessage]=\"item.ariaErrorMessage\"\r\n [attr.aria-label]=\"item.ariaLabel\"\r\n [attr.aria-labelledby]=\"item.ariaLabelledBy\"\r\n [attr.aria-hidden]=\"item.ariaHidden\"\r\n [attr.aria-controls]=\"item.ariaControls\"\r\n [attr.aria-live]=\"item.ariaLive\"\r\n [attr.aria-expanded]=\"item.ariaExpanded\"\r\n [attr.aria-haspopup]=\"item.ariaHasPopup\"\r\n [attr.disabled]=\"item.disabled\">\r\n <ng-container *desyCustomInnerContent=\"{ component: item, html: getItemHtml(item), text: item.text }\"></ng-container>\r\n </span>\r\n </ng-template>\r\n <ng-container *ngIf=\"isRoot && sub\">\r\n <ul *ngIf=\"getSubItems(sub)\" [ngClass]=\"sub.classes\"\r\n [attr.aria-describedby]=\"sub.ariaDescribedBy\"\r\n [attr.aria-errormessage]=\"sub.ariaErrorMessage\"\r\n [attr.aria-label]=\"sub.ariaLabel\"\r\n [attr.aria-labelledby]=\"sub.ariaLabelledBy\"\r\n [attr.aria-hidden]=\"sub.ariaHidden\"\r\n [attr.aria-disabled]=\"sub.ariaDisabled\"\r\n [attr.aria-controls]=\"sub.ariaControls\"\r\n [attr.aria-current]=\"sub.ariaCurrent\"\r\n [attr.aria-live]=\"sub.ariaLive\"\r\n [attr.aria-expanded]=\"sub.ariaExpanded\"\r\n [attr.aria-haspopup]=\"sub.ariaHasPopup\"\r\n [attr.tabindex]=\"sub.tabindex\">\r\n <ng-container *ngFor=\"let subItem of getSubItems(sub); index as subIndex\">\r\n <ng-container [ngTemplateOutlet]=\"itemTemplate\"\r\n [ngTemplateOutletContext]=\"{\r\n item: subItem,\r\n id: getSubItemId(item, index, subIndex),\r\n index: subIndex,\r\n isRoot: false\r\n }\">\r\n </ng-container>\r\n </ng-container>\r\n </ul>\r\n <div *ngIf=\"!getSubItems(sub)\"\r\n [class]=\"['mb-base px-xs origin-top-left text-sm text-neutral-dark', sub.classes] | makeHtmlList\"\r\n [id]=\"'sub-' + id\">\r\n <ng-container *desyCustomInnerContent=\"{ component: sub, html: sub.html }\"></ng-container>\r\n </div>\r\n </ng-container>\r\n </li>\r\n <li *ngIf=\"item.divider\" class=\"my-sm border-b border-neutral-base\" aria-hidden=\"true\">\r\n <div class=\"sr-only\">Separador</div>\r\n </li>\r\n </ng-container>\r\n</ng-template>\r\n\r\n<nav [ngClass]=\"classes\"\r\n [attr.role]=\"(role ? role : null)\"\r\n [attr.aria-describedby]=\"ariaDescribedBy\"\r\n [attr.aria-errormessage]=\"ariaErrorMessage\"\r\n [attr.aria-label]=\"ariaLabel\"\r\n [attr.aria-labelledby]=\"ariaLabelledBy\"\r\n [attr.aria-hidden]=\"ariaHidden\"\r\n [attr.aria-disabled]=\"ariaDisabled\"\r\n [attr.aria-controls]=\"ariaControls\"\r\n [attr.aria-current]=\"ariaCurrent\"\r\n [attr.aria-live]=\"ariaLive\"\r\n [attr.aria-expanded]=\"ariaExpanded\"\r\n [attr.aria-haspopup]=\"ariaHasPopup\"\r\n [attr.tabindex]=\"tabindex\">\r\n <ul class=\"text-base\">\r\n <ng-container *ngFor=\"let item of getItems(); index as index\">\r\n <ng-container [ngTemplateOutlet]=\"itemTemplate\"\r\n [ngTemplateOutletContext]=\"{ item: item, id: getId(item, index), index: index, sub: getItemSub(item), isRoot: true }\">\r\n </ng-container>\r\n </ng-container>\r\n </ul>\r\n</nav>\r\n",
|
|
5097
6167
|
animations: [
|
|
5098
6168
|
animations.trigger('displayMenuVertical', [
|
|
5099
6169
|
animations.state('void', animations.style({
|
|
@@ -6171,67 +7241,6 @@
|
|
|
6171
7241
|
DesyContentChild()
|
|
6172
7242
|
], TableComponent.prototype, "headerComponent", void 0);
|
|
6173
7243
|
|
|
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
7244
|
exports.OrderBy = void 0;
|
|
6236
7245
|
(function (OrderBy) {
|
|
6237
7246
|
OrderBy["none"] = "none";
|
|
@@ -8238,6 +9247,11 @@
|
|
|
8238
9247
|
DateInputDayComponent,
|
|
8239
9248
|
DateInputMonthComponent,
|
|
8240
9249
|
DateInputYearComponent,
|
|
9250
|
+
TreeComponent,
|
|
9251
|
+
TreeSubComponent,
|
|
9252
|
+
TreeItemComponent,
|
|
9253
|
+
TreeCheckboxComponent,
|
|
9254
|
+
TreeItemsGeneratorComponent,
|
|
8241
9255
|
ConditionDirective,
|
|
8242
9256
|
],
|
|
8243
9257
|
imports: [
|
|
@@ -8274,6 +9288,10 @@
|
|
|
8274
9288
|
DateInputDayComponent,
|
|
8275
9289
|
DateInputMonthComponent,
|
|
8276
9290
|
DateInputYearComponent,
|
|
9291
|
+
TreeComponent,
|
|
9292
|
+
TreeSubComponent,
|
|
9293
|
+
TreeItemComponent,
|
|
9294
|
+
TreeItemsGeneratorComponent,
|
|
8277
9295
|
ConditionDirective
|
|
8278
9296
|
]
|
|
8279
9297
|
},] }
|
|
@@ -8475,6 +9493,80 @@
|
|
|
8475
9493
|
},] }
|
|
8476
9494
|
];
|
|
8477
9495
|
|
|
9496
|
+
var ToggleOffStateComponent = /** @class */ (function (_super) {
|
|
9497
|
+
__extends(ToggleOffStateComponent, _super);
|
|
9498
|
+
function ToggleOffStateComponent() {
|
|
9499
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
9500
|
+
}
|
|
9501
|
+
return ToggleOffStateComponent;
|
|
9502
|
+
}(AccessibilityComponent));
|
|
9503
|
+
ToggleOffStateComponent.decorators = [
|
|
9504
|
+
{ type: i0.Component, args: [{
|
|
9505
|
+
selector: 'desy-toggle-off-state',
|
|
9506
|
+
template: "<ng-template #contentTemplateOffState>\r\n <ng-content></ng-content>\r\n</ng-template>"
|
|
9507
|
+
},] }
|
|
9508
|
+
];
|
|
9509
|
+
ToggleOffStateComponent.propDecorators = {
|
|
9510
|
+
content: [{ type: i0.ViewChild, args: ['contentTemplateOffState', { static: true },] }],
|
|
9511
|
+
classes: [{ type: i0.Input }]
|
|
9512
|
+
};
|
|
9513
|
+
|
|
9514
|
+
var ToggleOnStateComponent = /** @class */ (function (_super) {
|
|
9515
|
+
__extends(ToggleOnStateComponent, _super);
|
|
9516
|
+
function ToggleOnStateComponent() {
|
|
9517
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
9518
|
+
}
|
|
9519
|
+
return ToggleOnStateComponent;
|
|
9520
|
+
}(AccessibilityComponent));
|
|
9521
|
+
ToggleOnStateComponent.decorators = [
|
|
9522
|
+
{ type: i0.Component, args: [{
|
|
9523
|
+
selector: 'desy-toggle-on-state',
|
|
9524
|
+
template: "<ng-template #contentTemplateOnState>\r\n <ng-content></ng-content>\r\n</ng-template>"
|
|
9525
|
+
},] }
|
|
9526
|
+
];
|
|
9527
|
+
ToggleOnStateComponent.propDecorators = {
|
|
9528
|
+
content: [{ type: i0.ViewChild, args: ['contentTemplateOnState', { static: true },] }],
|
|
9529
|
+
classes: [{ type: i0.Input }]
|
|
9530
|
+
};
|
|
9531
|
+
|
|
9532
|
+
var ToggleComponent = /** @class */ (function (_super) {
|
|
9533
|
+
__extends(ToggleComponent, _super);
|
|
9534
|
+
function ToggleComponent() {
|
|
9535
|
+
var _this = _super.apply(this, __spread(arguments)) || this;
|
|
9536
|
+
_this.clickEvent = new i0.EventEmitter();
|
|
9537
|
+
_this.pressedChange = new i0.EventEmitter();
|
|
9538
|
+
return _this;
|
|
9539
|
+
}
|
|
9540
|
+
ToggleComponent.prototype.onClick = function (event) {
|
|
9541
|
+
this.pressed = !this.pressed;
|
|
9542
|
+
this.pressedChange.emit(this.pressed);
|
|
9543
|
+
this.clickEvent.emit(event);
|
|
9544
|
+
};
|
|
9545
|
+
return ToggleComponent;
|
|
9546
|
+
}(AccessibilityComponent));
|
|
9547
|
+
ToggleComponent.decorators = [
|
|
9548
|
+
{ type: i0.Component, args: [{
|
|
9549
|
+
selector: 'desy-toggle',
|
|
9550
|
+
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 -->"
|
|
9551
|
+
},] }
|
|
9552
|
+
];
|
|
9553
|
+
ToggleComponent.propDecorators = {
|
|
9554
|
+
id: [{ type: i0.Input }],
|
|
9555
|
+
isSwitch: [{ type: i0.Input }],
|
|
9556
|
+
pressed: [{ type: i0.Input }],
|
|
9557
|
+
classes: [{ type: i0.Input }],
|
|
9558
|
+
clickEvent: [{ type: i0.Output }],
|
|
9559
|
+
pressedChange: [{ type: i0.Output }],
|
|
9560
|
+
contentTemplateOnState: [{ type: i0.ContentChildren, args: [ToggleOnStateComponent,] }],
|
|
9561
|
+
contentTemplateOffState: [{ type: i0.ContentChildren, args: [ToggleOffStateComponent,] }]
|
|
9562
|
+
};
|
|
9563
|
+
__decorate([
|
|
9564
|
+
DesyContentChild()
|
|
9565
|
+
], ToggleComponent.prototype, "contentTemplateOnState", void 0);
|
|
9566
|
+
__decorate([
|
|
9567
|
+
DesyContentChild()
|
|
9568
|
+
], ToggleComponent.prototype, "contentTemplateOffState", void 0);
|
|
9569
|
+
|
|
8478
9570
|
var DesyButtonsModule = /** @class */ (function () {
|
|
8479
9571
|
function DesyButtonsModule() {
|
|
8480
9572
|
}
|
|
@@ -8489,7 +9581,10 @@
|
|
|
8489
9581
|
ListboxComponent,
|
|
8490
9582
|
PillComponent,
|
|
8491
9583
|
ListboxItemComponent,
|
|
8492
|
-
ListboxLabelComponent
|
|
9584
|
+
ListboxLabelComponent,
|
|
9585
|
+
ToggleComponent,
|
|
9586
|
+
ToggleOnStateComponent,
|
|
9587
|
+
ToggleOffStateComponent
|
|
8493
9588
|
],
|
|
8494
9589
|
imports: [
|
|
8495
9590
|
common.CommonModule,
|
|
@@ -8504,7 +9599,10 @@
|
|
|
8504
9599
|
ListboxComponent,
|
|
8505
9600
|
PillComponent,
|
|
8506
9601
|
ListboxItemComponent,
|
|
8507
|
-
ListboxLabelComponent
|
|
9602
|
+
ListboxLabelComponent,
|
|
9603
|
+
ToggleComponent,
|
|
9604
|
+
ToggleOnStateComponent,
|
|
9605
|
+
ToggleOffStateComponent
|
|
8508
9606
|
]
|
|
8509
9607
|
},] }
|
|
8510
9608
|
];
|
|
@@ -8932,17 +10030,26 @@
|
|
|
8932
10030
|
exports.TextareaComponent = TextareaComponent;
|
|
8933
10031
|
exports.TitleComponent = TitleComponent;
|
|
8934
10032
|
exports.TooltipContentComponent = TooltipContentComponent;
|
|
10033
|
+
exports.TreeComponent = TreeComponent;
|
|
10034
|
+
exports.TreeItemComponent = TreeItemComponent;
|
|
10035
|
+
exports.TreeItemsGeneratorComponent = TreeItemsGeneratorComponent;
|
|
10036
|
+
exports.TreeSubComponent = TreeSubComponent;
|
|
8935
10037
|
exports.summaryTextOrSummaryHtmlRequiredFunction = summaryTextOrSummaryHtmlRequiredFunction;
|
|
8936
10038
|
exports.ɵa = AccessibilityComponent;
|
|
8937
10039
|
exports.ɵb = AccessibilityAndContentRequiredComponent;
|
|
8938
|
-
exports.ɵba =
|
|
8939
|
-
exports.ɵbb =
|
|
8940
|
-
exports.ɵbc =
|
|
8941
|
-
exports.ɵbd =
|
|
8942
|
-
exports.ɵbe =
|
|
8943
|
-
exports.ɵbf =
|
|
8944
|
-
exports.ɵbg =
|
|
8945
|
-
exports.ɵbh =
|
|
10040
|
+
exports.ɵba = AttributeChangeDirective;
|
|
10041
|
+
exports.ɵbb = InnerContentDirective;
|
|
10042
|
+
exports.ɵbc = ClickOutsideDirective;
|
|
10043
|
+
exports.ɵbd = ContentChangeDirective;
|
|
10044
|
+
exports.ɵbe = ContentEmptyDirective;
|
|
10045
|
+
exports.ɵbf = CustomInnerContentDirective;
|
|
10046
|
+
exports.ɵbg = TooltipComponent;
|
|
10047
|
+
exports.ɵbh = TemplateDrivenWrapperComponent;
|
|
10048
|
+
exports.ɵbi = DateInputDividerComponent;
|
|
10049
|
+
exports.ɵbj = DateInputDayComponent;
|
|
10050
|
+
exports.ɵbk = DateInputMonthComponent;
|
|
10051
|
+
exports.ɵbl = DateInputYearComponent;
|
|
10052
|
+
exports.ɵbm = FocusClickedCellDirective;
|
|
8946
10053
|
exports.ɵc = AccessibilityAndTextOrHtmlRequiredComponent;
|
|
8947
10054
|
exports.ɵd = DesyContentChild;
|
|
8948
10055
|
exports.ɵe = ContentBaseComponent;
|
|
@@ -8951,22 +10058,22 @@
|
|
|
8951
10058
|
exports.ɵh = DesyOnInputChange;
|
|
8952
10059
|
exports.ɵi = InputGroupItemComponent;
|
|
8953
10060
|
exports.ɵj = DateInputItemComponent;
|
|
8954
|
-
exports.ɵk =
|
|
8955
|
-
exports.ɵl =
|
|
8956
|
-
exports.ɵm =
|
|
8957
|
-
exports.ɵn =
|
|
8958
|
-
exports.ɵo =
|
|
8959
|
-
exports.ɵp =
|
|
8960
|
-
exports.ɵq =
|
|
8961
|
-
exports.ɵr =
|
|
8962
|
-
exports.ɵs =
|
|
8963
|
-
exports.ɵt =
|
|
8964
|
-
exports.ɵu =
|
|
8965
|
-
exports.ɵv =
|
|
8966
|
-
exports.ɵw =
|
|
8967
|
-
exports.ɵx =
|
|
8968
|
-
exports.ɵy =
|
|
8969
|
-
exports.ɵz =
|
|
10061
|
+
exports.ɵk = ITreeItem;
|
|
10062
|
+
exports.ɵl = TreeCheckboxComponent;
|
|
10063
|
+
exports.ɵm = HeaderNavigationItemComponent;
|
|
10064
|
+
exports.ɵn = MenubaritemDirective;
|
|
10065
|
+
exports.ɵo = RowDirective;
|
|
10066
|
+
exports.ɵp = CellDirective;
|
|
10067
|
+
exports.ɵq = TabItemComponent;
|
|
10068
|
+
exports.ɵr = PanelComponent;
|
|
10069
|
+
exports.ɵs = ToggleComponent;
|
|
10070
|
+
exports.ɵt = ToggleOnStateComponent;
|
|
10071
|
+
exports.ɵu = ToggleOffStateComponent;
|
|
10072
|
+
exports.ɵv = SharedModule;
|
|
10073
|
+
exports.ɵw = TextOrHtmlRequiredComponent;
|
|
10074
|
+
exports.ɵx = InnerHtmlPipe;
|
|
10075
|
+
exports.ɵy = MakeHtmlListPipe;
|
|
10076
|
+
exports.ɵz = ExternalHrefPipe;
|
|
8970
10077
|
|
|
8971
10078
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
8972
10079
|
|