desy-angular 5.0.0 → 5.1.2
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 +1454 -344
- 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/dropdown/dropdown.component.js +70 -70
- package/esm2015/lib/desy-buttons/components/listbox/listbox-label/listbox-label.component.js +6 -15
- package/esm2015/lib/desy-buttons/components/listbox/listbox.component.js +67 -55
- 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 +370 -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 +3 -3
- package/esm2015/lib/desy-nav/components/menubar/menubar.component.js +1 -1
- package/esm2015/lib/desy-nav/components/nav/nav.component.js +38 -2
- package/esm2015/lib/desy-pagination/components/pagination/pagination.component.js +2 -2
- package/esm2015/public-api.js +5 -1
- package/fesm2015/desy-angular.js +1361 -309
- package/fesm2015/desy-angular.js.map +1 -1
- package/lib/desy-buttons/components/dropdown/dropdown.component.d.ts +4 -7
- package/lib/desy-buttons/components/listbox/listbox-label/listbox-label.component.d.ts +2 -6
- package/lib/desy-buttons/components/listbox/listbox.component.d.ts +1 -2
- 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 +87 -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/nav/nav.component.d.ts +4 -0
- package/package.json +2 -2
- package/public-api.d.ts +4 -0
|
@@ -700,101 +700,100 @@
|
|
|
700
700
|
function DropdownComponent() {
|
|
701
701
|
var _this = _super.apply(this, __spread(arguments)) || this;
|
|
702
702
|
_this.clickEvent = new i0.EventEmitter();
|
|
703
|
-
_this.
|
|
703
|
+
_this.isOpen = false;
|
|
704
704
|
_this.clickOutsideEnabled = false;
|
|
705
705
|
return _this;
|
|
706
706
|
}
|
|
707
707
|
DropdownComponent.prototype.ngOnInit = function () {
|
|
708
|
-
var
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
onHide: function () {
|
|
740
|
-
document.removeEventListener('keydown', onKeyDown);
|
|
741
|
-
},
|
|
742
|
-
};
|
|
743
|
-
},
|
|
744
|
-
}],
|
|
745
|
-
role: false,
|
|
746
|
-
aria: {
|
|
747
|
-
content: 'auto',
|
|
748
|
-
},
|
|
749
|
-
onShown: function (instance) {
|
|
750
|
-
var firstFocusable = FocusUtils.getFirstFocusableElement(contentTooltip);
|
|
751
|
-
if (firstFocusable) {
|
|
752
|
-
setTimeout(function () { return firstFocusable.focus(); });
|
|
708
|
+
var contentTooltip;
|
|
709
|
+
if (this.dropdownContent && this.dropdownContent.nativeElement) {
|
|
710
|
+
contentTooltip = this.dropdownContent.nativeElement;
|
|
711
|
+
contentTooltip.style.display = 'block';
|
|
712
|
+
this.tippyProperties = {
|
|
713
|
+
placement: 'bottom-start',
|
|
714
|
+
inlinePositioning: true,
|
|
715
|
+
content: contentTooltip,
|
|
716
|
+
allowHTML: true,
|
|
717
|
+
trigger: 'click',
|
|
718
|
+
hideOnClick: true,
|
|
719
|
+
interactive: true,
|
|
720
|
+
arrow: false,
|
|
721
|
+
offset: [0, -10],
|
|
722
|
+
theme: '',
|
|
723
|
+
plugins: [
|
|
724
|
+
{
|
|
725
|
+
name: 'hideOnPopperBlur',
|
|
726
|
+
defaultValue: true,
|
|
727
|
+
fn: function (instance) {
|
|
728
|
+
return {
|
|
729
|
+
onCreate: function () {
|
|
730
|
+
instance.popper.addEventListener('focusout', function (event) {
|
|
731
|
+
if (instance.props.hideOnPopperBlur &&
|
|
732
|
+
event.relatedTarget &&
|
|
733
|
+
!instance.popper.contains(event.relatedTarget)) {
|
|
734
|
+
instance.hide();
|
|
735
|
+
}
|
|
736
|
+
});
|
|
737
|
+
},
|
|
738
|
+
};
|
|
753
739
|
}
|
|
740
|
+
},
|
|
741
|
+
{
|
|
742
|
+
name: 'hideOnEsc',
|
|
743
|
+
defaultValue: true,
|
|
744
|
+
fn: function (_a) {
|
|
745
|
+
var hide = _a.hide;
|
|
746
|
+
function onKeyDown(event) {
|
|
747
|
+
if (event.key === DropdownComponent.KEY_CODE_ESC) {
|
|
748
|
+
hide();
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
return {
|
|
752
|
+
onShow: function () {
|
|
753
|
+
document.addEventListener('keydown', onKeyDown);
|
|
754
|
+
},
|
|
755
|
+
onHide: function () {
|
|
756
|
+
document.removeEventListener('keydown', onKeyDown);
|
|
757
|
+
},
|
|
758
|
+
};
|
|
759
|
+
},
|
|
754
760
|
}
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
761
|
+
],
|
|
762
|
+
role: false,
|
|
763
|
+
aria: {
|
|
764
|
+
content: 'auto',
|
|
765
|
+
},
|
|
766
|
+
onShown: function (instance) {
|
|
767
|
+
var firstFocusable = FocusUtils.getFirstFocusableElement(contentTooltip);
|
|
768
|
+
if (firstFocusable) {
|
|
769
|
+
firstFocusable.focus();
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
};
|
|
762
773
|
}
|
|
763
774
|
};
|
|
764
775
|
DropdownComponent.prototype.onClick = function (event) {
|
|
765
776
|
if (!this.isDisabled()) {
|
|
766
|
-
this.toggleDropdown();
|
|
767
777
|
this.clickEvent.emit(event);
|
|
768
778
|
}
|
|
769
779
|
};
|
|
770
|
-
DropdownComponent.prototype.
|
|
771
|
-
|
|
772
|
-
this.show = !this.show;
|
|
773
|
-
setTimeout(function () { return _this.clickOutsideEnabled = _this.show; });
|
|
774
|
-
};
|
|
775
|
-
DropdownComponent.prototype.closeDropdown = function () {
|
|
776
|
-
this.show = false;
|
|
777
|
-
this.clickOutsideEnabled = false;
|
|
780
|
+
DropdownComponent.prototype.setOpen = function (isOpen) {
|
|
781
|
+
this.isOpen = isOpen;
|
|
778
782
|
};
|
|
779
783
|
DropdownComponent.prototype.isDisabled = function () {
|
|
780
784
|
return this.disabled ? true : null;
|
|
781
785
|
};
|
|
782
|
-
DropdownComponent.prototype.onKeyDown = function (event) {
|
|
783
|
-
if (event.key === DropdownComponent.KEY_CODE_ESC) {
|
|
784
|
-
this.closeDropdown();
|
|
785
|
-
}
|
|
786
|
-
};
|
|
787
786
|
return DropdownComponent;
|
|
788
787
|
}(AccessibilityAndContentRequiredComponent));
|
|
789
788
|
DropdownComponent.KEY_CODE_ESC = 'Escape';
|
|
790
789
|
DropdownComponent.decorators = [
|
|
791
790
|
{ type: i0.Component, args: [{
|
|
792
791
|
selector: 'desy-dropdown',
|
|
793
|
-
template: "
|
|
792
|
+
template: "<div [class]=\"classesContainer ? classesContainer : 'relative'\"\r\n (desyContentEmpty)=\"setOpen(false)\" (desyContentNotEmpty)=\"setOpen(true)\">\r\n <button #desyContentEmptyIgnore (click)=\"onClick($event)\"\r\n ngxTippy [tippyProps]=\"tippyProperties\"\r\n [class]=\"['c-dropdown', classes] | makeHtmlList\"\r\n [attr.disabled]=\"isDisabled() ? 'disabled' : null\"\r\n aria-haspopup=\"true\"\r\n [attr.aria-disabled]=\"isDisabled() ? 'true' : (ariaDisabled ? ariaDisabled : null)\"\r\n [attr.aria-expanded]=\"isOpen\"\r\n [attr.aria-describedby]=\"ariaDescribedBy ? ariaDescribedBy : null\"\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-labelledby]=\"ariaLabelledBy ? ariaLabelledBy : null\"\r\n [attr.aria-hidden]=\"ariaHidden ? ariaHidden : 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-errormessage]=\"ariaErrorMessage ? ariaErrorMessage : null\"\r\n [attr.tabIndex]=\"isDisabled() ? '-1' : tabindex\">\r\n <span class=\"inline-flex self-center max-w-xs align-middle truncate\">\r\n <ng-container *desyCustomInnerContent=\"{ html: html, text: text }\"></ng-container>\r\n <ng-content></ng-content>\r\n </span>\r\n <svg class=\"inline-block -mr-2 align-middle -my-px\" viewBox=\"0 0 96 96\" aria-hidden=\"true\" fill=\"currentColor\" focusable=\"false\" width=\"1.5em\" height=\"1.5em\"><g><path d=\"M46.71 58.037a1.823 1.823 0 002.581 0L62.048 45.28a1.823 1.823 0 00-1.29-3.113H35.243a1.823 1.823 0 00-1.291 3.113z\"/></g></svg>\r\n </button>\r\n <span *ngIf=\"hiddenText\" #desyContentEmptyIgnore class=\"sr-only\">{{ hiddenText }}</span>\r\n <div #dropdownContent style=\"display: none;\"\r\n [class]=\"['-ml-sm mt-2 border border-neutral-base shadow-md bg-white', classesTooltip] | makeHtmlList\">\r\n <ng-container *ngTemplateOutlet=\"caller\"></ng-container>\r\n </div>\r\n</div>\r\n"
|
|
794
793
|
},] }
|
|
795
794
|
];
|
|
796
795
|
DropdownComponent.propDecorators = {
|
|
797
|
-
dropdownContent: [{ type: i0.ViewChild, args: ['dropdownContent', { read: i0.ElementRef },] }],
|
|
796
|
+
dropdownContent: [{ type: i0.ViewChild, args: ['dropdownContent', { read: i0.ElementRef, static: true },] }],
|
|
798
797
|
id: [{ type: i0.Input }],
|
|
799
798
|
disabled: [{ type: i0.Input }],
|
|
800
799
|
hiddenText: [{ type: i0.Input }],
|
|
@@ -802,8 +801,7 @@
|
|
|
802
801
|
classesTooltip: [{ type: i0.Input }],
|
|
803
802
|
classes: [{ type: i0.Input }],
|
|
804
803
|
caller: [{ type: i0.Input }],
|
|
805
|
-
clickEvent: [{ type: i0.Output }]
|
|
806
|
-
onKeyDown: [{ type: i0.HostListener, args: ['window:keydown', ['$event'],] }]
|
|
804
|
+
clickEvent: [{ type: i0.Output }]
|
|
807
805
|
};
|
|
808
806
|
|
|
809
807
|
/**
|
|
@@ -827,28 +825,21 @@
|
|
|
827
825
|
return StringUtils;
|
|
828
826
|
}());
|
|
829
827
|
|
|
830
|
-
var ListboxLabelComponent = /** @class */ (function () {
|
|
828
|
+
var ListboxLabelComponent = /** @class */ (function (_super) {
|
|
829
|
+
__extends(ListboxLabelComponent, _super);
|
|
831
830
|
function ListboxLabelComponent() {
|
|
832
|
-
this
|
|
831
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
833
832
|
}
|
|
834
|
-
ListboxLabelComponent.prototype.ngOnInit = function () {
|
|
835
|
-
var _this = this;
|
|
836
|
-
setTimeout(function () { return _this.isInit = !!_this.content; });
|
|
837
|
-
};
|
|
838
|
-
ListboxLabelComponent.prototype.getContent = function () {
|
|
839
|
-
return this.isInit ? this.content : null;
|
|
840
|
-
};
|
|
841
833
|
return ListboxLabelComponent;
|
|
842
|
-
}());
|
|
834
|
+
}(ContentBaseComponent));
|
|
843
835
|
ListboxLabelComponent.decorators = [
|
|
844
836
|
{ type: i0.Component, args: [{
|
|
845
837
|
selector: 'desy-listbox-label',
|
|
846
|
-
template: "<ng-template #
|
|
838
|
+
template: "<ng-template #contentTemplate>\r\n <ng-content></ng-content>\r\n</ng-template>\r\n"
|
|
847
839
|
},] }
|
|
848
840
|
];
|
|
849
841
|
ListboxLabelComponent.propDecorators = {
|
|
850
|
-
classes: [{ type: i0.Input }]
|
|
851
|
-
content: [{ type: i0.ViewChild, args: ['childComponentTemplate',] }]
|
|
842
|
+
classes: [{ type: i0.Input }]
|
|
852
843
|
};
|
|
853
844
|
|
|
854
845
|
var ListboxItemComponent = /** @class */ (function (_super) {
|
|
@@ -925,54 +916,72 @@
|
|
|
925
916
|
var _this = _super.apply(this, __spread(arguments)) || this;
|
|
926
917
|
_this.itemsChange = new i0.EventEmitter();
|
|
927
918
|
_this.activeItemChange = new i0.EventEmitter();
|
|
928
|
-
_this.isListVisible = false;
|
|
919
|
+
_this.isListVisible = false; // Indica si la lista se está mostrando
|
|
929
920
|
return _this;
|
|
930
921
|
}
|
|
931
922
|
ListboxComponent.prototype.ngOnInit = function () {
|
|
932
|
-
var
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
function
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
},
|
|
964
|
-
};
|
|
965
|
-
},
|
|
966
|
-
}],
|
|
967
|
-
role: false,
|
|
968
|
-
aria: {
|
|
969
|
-
content: 'auto',
|
|
923
|
+
var listboxButtonElement = this.listboxButton.nativeElement;
|
|
924
|
+
if (this.listboxContent && this.listboxContent.nativeElement) {
|
|
925
|
+
var contentTooltip = this.listboxContent.nativeElement;
|
|
926
|
+
this.tippyProperties = {
|
|
927
|
+
placement: 'bottom-start',
|
|
928
|
+
inlinePositioning: true,
|
|
929
|
+
content: contentTooltip,
|
|
930
|
+
allowHTML: true,
|
|
931
|
+
trigger: 'click',
|
|
932
|
+
hideOnClick: true,
|
|
933
|
+
interactive: true,
|
|
934
|
+
arrow: false,
|
|
935
|
+
offset: [0, -10],
|
|
936
|
+
theme: '',
|
|
937
|
+
plugins: [
|
|
938
|
+
{
|
|
939
|
+
name: 'hideOnPopperBlur',
|
|
940
|
+
defaultValue: true,
|
|
941
|
+
fn: function (instance) {
|
|
942
|
+
return {
|
|
943
|
+
onCreate: function () {
|
|
944
|
+
instance.popper.addEventListener('focusout', function (event) {
|
|
945
|
+
if (instance.props.hideOnPopperBlur &&
|
|
946
|
+
event.relatedTarget &&
|
|
947
|
+
!instance.popper.contains(event.relatedTarget)) {
|
|
948
|
+
instance.hide();
|
|
949
|
+
}
|
|
950
|
+
});
|
|
951
|
+
},
|
|
952
|
+
};
|
|
953
|
+
}
|
|
970
954
|
},
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
955
|
+
{
|
|
956
|
+
name: 'hideOnEsc',
|
|
957
|
+
defaultValue: true,
|
|
958
|
+
fn: function (_a) {
|
|
959
|
+
var hide = _a.hide;
|
|
960
|
+
function onKeyDown(event) {
|
|
961
|
+
if (event.key === ListboxComponent.KEY_CODE_ESC) {
|
|
962
|
+
hide();
|
|
963
|
+
listboxButtonElement.focus();
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
return {
|
|
967
|
+
onShow: function () {
|
|
968
|
+
document.addEventListener('keydown', onKeyDown);
|
|
969
|
+
},
|
|
970
|
+
onHide: function () {
|
|
971
|
+
document.removeEventListener('keydown', onKeyDown);
|
|
972
|
+
},
|
|
973
|
+
};
|
|
974
|
+
},
|
|
975
|
+
}
|
|
976
|
+
],
|
|
977
|
+
role: false,
|
|
978
|
+
aria: {
|
|
979
|
+
content: 'auto',
|
|
980
|
+
},
|
|
981
|
+
onShow: this.onListShow.bind(this),
|
|
982
|
+
onHidden: this.onListClose.bind(this)
|
|
983
|
+
};
|
|
984
|
+
}
|
|
976
985
|
};
|
|
977
986
|
ListboxComponent.prototype.ngOnChanges = function () {
|
|
978
987
|
var _this = this;
|
|
@@ -1086,11 +1095,11 @@
|
|
|
1086
1095
|
if (this.doesChangeButtonText && !this.isMultiselectable && activeItems.length > 0) {
|
|
1087
1096
|
var activeItemOption = this.listboxOptions.find(function (item, index) { return index === activeItems[0].index; });
|
|
1088
1097
|
if (activeItemOption) {
|
|
1089
|
-
this.
|
|
1098
|
+
this.buttonContentHtml = activeItemOption.nativeElement.innerHTML;
|
|
1090
1099
|
}
|
|
1091
1100
|
}
|
|
1092
1101
|
else {
|
|
1093
|
-
this.
|
|
1102
|
+
this.buttonContentHtml = this.html ? this.html : null;
|
|
1094
1103
|
}
|
|
1095
1104
|
// Si hay cambios, se emiten
|
|
1096
1105
|
if (hasActiveItemChange) {
|
|
@@ -1107,9 +1116,6 @@
|
|
|
1107
1116
|
};
|
|
1108
1117
|
ListboxComponent.prototype.onListClose = function () {
|
|
1109
1118
|
this.isListVisible = false;
|
|
1110
|
-
if (this.listboxButton) {
|
|
1111
|
-
this.listboxButton.nativeElement.focus();
|
|
1112
|
-
}
|
|
1113
1119
|
};
|
|
1114
1120
|
ListboxComponent.prototype.onListFocus = function () {
|
|
1115
1121
|
var activeItemsData = this.getActiveItemsData();
|
|
@@ -1183,23 +1189,19 @@
|
|
|
1183
1189
|
ListboxComponent.prototype.getLabelContent = function (label) {
|
|
1184
1190
|
return label.html ? label.html : "<p>" + StringUtils.escapeHtml(label.text) + "</p>";
|
|
1185
1191
|
};
|
|
1186
|
-
ListboxComponent.prototype.isButtonContentHtml = function () {
|
|
1187
|
-
var activeItemsData = this.getActiveItemsData();
|
|
1188
|
-
return !!(this.doesChangeButtonText && !this.isMultiselectable && activeItemsData.length > 0 ? true : this.html);
|
|
1189
|
-
};
|
|
1190
1192
|
return ListboxComponent;
|
|
1191
1193
|
}(AccessibilityAndTextOrHtmlRequiredComponent));
|
|
1192
1194
|
ListboxComponent.KEY_CODE_ESC = 'Escape';
|
|
1193
1195
|
ListboxComponent.decorators = [
|
|
1194
1196
|
{ type: i0.Component, args: [{
|
|
1195
1197
|
selector: 'desy-listbox',
|
|
1196
|
-
template: "<div [ngClass]=\"classesContainer ? classesContainer : 'relative'\">\r\n <div
|
|
1198
|
+
template: "<div [ngClass]=\"classesContainer ? classesContainer : 'relative'\">\r\n <div [id]=\"id + '-label'\" [class]=\"['mb-sm', labelComponent?.classes, label?.classes] | makeHtmlList\">\r\n <ng-container *desyCustomInnerContent=\"{ component: labelComponent, html: label ? getLabelContent(label) : null }\"></ng-container>\r\n </div>\r\n <button #button [id]=\"id + '-button'\"\r\n [class]=\"['c-listbox', classes] | makeHtmlList\"\r\n ngxTippy [tippyProps]=\"tippyProperties\"\r\n aria-haspopup=\"listbox\"\r\n [attr.aria-labelledby]=\"[hasLabel() ? id + '-label' : null, id + '-button'] | makeHtmlList\"\r\n [attr.disabled]=\"disabled ? 'disabled' : null\"\r\n [attr.aria-disabled]=\"disabled ? 'true' : (ariaDisabled ? ariaDisabled : null)\"\r\n [attr.aria-role] = \"role ? role : null\"\r\n [attr.aria-label] = \"ariaLabel ? ariaLabel : null\"\r\n [attr.aria-describedby] = \"ariaDescribedBy ? ariaDescribedBy : null\"\r\n [attr.aria-hidden] = \"ariaHidden ? ariaHidden : 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-hasppup] = \"ariaHasPopup ? ariaHasPopup : null\"\r\n [attr.aria-tabindex] = \"tabindex ? tabindex : null\">\r\n <span class=\"inline-flex self-center max-w-xs align-middle truncate\">\r\n <ng-container *desyCustomInnerContent=\"{ html: buttonContentHtml, text: text }\"></ng-container>\r\n </span>\r\n <svg class=\"inline-block -mr-2 align-middle -my-px\" viewBox=\"0 0 96 96\" aria-hidden=\"true\" fill=\"currentColor\" focusable=\"false\" width=\"1.5em\" height=\"1.5em\"><g><path d=\"M46.71 58.037a1.823 1.823 0 002.581 0L62.048 45.28a1.823 1.823 0 00-1.29-3.113H35.243a1.823 1.823 0 00-1.291 3.113z\"/></g></svg>\r\n </button>\r\n <div #tooltip [class]=\"['c-listbox__tooltip -ml-sm mt-2 border border-neutral-base shadow-md bg-white', classesTooltip] | makeHtmlList\">\r\n <ul *ngIf=\"itemList\"\r\n #list [id]=\"id\"\r\n (focus)=\"onListFocus()\"\r\n (keydown.arrowUp)=\"moveFocus(currentFocusIndex - 1, $event)\"\r\n (keydown.arrowDown)=\"moveFocus(currentFocusIndex + 1, $event)\"\r\n (keydown.home)=\"moveFocus(0, $event)\"\r\n (keydown.end)=\"moveFocus(items.length - 1, $event)\"\r\n (keydown.space)=\"onSpace($event)\"\r\n role=\"listbox\"\r\n tabindex=\"-1\"\r\n class=\"text-sm outline-none\"\r\n [attr.aria-labelledby]=\"hasLabel() ? id : (ariaLabelledBy ? ariaLabelledBy : null)\"\r\n [attr.aria-multiselectable]=\"isMultiselectable ? 'true' : null\"\r\n [attr.aria-disabled]=\"ariaDisabled ? ariaDisabled : null\"\r\n [attr.aria-label] = \"ariaLabel ? ariaLabel : null\"\r\n [attr.aria-describedby] = \"ariaDescribedBy ? ariaDescribedBy : null\"\r\n [attr.aria-hidden] = \"ariaHidden ? ariaHidden : 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-activedescendant] = \"lastActiveItems.length > 0 ? getItemId(lastActiveItems[0].item, lastActiveItems[0].index) : null\">\r\n <ng-container *ngFor=\"let item of itemList; index as index\">\r\n <li #option *ngIf=\"item\" role=\"option\" (click)=\"selectItem(index)\"\r\n [class]=\"['flex items-center pr-base pl-lg 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]=\"{'focused': index === currentFocusIndex}\"\r\n [attr.aria-label]=\"item.active ? 'true' : (item.ariaLabel ? item.ariaLabel : null)\"\r\n [id]=\"getItemId(item, index)\"\r\n [attr.title]=\"item.title ? item.title : null\"\r\n\r\n [attr.aria-describedby]=\"item.ariaDescribedBy ? item.ariaDescribedBy : 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 [attr.aria-tabindex] = \"item.tabindex ? item.tabindex : null\"\r\n\r\n [attr.aria-checked]=\"item.active\"\r\n [attr.aria-selected]=\"item.active\">\r\n <ng-container *desyCustomInnerContent=\"{ template: item['content'], html: item.html, text: item.text }\"></ng-container>\r\n </li>\r\n </ng-container>\r\n </ul>\r\n </div>\r\n</div>\r\n"
|
|
1197
1199
|
},] }
|
|
1198
1200
|
];
|
|
1199
1201
|
ListboxComponent.propDecorators = {
|
|
1200
|
-
listboxButton: [{ type: i0.ViewChild, args: ['button', { read: i0.ElementRef },] }],
|
|
1202
|
+
listboxButton: [{ type: i0.ViewChild, args: ['button', { read: i0.ElementRef, static: true },] }],
|
|
1201
1203
|
listboxList: [{ type: i0.ViewChild, args: ['list', { read: i0.ElementRef },] }],
|
|
1202
|
-
listboxContent: [{ type: i0.ViewChild, args: ['tooltip', { read: i0.ElementRef },] }],
|
|
1204
|
+
listboxContent: [{ type: i0.ViewChild, args: ['tooltip', { read: i0.ElementRef, static: true },] }],
|
|
1203
1205
|
listboxOptions: [{ type: i0.ViewChildren, args: ['option', { read: i0.ElementRef },] }],
|
|
1204
1206
|
labelComponent: [{ type: i0.ContentChildren, args: [ListboxLabelComponent,] }],
|
|
1205
1207
|
itemComponentList: [{ type: i0.ContentChildren, args: [ListboxItemComponent,] }],
|
|
@@ -3506,135 +3508,1138 @@
|
|
|
3506
3508
|
throw new Error('Item name is required');
|
|
3507
3509
|
}
|
|
3508
3510
|
});
|
|
3509
|
-
return items;
|
|
3511
|
+
return items;
|
|
3512
|
+
};
|
|
3513
|
+
DateInputComponent.prototype.getItemDividerTemplate = function (item) {
|
|
3514
|
+
return item.divider instanceof DateInputDividerComponent ? item.divider.dividerContent : null;
|
|
3515
|
+
};
|
|
3516
|
+
DateInputComponent.prototype.getItemDividerHtml = function (item) {
|
|
3517
|
+
return item.divider.html ? item.divider.html : "<p>" + StringUtils.escapeHtml(item.divider.text) + "</p>";
|
|
3518
|
+
};
|
|
3519
|
+
return DateInputComponent;
|
|
3520
|
+
}(FormFieldComponent));
|
|
3521
|
+
DateInputComponent.defaultItems = [
|
|
3522
|
+
{
|
|
3523
|
+
name: 'day',
|
|
3524
|
+
classes: 'w-14',
|
|
3525
|
+
maxlength: 2
|
|
3526
|
+
},
|
|
3527
|
+
{
|
|
3528
|
+
name: 'month',
|
|
3529
|
+
classes: 'w-14',
|
|
3530
|
+
maxlength: 2
|
|
3531
|
+
},
|
|
3532
|
+
{
|
|
3533
|
+
name: 'year',
|
|
3534
|
+
classes: 'w-20',
|
|
3535
|
+
maxlength: 4
|
|
3536
|
+
}
|
|
3537
|
+
];
|
|
3538
|
+
DateInputComponent.decorators = [
|
|
3539
|
+
{ type: i0.Component, args: [{
|
|
3540
|
+
selector: 'desy-date-input',
|
|
3541
|
+
template: "\r\n<ng-template #innerHtml>\r\n <ng-container *ngIf=\"hasHintComponent()\">\r\n <ng-content select=\"desy-hint\"></ng-content>\r\n </ng-container>\r\n <ng-container *ngIf=\"!hasHintComponent()\">\r\n <ng-container *ngTemplateOutlet=\"hintRef\"></ng-container>\r\n <desy-hint *ngIf=\"!hintRef && hintData\"\r\n [id]=\"getHintId()\"\r\n [text]=\"hintData.text\"\r\n [html]=\"hintData.html\"\r\n [classes]=\"hintData.classes\"\r\n [role]=\"hintData.role\"\r\n [ariaLabel]=\"hintData.ariaLabel\"\r\n [ariaDescribedBy]=\"hintData.ariaDescribedBy\"\r\n [ariaLabelledBy]=\"hintData.ariaLabelledBy\"\r\n [ariaHidden]=\"hintData.ariaHidden\"\r\n [ariaDisabled]=\"hintData.ariaDisabled\"\r\n [ariaControls]=\"hintData.ariaControls\"\r\n [ariaCurrent]=\"hintData.ariaCurrent\"\r\n [ariaLive]=\"hintData.ariaLive\"\r\n [ariaExpanded]=\"hintData.ariaExpanded\"\r\n [ariaErrorMessage]=\"hintData.ariaErrorMessage\"\r\n [ariaHasPopup]=\"hintData.ariaHasPopup\"\r\n [tabindex]=\"hintData.tabindex\"></desy-hint>\r\n <desy-hint *ngIf=\"!hintRef && !hintData && hintText\" [text]=\"hintText\" [id]=\"getHintId()\"></desy-hint>\r\n </ng-container>\r\n\r\n\r\n <ng-container *ngIf=\"hasErrorMessageComponent()\">\r\n <ng-content select=\"desy-error-message\"></ng-content>\r\n </ng-container>\r\n <ng-container *ngIf=\"!hasErrorMessageComponent()\">\r\n <ng-container *ngTemplateOutlet=\"errorMessageRef\"></ng-container>\r\n <desy-error-message *ngIf=\"!errorMessageRef && errorMessageData\"\r\n [id]=\"getErrorId()\"\r\n [text]=\"errorMessageData.text\"\r\n [html]=\"errorMessageData.html\"\r\n [classes]=\"errorMessageData.classes\"\r\n [visuallyHiddenText]=\"errorMessageData.visuallyHiddenText\"\r\n [role]=\"errorMessageData.role\"\r\n [ariaLabel]=\"errorMessageData.ariaLabel\"\r\n [ariaDescribedBy]=\"errorMessageData.ariaDescribedBy\"\r\n [ariaLabelledBy]=\"errorMessageData.ariaLabelledBy\"\r\n [ariaHidden]=\"errorMessageData.ariaHidden\"\r\n [ariaDisabled]=\"errorMessageData.ariaDisabled\"\r\n [ariaControls]=\"errorMessageData.ariaControls\"\r\n [ariaCurrent]=\"errorMessageData.ariaCurrent\"\r\n [ariaLive]=\"errorMessageData.ariaLive\"\r\n [ariaExpanded]=\"errorMessageData.ariaExpanded\"\r\n [ariaErrorMessage]=\"errorMessageData.ariaErrorMessage\"\r\n [ariaHasPopup]=\"errorMessageData.ariaHasPopup\"\r\n [tabindex]=\"errorMessageData.tabindex\"></desy-error-message>\r\n <desy-error-message *ngIf=\"!errorMessageRef && !errorMessageData && errorMessageText\"\r\n [text]=\"errorMessageText\" [id]=\"getErrorId()\"></desy-error-message>\r\n </ng-container>\r\n\r\n <!-- With reactive forms -->\r\n <div *ngIf=\"controlContainer && !ngModelGroup\"\r\n [formGroup]=\"controlContainer.control\"\r\n [class]=\"['flex', classes] | makeHtmlList\"\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 <ng-container *ngFor=\"let item of getItems(); index as i\">\r\n <ng-container *ngIf=\"item.divider\">\r\n <div role=\"separator\" [ngClass]=\"item.divider.classes\">\r\n <ng-container *desyCustomInnerContent=\"{ template: getItemDividerTemplate(item), html: getItemDividerHtml(item) }\"></ng-container>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngIf=\"!item.divider\">\r\n <div class=\"mr-base\">\r\n <desy-input [labelData]=\"getItemLabel(item)\"\r\n [labelRef]=\"getItemLabelRef(item)\"\r\n [id]=\"item.id ? item.id : id + '-' + item.name\"\r\n [classes]=\"['mb-0', item.classes] | makeHtmlList\"\r\n [errorId]=\"item.hasErrors ? getErrorId() : null\"\r\n [name]=\"getItemName(item)\"\r\n [formControlName]=\"getItemName(item)\"\r\n [type]=\"'text'\"\r\n [inputmode]=\"'numeric'\"\r\n [autocomplete]=\"item.autocomplete\"\r\n [pattern]=\"item.pattern ? item.pattern : '[0-9]*'\"\r\n\r\n [maxlength]=\"item.maxlength\"\r\n [role]=\"item.role\"\r\n [ariaLabel]=\"item.ariaLabel\"\r\n [ariaDescribedBy]=\"item.ariaDescribedBy\"\r\n [ariaLabelledBy]=\"item.ariaLabelledBy\"\r\n [ariaHidden]=\"item.ariaHidden\"\r\n [ariaDisabled]=\"item.ariaDisabled\"\r\n [ariaControls]=\"item.ariaControls\"\r\n [ariaCurrent]=\"item.ariaCurrent\"\r\n [ariaLive]=\"item.ariaLive\"\r\n [ariaExpanded]=\"item.ariaExpanded\"\r\n [ariaErrorMessage]=\"item.ariaErrorMessage\"\r\n [ariaHasPopup]=\"item.ariaHasPopup\"\r\n [tabindex]=\"item.tabindex\"></desy-input>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n\r\n <!-- Template-driven forms -->\r\n <desy-template-driven-wrapper *ngIf=\"controlContainer && ngModelGroup\">\r\n <div [ngModelGroup]=\"ngModelGroup\"\r\n [class]=\"['flex', classes] | makeHtmlList\"\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 <ng-container *ngFor=\"let item of getItems(); index as i\">\r\n \r\n <ng-container *ngIf=\"item.divider\">\r\n <div role=\"separator\" [ngClass]=\"item.divider.classes\">\r\n <ng-container *desyCustomInnerContent=\"{ template: getItemDividerTemplate(item), html: getItemDividerHtml(item) }\"></ng-container>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngIf=\"!item.divider\">\r\n <div class=\"mr-base\">\r\n <desy-input [labelData]=\"getItemLabel(item)\"\r\n [labelRef]=\"getItemLabelRef(item)\"\r\n [id]=\"item.id ? item.id : id + '-' + item.name\"\r\n [classes]=\"['mb-0', item.classes] | makeHtmlList\"\r\n [errorId]=\"item.hasErrors ? getErrorId() : null\"\r\n [name]=\"getItemName(item)\"\r\n [ngModel]=\"item.value\" (ngModelChange)=\"onInternalChange(item, +$event)\"\r\n [type]=\"'text'\"\r\n [inputmode]=\"'numeric'\"\r\n [autocomplete]=\"item.autocomplete\"\r\n [pattern]=\"item.pattern ? item.pattern : '[0-9]*'\"\r\n [disabled]=\"disabled ? true : null\"\r\n\r\n [maxlength]=\"item.maxlength\"\r\n [role]=\"item.role\"\r\n [ariaLabel]=\"item.ariaLabel\"\r\n [ariaDescribedBy]=\"item.ariaDescribedBy\"\r\n [ariaLabelledBy]=\"item.ariaLabelledBy\"\r\n [ariaHidden]=\"item.ariaHidden\"\r\n [ariaDisabled]=\"item.ariaDisabled\"\r\n [ariaControls]=\"item.ariaControls\"\r\n [ariaCurrent]=\"item.ariaCurrent\"\r\n [ariaLive]=\"item.ariaLive\"\r\n [ariaExpanded]=\"item.ariaExpanded\"\r\n [ariaErrorMessage]=\"item.ariaErrorMessage\"\r\n [ariaHasPopup]=\"item.ariaHasPopup\"\r\n [tabindex]=\"item.tabindex\"></desy-input>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n </desy-template-driven-wrapper>\r\n\r\n <!-- With ngModel-->\r\n <div *ngIf=\"!controlContainer\"\r\n [class]=\"['flex', classes] | makeHtmlList\"\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 <ng-container *ngFor=\"let item of getItems(); index as i\">\r\n \r\n <ng-container *ngIf=\"item.divider\">\r\n <div role=\"separator\" [ngClass]=\"item.divider.classes\">\r\n <ng-container *desyCustomInnerContent=\"{ template: getItemDividerTemplate(item), html: getItemDividerHtml(item) }\"></ng-container>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngIf=\"!item.divider\">\r\n <div class=\"mr-base\">\r\n <desy-input [labelData]=\"getItemLabel(item)\"\r\n [labelRef]=\"getItemLabelRef(item)\"\r\n [id]=\"item.id ? item.id : id + '-' + item.name\"\r\n [classes]=\"['mb-0', item.classes] | makeHtmlList\"\r\n [errorId]=\"item.hasErrors ? getErrorId() : null\"\r\n [name]=\"getItemName(item)\"\r\n [ngModel]=\"item.value\" (ngModelChange)=\"onInternalChange(item, +$event)\"\r\n [type]=\"'text'\"\r\n [inputmode]=\"'numeric'\"\r\n [autocomplete]=\"item.autocomplete\"\r\n [pattern]=\"item.pattern ? item.pattern : '[0-9]*'\"\r\n [disabled]=\"disabled ? true : null\"\r\n\r\n [maxlength]=\"item.maxlength\"\r\n [role]=\"item.role\"\r\n [ariaLabel]=\"item.ariaLabel\"\r\n [ariaDescribedBy]=\"item.ariaDescribedBy\"\r\n [ariaLabelledBy]=\"item.ariaLabelledBy\"\r\n [ariaHidden]=\"item.ariaHidden\"\r\n [ariaDisabled]=\"item.ariaDisabled\"\r\n [ariaControls]=\"item.ariaControls\"\r\n [ariaCurrent]=\"item.ariaCurrent\"\r\n [ariaLive]=\"item.ariaLive\"\r\n [ariaExpanded]=\"item.ariaExpanded\"\r\n [ariaErrorMessage]=\"item.ariaErrorMessage\"\r\n [ariaHasPopup]=\"item.ariaHasPopup\"\r\n [tabindex]=\"item.tabindex\"></desy-input>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n</div>\r\n</ng-template>\r\n\r\n<div [class]=\"['c-form-group', formGroupClasses] | makeHtmlList\"\r\n [ngClass]=\"{'c-form-group--error' : (hasErrorsMessage() || formGroupClasses == 'c-form-group--error')}\">\r\n\r\n <ng-container *ngIf=\"hasFieldsetComponent()\">\r\n <ng-content select=\"desy-fieldset\"></ng-content>\r\n </ng-container>\r\n <ng-container *ngIf=\"!hasFieldsetComponent()\">\r\n <desy-fieldset *ngIf=\"fieldsetData\"\r\n [classes]=\"fieldsetData.classes\"\r\n [id]=\"fieldsetData.id\"\r\n [legendData]=\"fieldsetData.legend\"\r\n [caller]=\"innerHtml\"\r\n [errorId]=\"getErrorId()\"\r\n [describedBy]=\"[fieldsetData.describedBy, getHintId(), getErrorId()] | makeHtmlList:null\"\r\n role=\"group\"\r\n [ariaLabel]=\"fieldsetData.ariaLabel\"\r\n [ariaLabelledBy]=\"fieldsetData.ariaLabelledBy\"\r\n [ariaHidden]=\"fieldsetData.ariaHidden\"\r\n [ariaDisabled]=\"fieldsetData.ariaDisabled\"\r\n [ariaControls]=\"fieldsetData.ariaControls\"\r\n [ariaCurrent]=\"fieldsetData.ariaCurrent\"\r\n [ariaLive]=\"fieldsetData.ariaLive\"\r\n [ariaExpanded]=\"fieldsetData.ariaExpanded\"\r\n [ariaHasPopup]=\"fieldsetData.ariaHasPopup\"\r\n [tabindex]=\"fieldsetData.tabindex\"></desy-fieldset>\r\n <desy-fieldset *ngIf=\"!fieldsetData && hasLegendComponent()\"\r\n [legendRef]=\"legendTemplate\"\r\n [caller]=\"innerHtml\"\r\n [errorId]=\"getErrorId()\"\r\n [describedBy]=\"[ getHintId(), getErrorId()] | makeHtmlList:null\">\r\n <ng-template #legendTemplate>\r\n <ng-content select=\"desy-legend\"></ng-content>\r\n </ng-template>\r\n </desy-fieldset>\r\n <desy-fieldset *ngIf=\"!fieldsetData && !hasLegendComponent() && legendRef\"\r\n [legendRef]=\"legendRef\"\r\n [caller]=\"innerHtml\"\r\n [errorId]=\"getErrorId()\"\r\n [describedBy]=\"[ getHintId(), getErrorId()] | makeHtmlList:null\"\r\n role=\"group\"></desy-fieldset>\r\n <desy-fieldset *ngIf=\"!fieldsetData && !hasLegendComponent() && !legendRef && legendData\"\r\n [legendData]=\"{text: legendData.text, html: legendData.html, classes: legendData.classes, isPageHeading: legendData.isPageHeading}\"\r\n [caller]=\"innerHtml\"\r\n [errorId]=\"getErrorId()\"\r\n [describedBy]=\"[ getHintId(), getErrorId()] | makeHtmlList:null\"\r\n role=\"group\"></desy-fieldset>\r\n <desy-fieldset *ngIf=\"!fieldsetData && !hasLegendComponent() && !legendRef && !legendData && legendText\"\r\n [legendText]=\"legendText\"\r\n [caller]=\"innerHtml\"\r\n [errorId]=\"getErrorId()\"\r\n [describedBy]=\"[ getHintId(), getErrorId()] | makeHtmlList:null\"\r\n role=\"group\"></desy-fieldset>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"!hasFieldset()\">\r\n <ng-container *ngTemplateOutlet=\"innerHtml\"></ng-container>\r\n </ng-container>\r\n</div>\r\n",
|
|
3542
|
+
providers: [
|
|
3543
|
+
{
|
|
3544
|
+
provide: forms.NG_VALUE_ACCESSOR,
|
|
3545
|
+
useExisting: i0.forwardRef(function () { return DateInputComponent; }),
|
|
3546
|
+
multi: true
|
|
3547
|
+
}
|
|
3548
|
+
]
|
|
3549
|
+
},] }
|
|
3550
|
+
];
|
|
3551
|
+
DateInputComponent.ctorParameters = function () { return [
|
|
3552
|
+
{ type: forms.ControlContainer, decorators: [{ type: i0.Optional }] }
|
|
3553
|
+
]; };
|
|
3554
|
+
DateInputComponent.propDecorators = {
|
|
3555
|
+
ngModelGroup: [{ type: i0.Input }],
|
|
3556
|
+
items: [{ type: i0.Input }],
|
|
3557
|
+
itemsChange: [{ type: i0.Output }],
|
|
3558
|
+
namePrefix: [{ type: i0.Input }],
|
|
3559
|
+
classes: [{ type: i0.Input }],
|
|
3560
|
+
formGroupClasses: [{ type: i0.Input }],
|
|
3561
|
+
errorMessage: [{ type: i0.Input }],
|
|
3562
|
+
id: [{ type: i0.Input }],
|
|
3563
|
+
fieldsetComponent: [{ type: i0.ContentChildren, args: [FieldsetComponent,] }],
|
|
3564
|
+
legendComponent: [{ type: i0.ContentChildren, args: [LegendComponent,] }],
|
|
3565
|
+
dateInputItemComponents: [{ type: i0.ContentChildren, args: [DateInputItemComponent,] }],
|
|
3566
|
+
fieldsetData: [{ type: i0.Input }],
|
|
3567
|
+
legendRef: [{ type: i0.Input }],
|
|
3568
|
+
legendData: [{ type: i0.Input }],
|
|
3569
|
+
legendText: [{ type: i0.Input }],
|
|
3570
|
+
innerHtml: [{ type: i0.ViewChild, args: ['innerHtml', { static: true },] }]
|
|
3571
|
+
};
|
|
3572
|
+
__decorate([
|
|
3573
|
+
DesyOnInputChange('onExternalChange')
|
|
3574
|
+
], DateInputComponent.prototype, "items", void 0);
|
|
3575
|
+
__decorate([
|
|
3576
|
+
DesyOnInputChange('onExternalChange')
|
|
3577
|
+
], DateInputComponent.prototype, "namePrefix", void 0);
|
|
3578
|
+
__decorate([
|
|
3579
|
+
DesyContentChild({ onSetCallbackName: 'overrideFieldsetParams' })
|
|
3580
|
+
], DateInputComponent.prototype, "fieldsetComponent", void 0);
|
|
3581
|
+
__decorate([
|
|
3582
|
+
DesyContentChild()
|
|
3583
|
+
], DateInputComponent.prototype, "legendComponent", void 0);
|
|
3584
|
+
|
|
3585
|
+
var SearchBarComponent = /** @class */ (function (_super) {
|
|
3586
|
+
__extends(SearchBarComponent, _super);
|
|
3587
|
+
function SearchBarComponent() {
|
|
3588
|
+
var _this = _super.apply(this, __spread(arguments)) || this;
|
|
3589
|
+
_this.clickEvent = new i0.EventEmitter();
|
|
3590
|
+
_this.value = '';
|
|
3591
|
+
return _this;
|
|
3592
|
+
}
|
|
3593
|
+
SearchBarComponent.prototype.ngOnChanges = function (changes) {
|
|
3594
|
+
this.checkRequiredParams();
|
|
3595
|
+
};
|
|
3596
|
+
SearchBarComponent.prototype.checkRequiredParams = function () {
|
|
3597
|
+
if (!this.id) {
|
|
3598
|
+
throw Error('id is required');
|
|
3599
|
+
}
|
|
3600
|
+
if (!this.hasLabel()) {
|
|
3601
|
+
throw Error('label is required');
|
|
3602
|
+
}
|
|
3603
|
+
};
|
|
3604
|
+
SearchBarComponent.prototype.ngAfterViewInit = function () {
|
|
3605
|
+
if (this.button && this.button.length > 1) {
|
|
3606
|
+
throw Error('only 1 button in content is allowed');
|
|
3607
|
+
}
|
|
3608
|
+
};
|
|
3609
|
+
SearchBarComponent.prototype.onClick = function (event) {
|
|
3610
|
+
if (!this.disabled) {
|
|
3611
|
+
this.clickEvent.emit(event);
|
|
3612
|
+
}
|
|
3613
|
+
};
|
|
3614
|
+
SearchBarComponent.prototype.hasButton = function () {
|
|
3615
|
+
return this.button && this.button.length > 0;
|
|
3616
|
+
};
|
|
3617
|
+
return SearchBarComponent;
|
|
3618
|
+
}(FormFieldComponent));
|
|
3619
|
+
SearchBarComponent.decorators = [
|
|
3620
|
+
{ type: i0.Component, args: [{
|
|
3621
|
+
selector: 'desy-search-bar',
|
|
3622
|
+
template: "<!-- searchbar -->\r\n<div class=\"relative\" [ngClass]=\"{'flex flex-wrap items-end': hasButton()}\">\r\n <ng-container *ngTemplateOutlet=\"labelRef\"></ng-container>\r\n <desy-label *ngIf=\"!labelRef && labelData\"\r\n [text]=\"labelData.text\"\r\n [html]=\"labelData.html\"\r\n classes=\"sr-only\"\r\n [isPageHeading]=\"labelData.isPageHeading\"\r\n [for]=\"id\"\r\n [role]=\"labelData.role\"\r\n [ariaLabel]=\"labelData.ariaLabel\"\r\n [ariaDescribedBy]=\"labelData.ariaDescribedBy\"\r\n [ariaLabelledBy]=\"labelData.ariaLabelledBy\"\r\n [ariaHidden]=\"labelData.ariaHidden\"\r\n [ariaDisabled]=\"labelData.ariaDisabled\"\r\n [ariaControls]=\"labelData.ariaControls\"\r\n [ariaCurrent]=\"labelData.ariaCurrent\"\r\n [ariaLive]=\"labelData.ariaLive\"\r\n [ariaExpanded]=\"labelData.ariaExpanded\"\r\n [ariaErrorMessage]=\"labelData.ariaErrorMessage\"\r\n [ariaHasPopup]=\"labelData.ariaHasPopup\"\r\n [tabindex]=\"labelData.tabindex\"></desy-label>\r\n <desy-label *ngIf=\"!labelRef && !labelData && labelText\" [text]=\"labelText\" classes=\"sr-only\" [for]=\"id\"></desy-label>\r\n <input type=\"search\"\r\n [class]=\"['c-input block mt-sm pr-12 border-black rounded font-semibold placeholder-neutral-dark focus:border-black focus:shadow-outline-focus-input focus:ring-4 focus:ring-warning-base disabled:bg-neutral-light disabled:border-neutral-base', classes] | makeHtmlList\"\r\n [ngClass]=\"{'border-alert-base ring-2 ring-alert-base': hasErrorsMessage(),'w-full': !hasButton()}\"\r\n [value]=\"value\" (input)=\"onInput($event.target.value)\"\r\n [attr.id]=\"id ? id : null\"\r\n [attr.name]=\"id ? id : null\"\r\n [attr.aria-describedby]=\"[describedBy, getErrorId()] | makeHtmlList:null\"\r\n [attr.aria-errormessage]=\"hasErrorsMessage() ? getErrorId() : null\"\r\n [attr.aria-invalid]=\"hasErrorsMessage() ? true : null\"\r\n [attr.disabled]=\"disabled ? true : null\"\r\n [attr.placeholder]=\"placeholder ? placeholder : null\"\r\n [attr.role]=\"role ? role : null\"\r\n [attr.aria-label]=\"ariaLabel ? ariaLabel : 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-haspopup]=\"ariaHasPopup ? ariaHasPopup : null\"\r\n [attr.tabindex]=\"tabindex ? tabindex : null\">\r\n <ng-container *ngIf=\"hasButton(); else defaultButton\">\r\n <ng-content select=\"desy-button\"></ng-content>\r\n </ng-container>\r\n <ng-template #defaultButton>\r\n <button type=\"submit\" [attr.disabled]=\"disabled ? 'disabled' : null\" [attr.aria-disabled]=\"disabled ? 'true' : null\"\r\n (click)=\"onClick($event)\"\r\n [class]=\"['absolute top-0 right-0 m-sm p-0.5 text-primary-base hover:text-primary-dark focus:bg-warning-base focus:outline-none focus:shadow-outline-focus', buttonClasses] | makeHtmlList\">\r\n <span class=\"sr-only\">Buscar</span>\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" width=\"1.375em\" height=\"1.375em\" aria-hidden=\"true\"><path d=\"M23.498 23.487a1.713 1.713 0 000-2.421l-4.572-4.575a.43.43 0 01-.062-.539 10.283 10.283 0 10-2.911 2.911.43.43 0 01.539.055l4.574 4.574a1.712 1.712 0 002.433-.005zM3.451 10.289a6.85 6.85 0 116.85 6.85 6.85 6.85 0 01-6.85-6.85z\" fill=\"currentColor\"/></svg>\r\n </button>\r\n </ng-template>\r\n <ng-container *ngTemplateOutlet=\"errorMessageRef\"></ng-container>\r\n <desy-error-message *ngIf=\"!errorMessageRef && errorMessageData\"\r\n [id]=\"getErrorId()\"\r\n [text]=\"errorMessageData.text\"\r\n [html]=\"errorMessageData.html\"\r\n [classes]=\"errorMessageData.classes\"\r\n [visuallyHiddenText]=\"errorMessageData.visuallyHiddenText\"\r\n [role]=\"errorMessageData.role\"\r\n [ariaLabel]=\"errorMessageData.ariaLabel\"\r\n [ariaDescribedBy]=\"errorMessageData.ariaDescribedBy\"\r\n [ariaLabelledBy]=\"errorMessageData.ariaLabelledBy\"\r\n [ariaHidden]=\"errorMessageData.ariaHidden\"\r\n [ariaDisabled]=\"errorMessageData.ariaDisabled\"\r\n [ariaControls]=\"errorMessageData.ariaControls\"\r\n [ariaCurrent]=\"errorMessageData.ariaCurrent\"\r\n [ariaLive]=\"errorMessageData.ariaLive\"\r\n [ariaExpanded]=\"errorMessageData.ariaExpanded\"\r\n [ariaErrorMessage]=\"errorMessageData.ariaErrorMessage\"\r\n [ariaHasPopup]=\"errorMessageData.ariaHasPopup\"\r\n [tabindex]=\"errorMessageData.tabindex\"></desy-error-message>\r\n <desy-error-message *ngIf=\"!errorMessageRef && !errorMessageData && errorMessageText\"\r\n [text]=\"errorMessageText\" [id]=\"getErrorId()\"></desy-error-message>\r\n</div>\r\n<!-- /searchbar -->\r\n",
|
|
3623
|
+
providers: [
|
|
3624
|
+
{
|
|
3625
|
+
provide: forms.NG_VALUE_ACCESSOR,
|
|
3626
|
+
useExisting: i0.forwardRef(function () { return SearchBarComponent; }),
|
|
3627
|
+
multi: true
|
|
3628
|
+
}
|
|
3629
|
+
]
|
|
3630
|
+
},] }
|
|
3631
|
+
];
|
|
3632
|
+
SearchBarComponent.propDecorators = {
|
|
3633
|
+
button: [{ type: i0.ContentChildren, args: [ButtonComponent,] }],
|
|
3634
|
+
describedBy: [{ type: i0.Input }],
|
|
3635
|
+
classes: [{ type: i0.Input }],
|
|
3636
|
+
buttonClasses: [{ type: i0.Input }],
|
|
3637
|
+
placeholder: [{ type: i0.Input }],
|
|
3638
|
+
clickEvent: [{ type: i0.Output }]
|
|
3639
|
+
};
|
|
3640
|
+
|
|
3641
|
+
var TreeSubComponent = /** @class */ (function (_super) {
|
|
3642
|
+
__extends(TreeSubComponent, _super);
|
|
3643
|
+
function TreeSubComponent() {
|
|
3644
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
3645
|
+
}
|
|
3646
|
+
return TreeSubComponent;
|
|
3647
|
+
}(ContentBaseComponent));
|
|
3648
|
+
TreeSubComponent.decorators = [
|
|
3649
|
+
{ type: i0.Component, args: [{
|
|
3650
|
+
selector: 'desy-tree-sub',
|
|
3651
|
+
template: "<ng-template #contentTemplate>\r\n <ul [class]=\"['c-tree__itemgroup', classes] | makeHtmlList\"\r\n [attr.role]=\"role ? role : 'group'\"\r\n [attr.aria-describedby]=\"ariaDescribedBy ? ariaDescribedBy : null\"\r\n [attr.aria-labelledby]=\"ariaLabelledBy ? ariaLabelledBy : null\"\r\n [attr.aria-hidden]=\"ariaHidden ? ariaHidden : null\"\r\n [attr.aria-disabled]=\"ariaDisabled ? ariaDisabled : null\"\r\n [attr.aria-controls]=\"ariaControls ? ariaControls : null\"\r\n [attr.aria-current]=\"ariaCurrent ? ariaCurrent : null\"\r\n [attr.aria-live]=\"ariaLive ? ariaLive : null\"\r\n [attr.aria-expanded]=\"ariaExpanded ? ariaExpanded : null\"\r\n [attr.aria-errormessage]=\"ariaErrorMessage ? ariaErrorMessage : null\"\r\n [attr.aria-haspopup]=\"ariaHasPopup ? ariaHasPopup : null\"\r\n [attr.aria-modal]=\"ariaModal ? ariaModal : null\"\r\n [attr.tabindex]=\"tabindex ? tabindex : null\">\r\n <ng-content></ng-content>\r\n </ul>\r\n</ng-template>\r\n"
|
|
3652
|
+
},] }
|
|
3653
|
+
];
|
|
3654
|
+
TreeSubComponent.propDecorators = {
|
|
3655
|
+
classes: [{ type: i0.Input }]
|
|
3656
|
+
};
|
|
3657
|
+
|
|
3658
|
+
var ITreeItem = /** @class */ (function () {
|
|
3659
|
+
function ITreeItem() {
|
|
3660
|
+
}
|
|
3661
|
+
return ITreeItem;
|
|
3662
|
+
}());
|
|
3663
|
+
|
|
3664
|
+
var SearchUtils = /** @class */ (function () {
|
|
3665
|
+
function SearchUtils() {
|
|
3666
|
+
}
|
|
3667
|
+
/**
|
|
3668
|
+
* Comprueba si una cadena de texto (target) contiene cualquier palabra de otro texto (text)
|
|
3669
|
+
* @param target - Texto en el que buscar
|
|
3670
|
+
* @param text - Texto a buscar
|
|
3671
|
+
* @param fullWord - Indica si las palabras del texto a buscar deben aparecer enteras
|
|
3672
|
+
*/
|
|
3673
|
+
SearchUtils.containsAnyWordFrom = function (target, text, fullWord) {
|
|
3674
|
+
var _this = this;
|
|
3675
|
+
var words = [];
|
|
3676
|
+
var includes = false;
|
|
3677
|
+
var simplifiedTarget = this.getSimplifiedString(target);
|
|
3678
|
+
if (text && text.split(' ').length > 1) {
|
|
3679
|
+
words = text.split(' ');
|
|
3680
|
+
}
|
|
3681
|
+
words.push(text);
|
|
3682
|
+
words.forEach(function (word) {
|
|
3683
|
+
if (simplifiedTarget && word) {
|
|
3684
|
+
if ((fullWord && simplifiedTarget === _this.getSimplifiedString(word))
|
|
3685
|
+
|| (!fullWord && simplifiedTarget.includes(_this.getSimplifiedString(word)))) {
|
|
3686
|
+
includes = true;
|
|
3687
|
+
}
|
|
3688
|
+
}
|
|
3689
|
+
});
|
|
3690
|
+
return includes;
|
|
3691
|
+
};
|
|
3692
|
+
/**
|
|
3693
|
+
* Convierte a mayúsculas, elimina espacios y reemplaza/elimina caracteres especiales para realizar comparaciones más tolerantes
|
|
3694
|
+
* @param str - cadena de entrada
|
|
3695
|
+
*/
|
|
3696
|
+
SearchUtils.getSimplifiedString = function (str) {
|
|
3697
|
+
var res = str;
|
|
3698
|
+
if (str) {
|
|
3699
|
+
res = str.toLocaleUpperCase().trim();
|
|
3700
|
+
res = res.replace('Á', 'A');
|
|
3701
|
+
res = res.replace('É', 'E');
|
|
3702
|
+
res = res.replace('Í', 'I');
|
|
3703
|
+
res = res.replace('Ó', 'O');
|
|
3704
|
+
res = res.replace('Ú', 'U');
|
|
3705
|
+
res = res.replace('À', 'A');
|
|
3706
|
+
res = res.replace('È', 'E');
|
|
3707
|
+
res = res.replace('Ì', 'I');
|
|
3708
|
+
res = res.replace('Ò', 'O');
|
|
3709
|
+
res = res.replace('Ù', 'U');
|
|
3710
|
+
res = res.replace('Ä', 'A');
|
|
3711
|
+
res = res.replace('Ë', 'E');
|
|
3712
|
+
res = res.replace('Ï', 'I');
|
|
3713
|
+
res = res.replace('Ö', 'O');
|
|
3714
|
+
res = res.replace('Ü', 'U');
|
|
3715
|
+
res = res.replace(',', '');
|
|
3716
|
+
res = res.replace('.', '');
|
|
3717
|
+
res = res.replace('\'', '');
|
|
3718
|
+
res = res.replace('"', '');
|
|
3719
|
+
}
|
|
3720
|
+
return res;
|
|
3721
|
+
};
|
|
3722
|
+
return SearchUtils;
|
|
3723
|
+
}());
|
|
3724
|
+
|
|
3725
|
+
var TreeCheckboxComponent = /** @class */ (function (_super) {
|
|
3726
|
+
__extends(TreeCheckboxComponent, _super);
|
|
3727
|
+
function TreeCheckboxComponent(changeDetector) {
|
|
3728
|
+
var _this = _super.call(this) || this;
|
|
3729
|
+
_this.changeDetector = changeDetector;
|
|
3730
|
+
_this.checkedChange = new i0.EventEmitter();
|
|
3731
|
+
_this.indeterminateCheckedChange = new i0.EventEmitter();
|
|
3732
|
+
_this.hasError = false;
|
|
3733
|
+
_this._hasInit = false;
|
|
3734
|
+
return _this;
|
|
3735
|
+
}
|
|
3736
|
+
TreeCheckboxComponent.prototype.ngOnInit = function () {
|
|
3737
|
+
this._hasInit = true;
|
|
3738
|
+
this.onDescribedByChange();
|
|
3739
|
+
};
|
|
3740
|
+
TreeCheckboxComponent.prototype.detectChanges = function () {
|
|
3741
|
+
this.changeDetector.detectChanges();
|
|
3742
|
+
};
|
|
3743
|
+
TreeCheckboxComponent.prototype.hasChanged = function () {
|
|
3744
|
+
if (this._hasInit) {
|
|
3745
|
+
var input = this.inputElement.nativeElement;
|
|
3746
|
+
// Se establece el cambio a visualizar en el input
|
|
3747
|
+
if (this.isIndeterminate) {
|
|
3748
|
+
if (input.readOnly) {
|
|
3749
|
+
input.checked = false;
|
|
3750
|
+
input.readOnly = false;
|
|
3751
|
+
}
|
|
3752
|
+
else if (!input.checked) {
|
|
3753
|
+
input.readOnly = true;
|
|
3754
|
+
input.indeterminate = true;
|
|
3755
|
+
}
|
|
3756
|
+
}
|
|
3757
|
+
this.setIndeterminateChecked(input.indeterminate);
|
|
3758
|
+
this.checkedChange.emit(input.checked);
|
|
3759
|
+
}
|
|
3760
|
+
};
|
|
3761
|
+
TreeCheckboxComponent.prototype.onIdChange = function () {
|
|
3762
|
+
this.overrideLabelParams();
|
|
3763
|
+
this.overrideHintParams();
|
|
3764
|
+
};
|
|
3765
|
+
TreeCheckboxComponent.prototype.setIndeterminateStatus = function () {
|
|
3766
|
+
var _a;
|
|
3767
|
+
var input = (_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.nativeElement;
|
|
3768
|
+
if (input) {
|
|
3769
|
+
if (this.indeterminateChecked) {
|
|
3770
|
+
input.readOnly = true;
|
|
3771
|
+
input.indeterminate = true;
|
|
3772
|
+
}
|
|
3773
|
+
else if (input.readOnly) {
|
|
3774
|
+
input.readOnly = false;
|
|
3775
|
+
input.indeterminate = false;
|
|
3776
|
+
}
|
|
3777
|
+
}
|
|
3778
|
+
};
|
|
3779
|
+
TreeCheckboxComponent.prototype.setIndeterminateChecked = function (indeterminateChecked) {
|
|
3780
|
+
this.indeterminateChecked = indeterminateChecked;
|
|
3781
|
+
this._lastIndeterminate = indeterminateChecked;
|
|
3782
|
+
this.indeterminateCheckedChange.emit(indeterminateChecked);
|
|
3783
|
+
this.changeDetector.detectChanges(); // Avisa al elemento input para que actualice su estado
|
|
3784
|
+
};
|
|
3785
|
+
TreeCheckboxComponent.prototype.focus = function () {
|
|
3786
|
+
this.inputElement.nativeElement.focus();
|
|
3787
|
+
};
|
|
3788
|
+
TreeCheckboxComponent.prototype.matchesText = function (value) {
|
|
3789
|
+
var checkboxText = this.contentWrapper.nativeElement.textContent;
|
|
3790
|
+
return SearchUtils.containsAnyWordFrom(checkboxText, value);
|
|
3791
|
+
};
|
|
3792
|
+
TreeCheckboxComponent.prototype.preventDefault = function (event) {
|
|
3793
|
+
event.preventDefault();
|
|
3794
|
+
};
|
|
3795
|
+
TreeCheckboxComponent.prototype.getHintId = function () {
|
|
3796
|
+
return this.hintComponent ? this.hintComponent.id : '';
|
|
3797
|
+
};
|
|
3798
|
+
TreeCheckboxComponent.prototype.overrideLabelParams = function () {
|
|
3799
|
+
if (this.labelComponent) {
|
|
3800
|
+
this.labelComponent.for = this.id + '-input';
|
|
3801
|
+
if (!this.labelComponent.classes) {
|
|
3802
|
+
this.labelComponent.classes = 'block relative -top-xs -left-8 pl-8 py-xs';
|
|
3803
|
+
}
|
|
3804
|
+
this.labelComponent.detectChanges();
|
|
3805
|
+
}
|
|
3806
|
+
};
|
|
3807
|
+
TreeCheckboxComponent.prototype.overrideHintParams = function () {
|
|
3808
|
+
if (this.hintComponent) {
|
|
3809
|
+
if (!this.hintComponent.id) {
|
|
3810
|
+
this.hintComponent.id = this.id + '-item-hint';
|
|
3811
|
+
}
|
|
3812
|
+
this.hintComponent.detectChanges();
|
|
3813
|
+
}
|
|
3814
|
+
this.onDescribedByChange();
|
|
3815
|
+
};
|
|
3816
|
+
TreeCheckboxComponent.prototype.getItemDescribedBy = function () {
|
|
3817
|
+
return (this.describedBy ? this.describedBy : '') + ' ' + this.getHintId();
|
|
3818
|
+
};
|
|
3819
|
+
TreeCheckboxComponent.prototype.onDescribedByChange = function () {
|
|
3820
|
+
if (this.ariaDescribedBy) {
|
|
3821
|
+
this.itemDescribedBy = this.ariaDescribedBy;
|
|
3822
|
+
}
|
|
3823
|
+
else {
|
|
3824
|
+
this.itemDescribedBy = this.getItemDescribedBy();
|
|
3825
|
+
}
|
|
3826
|
+
};
|
|
3827
|
+
return TreeCheckboxComponent;
|
|
3828
|
+
}(AccessibilityComponent));
|
|
3829
|
+
TreeCheckboxComponent.decorators = [
|
|
3830
|
+
{ type: i0.Component, args: [{
|
|
3831
|
+
selector: 'desy-tree-checkbox',
|
|
3832
|
+
template: "<div [class]=\"classes\" [ngClass]=\"{'border-t border-b border-neutral-base -mb-px': hasDividers}\">\r\n <div class=\"relative flex items-start py-xs\">\r\n <div class=\"flex items-center mx-sm\">\r\n <input #input class=\"w-6 h-6 transition duration-150 ease-in-out border-black focus:border-black focus:shadow-outline-focus-input focus:ring-4 focus:ring-offset-0 focus:ring-warning-base disabled:bg-neutral-base disabled:border-neutral-base text-primary-base\"\r\n [id]=\"id + '-input'\"\r\n [name]=\"name\"\r\n [type]=\"type === 'checkbox' ? 'checkbox' : 'radio'\"\r\n [value]=\"value\"\r\n [checked]=\"checked\"\r\n (change)=\"hasChanged()\"\r\n [disabled]=\"disabled ? disabled : null\"\r\n [attr.aria-invalid]=\"hasError ? 'true' : null\"\r\n\r\n [attr.role]=\"role ? role : 'group'\"\r\n [attr.aria-describedby]=\"itemDescribedBy\"\r\n [attr.aria-labelledby]=\"ariaLabelledBy ? ariaLabelledBy : null\"\r\n [attr.aria-hidden]=\"ariaHidden ? ariaHidden : null\"\r\n [attr.aria-disabled]=\"ariaDisabled ? ariaDisabled : null\"\r\n [attr.aria-controls]=\"ariaControls ? ariaControls : null\"\r\n [attr.aria-current]=\"ariaCurrent ? ariaCurrent : null\"\r\n [attr.aria-live]=\"ariaLive ? ariaLive : null\"\r\n [attr.aria-expanded]=\"ariaExpanded ? ariaExpanded : null\"\r\n [attr.aria-errormessage]=\"ariaErrorMessage ? ariaErrorMessage : null\"\r\n [attr.aria-haspopup]=\"ariaHasPopup ? ariaHasPopup : null\"\r\n [attr.aria-modal]=\"ariaModal ? ariaModal : null\"\r\n [attr.tabindex]=\"tabindex ? tabindex : null\"\r\n\r\n (keydown.home)=\"preventDefault($event)\"\r\n (keydown.end)=\"preventDefault($event)\"\r\n (keydown.arrowup)=\"preventDefault($event)\"\r\n (keydown.arrowdown)=\"preventDefault($event)\"\r\n (keydown.arrowright)=\"preventDefault($event)\"\r\n (keydown.arrowleft)=\"preventDefault($event)\">\r\n </div>\r\n <div #contentWrapper class=\"flex-1 pt-0.5 leading-5\">\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n</div>\r\n"
|
|
3833
|
+
},] }
|
|
3834
|
+
];
|
|
3835
|
+
TreeCheckboxComponent.ctorParameters = function () { return [
|
|
3836
|
+
{ type: i0.ChangeDetectorRef }
|
|
3837
|
+
]; };
|
|
3838
|
+
TreeCheckboxComponent.propDecorators = {
|
|
3839
|
+
inputElement: [{ type: i0.ViewChild, args: ['input', { static: true },] }],
|
|
3840
|
+
contentWrapper: [{ type: i0.ViewChild, args: ['contentWrapper', { static: true },] }],
|
|
3841
|
+
id: [{ type: i0.Input }],
|
|
3842
|
+
name: [{ type: i0.Input }],
|
|
3843
|
+
type: [{ type: i0.Input }],
|
|
3844
|
+
classes: [{ type: i0.Input }],
|
|
3845
|
+
value: [{ type: i0.Input }],
|
|
3846
|
+
checked: [{ type: i0.Input }],
|
|
3847
|
+
checkedChange: [{ type: i0.Output }],
|
|
3848
|
+
isIndeterminate: [{ type: i0.Input }],
|
|
3849
|
+
indeterminateChecked: [{ type: i0.Input }],
|
|
3850
|
+
indeterminateCheckedChange: [{ type: i0.Output }],
|
|
3851
|
+
disabled: [{ type: i0.Input }],
|
|
3852
|
+
hasDividers: [{ type: i0.Input }],
|
|
3853
|
+
describedBy: [{ type: i0.Input }],
|
|
3854
|
+
hasError: [{ type: i0.Input }],
|
|
3855
|
+
labelComponent: [{ type: i0.Input }],
|
|
3856
|
+
hintComponent: [{ type: i0.Input }]
|
|
3857
|
+
};
|
|
3858
|
+
__decorate([
|
|
3859
|
+
DesyOnInputChange('onIdChange')
|
|
3860
|
+
], TreeCheckboxComponent.prototype, "id", void 0);
|
|
3861
|
+
__decorate([
|
|
3862
|
+
DesyOnInputChange('setIndeterminateStatus')
|
|
3863
|
+
], TreeCheckboxComponent.prototype, "indeterminateChecked", void 0);
|
|
3864
|
+
__decorate([
|
|
3865
|
+
DesyOnInputChange('onDescribedByChange')
|
|
3866
|
+
], TreeCheckboxComponent.prototype, "describedBy", void 0);
|
|
3867
|
+
__decorate([
|
|
3868
|
+
DesyOnInputChange('overrideLabelParams')
|
|
3869
|
+
], TreeCheckboxComponent.prototype, "labelComponent", void 0);
|
|
3870
|
+
__decorate([
|
|
3871
|
+
DesyOnInputChange('overrideHintParams')
|
|
3872
|
+
], TreeCheckboxComponent.prototype, "hintComponent", void 0);
|
|
3873
|
+
|
|
3874
|
+
var TreeItemComponent = /** @class */ (function (_super) {
|
|
3875
|
+
__extends(TreeItemComponent, _super);
|
|
3876
|
+
function TreeItemComponent(changeDetector, element) {
|
|
3877
|
+
var _this = _super.call(this) || this;
|
|
3878
|
+
_this.changeDetector = changeDetector;
|
|
3879
|
+
_this.element = element;
|
|
3880
|
+
_this.checkedChange = new i0.EventEmitter();
|
|
3881
|
+
_this.checkedChangeForTree = new i0.EventEmitter();
|
|
3882
|
+
_this.expandedChange = new i0.EventEmitter();
|
|
3883
|
+
_this.indeterminateCheckedChange = new i0.EventEmitter();
|
|
3884
|
+
/*
|
|
3885
|
+
* Identificador del wrapper del componente. Se utiliza para recorrer el árbol en sentido inverso y que cada item
|
|
3886
|
+
* sepa cuál es su item/árbol padre.
|
|
3887
|
+
* Esto es necesario ya que, a la hora de construir un árbol dinámico con templates,
|
|
3888
|
+
* el decorador @ContentChildren no funciona correctamente y no los detecta.
|
|
3889
|
+
* Dejo el enlace de un problema similar: https://github.com/angular/angular/issues/21751
|
|
3890
|
+
*/
|
|
3891
|
+
_this.treeItemKey = TreeItemComponent.generateStaticItemKey();
|
|
3892
|
+
_this.allParentsExpanded = true; // True si el elemento es visible según los elementos expandidos
|
|
3893
|
+
_this.inheritedMatchesSearch = true; // True si el elemento es visible según los criterios de búsqueda
|
|
3894
|
+
// Evento para emitir al componente arbol cuando se pretende abandonar el foco del item
|
|
3895
|
+
_this.quitFocus = new i0.EventEmitter();
|
|
3896
|
+
_this.isFocus = false;
|
|
3897
|
+
_this.isHover = false;
|
|
3898
|
+
_this._matchesValidText = false; // True si el contenido del item encaja con los criterios de búsqueda y se está filtrando
|
|
3899
|
+
return _this;
|
|
3900
|
+
}
|
|
3901
|
+
TreeItemComponent.prototype.ngOnChanges = function (changes) {
|
|
3902
|
+
var _this = this;
|
|
3903
|
+
if (this.sub && this.sub.itemList) {
|
|
3904
|
+
this.sub.itemList.forEach(function (item) { return item.refreshAllParentsExpandedRecursive(_this.allParentsExpanded && _this.expanded); });
|
|
3905
|
+
}
|
|
3906
|
+
for (var propName in changes) {
|
|
3907
|
+
if (changes.hasOwnProperty(propName)) {
|
|
3908
|
+
switch (propName) {
|
|
3909
|
+
case 'checked': {
|
|
3910
|
+
// Reasignamos el valor de checked cuando detectamos el cambio en la entrada
|
|
3911
|
+
setTimeout(function () {
|
|
3912
|
+
_this.setChecked(_this.checked, false, false);
|
|
3913
|
+
if (_this.inheritedExpandedFirstLevel && _this.checked && !_this.expanded) {
|
|
3914
|
+
_this.expandSub(true);
|
|
3915
|
+
}
|
|
3916
|
+
});
|
|
3917
|
+
break;
|
|
3918
|
+
}
|
|
3919
|
+
}
|
|
3920
|
+
}
|
|
3921
|
+
}
|
|
3922
|
+
};
|
|
3923
|
+
/*
|
|
3924
|
+
* Métodos expuestos que permiten configurar al ítem de forma externa
|
|
3925
|
+
*/
|
|
3926
|
+
TreeItemComponent.prototype.focus = function () {
|
|
3927
|
+
var _a;
|
|
3928
|
+
(_a = this.checkbox) === null || _a === void 0 ? void 0 : _a.focus();
|
|
3929
|
+
this.handleItemFocus(true);
|
|
3930
|
+
};
|
|
3931
|
+
TreeItemComponent.prototype.setCheckedAutomaticallyDependingOnChildren = function () {
|
|
3932
|
+
if (this.sub) {
|
|
3933
|
+
this.sub.itemList.forEach(function (item) { return item.setCheckedAutomaticallyDependingOnChildren(); });
|
|
3934
|
+
if (this.areAllChildrenChecked()) {
|
|
3935
|
+
if (this.indeterminateChecked) {
|
|
3936
|
+
this.setIndeterminateChecked(false);
|
|
3937
|
+
}
|
|
3938
|
+
if (!this.checked) {
|
|
3939
|
+
this.setChecked(true, true);
|
|
3940
|
+
}
|
|
3941
|
+
}
|
|
3942
|
+
else if (this.hasChildrenCheckedOrIndeterminate()) {
|
|
3943
|
+
if (!this.indeterminateChecked) {
|
|
3944
|
+
this.setIndeterminateChecked(true);
|
|
3945
|
+
}
|
|
3946
|
+
if (this.checked) {
|
|
3947
|
+
this.setChecked(false, true);
|
|
3948
|
+
}
|
|
3949
|
+
}
|
|
3950
|
+
else {
|
|
3951
|
+
if (this.indeterminateChecked) {
|
|
3952
|
+
this.setIndeterminateChecked(false);
|
|
3953
|
+
}
|
|
3954
|
+
if (this.checked) {
|
|
3955
|
+
this.setChecked(false, true);
|
|
3956
|
+
}
|
|
3957
|
+
}
|
|
3958
|
+
}
|
|
3959
|
+
};
|
|
3960
|
+
TreeItemComponent.prototype.refreshAllParentsExpandedRecursive = function (value) {
|
|
3961
|
+
var _this = this;
|
|
3962
|
+
this.allParentsExpanded = value;
|
|
3963
|
+
if (this.sub) {
|
|
3964
|
+
this.sub.itemList.forEach(function (item) { return item.refreshAllParentsExpandedRecursive(value && _this.expanded); });
|
|
3965
|
+
}
|
|
3966
|
+
};
|
|
3967
|
+
TreeItemComponent.prototype.detectChanges = function () {
|
|
3968
|
+
this.changeDetector.detectChanges();
|
|
3969
|
+
};
|
|
3970
|
+
TreeItemComponent.prototype.expandSub = function (value) {
|
|
3971
|
+
var _this = this;
|
|
3972
|
+
this.expanded = value;
|
|
3973
|
+
if (this.sub) {
|
|
3974
|
+
this.sub.itemList.forEach(function (item) { return item.refreshAllParentsExpandedRecursive(_this.allParentsExpanded && value); });
|
|
3975
|
+
}
|
|
3976
|
+
this.expandedChange.emit(value);
|
|
3977
|
+
};
|
|
3978
|
+
/*
|
|
3979
|
+
* Gestion de eventos
|
|
3980
|
+
*/
|
|
3981
|
+
TreeItemComponent.prototype.handleCheckboxChange = function (checked) {
|
|
3982
|
+
this.setChecked(checked, false);
|
|
3983
|
+
if (this.inheritedExpandedFirstLevel && checked && !this.expanded) {
|
|
3984
|
+
this.expandSub(true);
|
|
3985
|
+
}
|
|
3986
|
+
};
|
|
3987
|
+
TreeItemComponent.prototype.handleIndeterminateCheckedChange = function (indeterminate) {
|
|
3988
|
+
this.indeterminateCheckedChange.emit(indeterminate);
|
|
3989
|
+
};
|
|
3990
|
+
TreeItemComponent.prototype.handleItemFocus = function (value, condition) {
|
|
3991
|
+
if (condition === void 0) { condition = true; }
|
|
3992
|
+
if (condition) {
|
|
3993
|
+
this.isFocus = value;
|
|
3994
|
+
}
|
|
3995
|
+
};
|
|
3996
|
+
TreeItemComponent.prototype.handleItemHover = function (value, condition) {
|
|
3997
|
+
if (condition === void 0) { condition = true; }
|
|
3998
|
+
if (condition) {
|
|
3999
|
+
this.isHover = value;
|
|
4000
|
+
}
|
|
4001
|
+
};
|
|
4002
|
+
TreeItemComponent.prototype.handleArrowUp = function (event, condition) {
|
|
4003
|
+
if (condition === void 0) { condition = true; }
|
|
4004
|
+
if (condition) {
|
|
4005
|
+
event.preventDefault();
|
|
4006
|
+
this.quitFocus.emit({
|
|
4007
|
+
nextElement: 'previous',
|
|
4008
|
+
currentItem: this
|
|
4009
|
+
});
|
|
4010
|
+
}
|
|
4011
|
+
};
|
|
4012
|
+
TreeItemComponent.prototype.handleHome = function (event, condition) {
|
|
4013
|
+
if (condition === void 0) { condition = true; }
|
|
4014
|
+
if (condition) {
|
|
4015
|
+
event.preventDefault();
|
|
4016
|
+
this.quitFocus.emit({
|
|
4017
|
+
nextElement: 'first',
|
|
4018
|
+
currentItem: this
|
|
4019
|
+
});
|
|
4020
|
+
}
|
|
4021
|
+
};
|
|
4022
|
+
TreeItemComponent.prototype.handleEnd = function (event, condition) {
|
|
4023
|
+
if (condition === void 0) { condition = true; }
|
|
4024
|
+
if (condition) {
|
|
4025
|
+
event.preventDefault();
|
|
4026
|
+
this.quitFocus.emit({
|
|
4027
|
+
nextElement: 'last',
|
|
4028
|
+
currentItem: this
|
|
4029
|
+
});
|
|
4030
|
+
}
|
|
4031
|
+
};
|
|
4032
|
+
TreeItemComponent.prototype.handleArrowDown = function (event, condition) {
|
|
4033
|
+
if (condition === void 0) { condition = true; }
|
|
4034
|
+
if (condition) {
|
|
4035
|
+
event.preventDefault();
|
|
4036
|
+
this.quitFocus.emit({
|
|
4037
|
+
nextElement: 'next',
|
|
4038
|
+
currentItem: this
|
|
4039
|
+
});
|
|
4040
|
+
}
|
|
4041
|
+
};
|
|
4042
|
+
TreeItemComponent.prototype.handleArrowRight = function (event, condition) {
|
|
4043
|
+
if (condition === void 0) { condition = true; }
|
|
4044
|
+
var _a;
|
|
4045
|
+
if (condition && this.sub && ((_a = this.sub.itemList) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
4046
|
+
event.preventDefault();
|
|
4047
|
+
if (this.expanded) {
|
|
4048
|
+
this.quitFocus.emit({
|
|
4049
|
+
nextElement: 'firstChild',
|
|
4050
|
+
currentItem: this
|
|
4051
|
+
});
|
|
4052
|
+
}
|
|
4053
|
+
else {
|
|
4054
|
+
this.expandSub(true);
|
|
4055
|
+
}
|
|
4056
|
+
}
|
|
4057
|
+
};
|
|
4058
|
+
TreeItemComponent.prototype.handleArrowLeft = function (event, condition) {
|
|
4059
|
+
if (condition === void 0) { condition = true; }
|
|
4060
|
+
if (condition) {
|
|
4061
|
+
event.preventDefault();
|
|
4062
|
+
if (this.expanded) {
|
|
4063
|
+
this.expandSub(false);
|
|
4064
|
+
}
|
|
4065
|
+
else if (this.subLevel > 0) {
|
|
4066
|
+
this.quitFocus.emit({
|
|
4067
|
+
nextElement: 'parent',
|
|
4068
|
+
currentItem: this
|
|
4069
|
+
});
|
|
4070
|
+
}
|
|
4071
|
+
}
|
|
4072
|
+
};
|
|
4073
|
+
/*
|
|
4074
|
+
* Setters and getters
|
|
4075
|
+
*/
|
|
4076
|
+
TreeItemComponent.prototype.setChecked = function (checked, ignoreInTree, emitEvent) {
|
|
4077
|
+
if (emitEvent === void 0) { emitEvent = true; }
|
|
4078
|
+
if (!this.disabled) {
|
|
4079
|
+
this.checked = checked;
|
|
4080
|
+
}
|
|
4081
|
+
if (!this.inheritedDecoupleChildFromParent && this.sub && this.sub.itemList && !this.indeterminateChecked) {
|
|
4082
|
+
this.sub.itemList.forEach(function (item) {
|
|
4083
|
+
item.setIndeterminateChecked(false);
|
|
4084
|
+
item.setChecked(checked, true);
|
|
4085
|
+
});
|
|
4086
|
+
}
|
|
4087
|
+
if (emitEvent) {
|
|
4088
|
+
this.checkedChange.emit(checked);
|
|
4089
|
+
}
|
|
4090
|
+
if (!ignoreInTree) {
|
|
4091
|
+
this.checkedChangeForTree.emit(checked);
|
|
4092
|
+
}
|
|
4093
|
+
};
|
|
4094
|
+
TreeItemComponent.prototype.setIndeterminateChecked = function (indeterminate) {
|
|
4095
|
+
if (!this.disabled) {
|
|
4096
|
+
this.indeterminateChecked = indeterminate;
|
|
4097
|
+
this.indeterminateCheckedChange.emit(indeterminate);
|
|
4098
|
+
}
|
|
4099
|
+
};
|
|
4100
|
+
TreeItemComponent.prototype.setSubLevel = function (subLevel) {
|
|
4101
|
+
this.subLevel = subLevel;
|
|
4102
|
+
if (this.sub && this.sub.itemList) {
|
|
4103
|
+
this.sub.itemList.forEach(function (item) { return item.setSubLevel(subLevel + 1); });
|
|
4104
|
+
}
|
|
4105
|
+
};
|
|
4106
|
+
TreeItemComponent.prototype.setOrderRecursively = function (order) {
|
|
4107
|
+
this.orderInTree = order;
|
|
4108
|
+
var newOrder = order + 1;
|
|
4109
|
+
if (this.sub && this.sub.itemList) {
|
|
4110
|
+
this.sub.itemList.forEach(function (item) {
|
|
4111
|
+
newOrder = item.setOrderRecursively(newOrder);
|
|
4112
|
+
});
|
|
4113
|
+
}
|
|
4114
|
+
return newOrder;
|
|
4115
|
+
};
|
|
4116
|
+
TreeItemComponent.prototype.setDefaultId = function (defaultId) {
|
|
4117
|
+
this.defaultId = defaultId;
|
|
4118
|
+
this.setDefaultIdRecursive();
|
|
4119
|
+
};
|
|
4120
|
+
TreeItemComponent.prototype.setDefaultIdRecursive = function () {
|
|
4121
|
+
var _this = this;
|
|
4122
|
+
if (this.sub && this.sub.itemList) {
|
|
4123
|
+
this.sub.itemList.forEach(function (item, index) {
|
|
4124
|
+
item.setDefaultId("sub-" + _this.getId() + "-" + index);
|
|
4125
|
+
});
|
|
4126
|
+
}
|
|
4127
|
+
};
|
|
4128
|
+
TreeItemComponent.prototype.getId = function () {
|
|
4129
|
+
return this.id ? this.id : this.defaultId;
|
|
4130
|
+
};
|
|
4131
|
+
TreeItemComponent.prototype.isHidden = function () {
|
|
4132
|
+
return !this.inheritedMatchesSearch && (!this.sub || this.areAllChildrenHidden());
|
|
4133
|
+
};
|
|
4134
|
+
TreeItemComponent.prototype.areAllChildrenHidden = function () {
|
|
4135
|
+
var children = this.sub.itemList;
|
|
4136
|
+
return children.findIndex(function (child) { return !child.isHidden(); }) < 0;
|
|
4137
|
+
};
|
|
4138
|
+
TreeItemComponent.prototype.areAllChildrenChecked = function () {
|
|
4139
|
+
var children = this.sub.itemList;
|
|
4140
|
+
return children.findIndex(function (child) { return !child.checked; }) < 0;
|
|
4141
|
+
};
|
|
4142
|
+
TreeItemComponent.prototype.hasChildrenCheckedOrIndeterminate = function () {
|
|
4143
|
+
var children = this.sub.itemList;
|
|
4144
|
+
return children.findIndex(function (child) { return child.checked || child.indeterminateChecked; }) >= 0;
|
|
4145
|
+
};
|
|
4146
|
+
TreeItemComponent.prototype.matchesText = function (value) {
|
|
4147
|
+
var _a;
|
|
4148
|
+
var matches;
|
|
4149
|
+
if (this.allParentsExpanded && !this.isHidden()) {
|
|
4150
|
+
matches = (_a = this.checkbox) === null || _a === void 0 ? void 0 : _a.matchesText(value);
|
|
4151
|
+
}
|
|
4152
|
+
else {
|
|
4153
|
+
var itemText = this.hiddenWrapper.nativeElement.textContent;
|
|
4154
|
+
matches = SearchUtils.containsAnyWordFrom(itemText, value);
|
|
4155
|
+
}
|
|
4156
|
+
this._matchesValidText = value ? matches : false;
|
|
4157
|
+
return matches;
|
|
4158
|
+
};
|
|
4159
|
+
TreeItemComponent.prototype.getKey = function () {
|
|
4160
|
+
return this.treeItemKey;
|
|
4161
|
+
};
|
|
4162
|
+
TreeItemComponent.prototype.getParentKey = function () {
|
|
4163
|
+
var parentKey;
|
|
4164
|
+
var parentElement = this.element.nativeElement.parentElement;
|
|
4165
|
+
while (parentElement && parentElement.tagName !== 'BODY' && parentElement.tagName !== 'DESY-TREE-ITEM' && parentElement.tagName !== 'DESY-TREE') {
|
|
4166
|
+
parentElement = parentElement.parentElement;
|
|
4167
|
+
}
|
|
4168
|
+
if (parentElement.tagName === 'BODY') {
|
|
4169
|
+
throw new Error('Parent for tree-item not found');
|
|
4170
|
+
}
|
|
4171
|
+
if (parentElement.tagName === 'DESY-TREE') {
|
|
4172
|
+
parentKey = 'root';
|
|
4173
|
+
}
|
|
4174
|
+
if (parentElement.tagName === 'DESY-TREE-ITEM') {
|
|
4175
|
+
parentKey = parentElement.getAttribute('desy-tree-item-key');
|
|
4176
|
+
}
|
|
4177
|
+
return parentKey;
|
|
4178
|
+
};
|
|
4179
|
+
TreeItemComponent.prototype.isActive = function () {
|
|
4180
|
+
return this.active || this._matchesValidText;
|
|
4181
|
+
};
|
|
4182
|
+
/*
|
|
4183
|
+
* Métodos privados
|
|
4184
|
+
*/
|
|
4185
|
+
/**
|
|
4186
|
+
* Genera una clave única para el componente
|
|
4187
|
+
* @private
|
|
4188
|
+
*/
|
|
4189
|
+
TreeItemComponent.generateStaticItemKey = function () {
|
|
4190
|
+
var key = 'tree-item-key-' + TreeItemComponent._treeItemKeySuffix;
|
|
4191
|
+
TreeItemComponent._treeItemKeySuffix++;
|
|
4192
|
+
return key;
|
|
4193
|
+
};
|
|
4194
|
+
return TreeItemComponent;
|
|
4195
|
+
}(AccessibilityComponent));
|
|
4196
|
+
TreeItemComponent._treeItemKeySuffix = 0; // Sufijo estático para generar siempre claves distintas
|
|
4197
|
+
TreeItemComponent.decorators = [
|
|
4198
|
+
{ type: i0.Component, args: [{
|
|
4199
|
+
selector: 'desy-tree-item',
|
|
4200
|
+
template: "<li *ngIf=\"allParentsExpanded && !isHidden(); else hidden\"\r\n [id]=\"id\"\r\n [class]=\"'c-tree__item focus:outline-none'\"\r\n [ngClass]=\"{\r\n 'ml-4': subLevel === 0,\r\n 'ml-8': subLevel !== 0,\r\n 'c-tree__item--focus': isFocus && !sub,\r\n 'c-tree__item--hover': isHover && !sub\r\n }\"\r\n (focusin)=\"handleItemFocus(true, !sub)\"\r\n (focusout)=\"handleItemFocus(false, !sub)\"\r\n (mouseover)=\"handleItemHover(true, !sub)\"\r\n (mouseout)=\"handleItemHover(false, !sub)\"\r\n (keydown.home)=\"handleHome($event, !sub)\"\r\n (keydown.end)=\"handleEnd($event, !sub)\"\r\n (keydown.arrowup)=\"handleArrowUp($event, !sub)\"\r\n (keydown.arrowdown)=\"handleArrowDown($event, !sub)\"\r\n (keydown.arrowright)=\"handleArrowRight($event, !sub)\"\r\n (keydown.arrowleft)=\"handleArrowLeft($event, !sub)\"\r\n role=\"treeitem\"\r\n [attr.aria-expanded]=\"sub ? (expanded ? 'true' : 'false') : null\"\r\n [attr.aria-current]=\"isActive() && subLevel === 0 ? 'page' : null\"\r\n [attr.disabled]=\"disabled && subLevel === 0 ? 'disabled' : null\"\r\n [attr.aria-disabled]=\"disabled && subLevel === 0 ? 'true' : null\"\r\n [attr.tabIndex]=\"disabled && subLevel === 0 ? '-1' : null\">\r\n <div *ngIf=\"!sub && subLevel !== 0; else childrenTree\"\r\n [id]=\"id\"\r\n [class]=\"['block', classes] | makeHtmlList\"\r\n [attr.title]=\"title ? title : null\"\r\n [attr.disabled]=\"disabled ? 'disabled' : null\"\r\n\r\n [attr.role]=\"role ? role : 'tree'\"\r\n [attr.aria-describedby]=\"ariaDescribedBy ? ariaDescribedBy : null\"\r\n [attr.aria-labelledby]=\"ariaLabelledBy ? ariaLabelledBy : null\"\r\n [attr.aria-hidden]=\"ariaHidden ? ariaHidden : null\"\r\n [attr.aria-disabled]=\"ariaDisabled ? ariaDisabled : (disabled ? 'true' : null)\"\r\n [attr.aria-controls]=\"ariaControls ? ariaControls : null\"\r\n [attr.aria-current]=\"ariaCurrent ? ariaCurrent : (isActive() ? 'page' : null)\"\r\n [attr.aria-live]=\"ariaLive ? ariaLive : null\"\r\n [attr.aria-expanded]=\"ariaExpanded ? ariaExpanded : null\"\r\n [attr.aria-errormessage]=\"ariaErrorMessage ? ariaErrorMessage : null\"\r\n [attr.aria-haspopup]=\"ariaHasPopup ? ariaHasPopup : null\"\r\n [attr.aria-modal]=\"ariaModal ? ariaModal : null\"\r\n [attr.tabindex]=\"tabindex ? tabindex : (disabled ? '-1' : null)\">\r\n <ng-container *ngTemplateOutlet=\"checkbox\"></ng-container>\r\n </div>\r\n</li>\r\n\r\n<ng-template #childrenTree>\r\n <div *ngIf=\"sub; else checkbox\" class=\"w-full h-full\"\r\n [ngClass]=\"{'c-tree__item--focus': isFocus && sub, 'c-tree__item--hover': isHover && sub}\"\r\n (focusin)=\"handleItemFocus(true)\"\r\n (focusout)=\"handleItemFocus(false)\"\r\n (mouseover)=\"handleItemHover(true)\"\r\n (mouseout)=\"handleItemHover(false)\"\r\n (keydown.home)=\"handleHome($event)\"\r\n (keydown.end)=\"handleEnd($event)\"\r\n (keydown.arrowup)=\"handleArrowUp($event)\"\r\n (keydown.arrowdown)=\"handleArrowDown($event)\"\r\n (keydown.arrowright)=\"handleArrowRight($event)\"\r\n (keydown.arrowLeft)=\"handleArrowLeft($event)\">\r\n <div [class]=\"['w-full flex items-center relative focus:bg-warning-base focus:outline-none focus:shadow-outline-focus focus:text-black text-left', classes] | makeHtmlList\"\r\n\r\n [attr.role]=\"role ? role : null\"\r\n [attr.aria-describedby]=\"ariaDescribedBy ? ariaDescribedBy : null\"\r\n [attr.aria-labelledby]=\"ariaLabelledBy ? ariaLabelledBy : null\"\r\n [attr.aria-hidden]=\"ariaHidden ? ariaHidden : null\"\r\n [attr.aria-disabled]=\"ariaDisabled ? ariaDisabled : null\"\r\n [attr.aria-controls]=\"ariaControls ? ariaControls : null\"\r\n [attr.aria-current]=\"ariaCurrent ? ariaCurrent : null\"\r\n [attr.aria-live]=\"ariaLive ? ariaLive : null\"\r\n [attr.aria-expanded]=\"ariaExpanded ? ariaExpanded : null\"\r\n [attr.aria-errormessage]=\"ariaErrorMessage ? ariaErrorMessage : null\"\r\n [attr.aria-haspopup]=\"ariaHasPopup ? ariaHasPopup : null\"\r\n [attr.aria-modal]=\"ariaModal ? ariaModal : null\"\r\n [attr.tabindex]=\"tabindex ? tabindex : null\">\r\n <span class=\"absolute top-3 -left-4 flex items-center w-4 h-2.5 text-primary-base font-bold\">\r\n <svg (click)=\"expandSub(false)\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 10 10\" width=\"10\" height=\"10\" aria-hidden=\"true\" class=\"c-tree__minus\"><path fill=\"currentColor\" d=\"M9.286 5.714H.714a.714.714 0 010-1.428h8.572a.714.714 0 010 1.428z\"/></svg>\r\n <svg (click)=\"expandSub(true)\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 10 10\" width=\"10\" height=\"10\" aria-hidden=\"true\" class=\"c-tree__plus\"><path fill=\"currentColor\" d=\"M9.286 4.286H5.893a.179.179 0 01-.179-.179V.714a.714.714 0 00-1.428 0v3.393a.179.179 0 01-.179.179H.714a.714.714 0 000 1.428h3.393a.179.179 0 01.179.179v3.393a.714.714 0 001.428 0V5.893a.179.179 0 01.179-.179h3.393a.714.714 0 000-1.428z\"/></svg>\r\n </span>\r\n <ng-container *ngTemplateOutlet=\"checkbox\"></ng-container>\r\n </div>\r\n </div>\r\n\r\n <ng-container *desyCustomInnerContent=\"{ component: sub }\"></ng-container>\r\n</ng-template>\r\n\r\n<!-- Se incorpora el contenido m\u00EDnimo para funcionar con el objetivo de mejorar el rendimiento -->\r\n<ng-template #hidden>\r\n <li class=\"hidden\">\r\n <div #hiddenWrapper>\r\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\r\n </div>\r\n <ng-container *desyCustomInnerContent=\"{ component: sub }\"></ng-container>\r\n </li>\r\n</ng-template>\r\n\r\n<ng-template #checkbox>\r\n <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 <div class=\"font-bold\" *ngIf=\"isActive(); else contentLabel\">\r\n <ng-container *ngTemplateOutlet=\"contentLabel\"></ng-container>\r\n </div>\r\n <ng-content select=\"desy-hint\"></ng-content>\r\n</ng-template>\r\n\r\n<ng-template #contentLabel>\r\n <ng-content select=\"desy-label\"></ng-content>\r\n</ng-template>\r\n",
|
|
4201
|
+
providers: [
|
|
4202
|
+
{
|
|
4203
|
+
provide: ITreeItem,
|
|
4204
|
+
useExisting: i0.forwardRef(function () { return TreeItemComponent; })
|
|
4205
|
+
}
|
|
4206
|
+
]
|
|
4207
|
+
},] }
|
|
4208
|
+
];
|
|
4209
|
+
TreeItemComponent.ctorParameters = function () { return [
|
|
4210
|
+
{ type: i0.ChangeDetectorRef },
|
|
4211
|
+
{ type: i0.ElementRef }
|
|
4212
|
+
]; };
|
|
4213
|
+
TreeItemComponent.propDecorators = {
|
|
4214
|
+
hiddenWrapper: [{ type: i0.ViewChild, args: ['hiddenWrapper',] }],
|
|
4215
|
+
id: [{ type: i0.Input }],
|
|
4216
|
+
name: [{ type: i0.Input }],
|
|
4217
|
+
value: [{ type: i0.Input }],
|
|
4218
|
+
classes: [{ type: i0.Input }],
|
|
4219
|
+
active: [{ type: i0.Input }],
|
|
4220
|
+
disabled: [{ type: i0.Input }],
|
|
4221
|
+
title: [{ type: i0.Input }],
|
|
4222
|
+
hasDividers: [{ type: i0.Input }],
|
|
4223
|
+
isIndeterminate: [{ type: i0.Input }],
|
|
4224
|
+
checked: [{ type: i0.Input }],
|
|
4225
|
+
checkedChange: [{ type: i0.Output }],
|
|
4226
|
+
expanded: [{ type: i0.Input }],
|
|
4227
|
+
expandedChange: [{ type: i0.Output }],
|
|
4228
|
+
indeterminateChecked: [{ type: i0.Input }],
|
|
4229
|
+
indeterminateCheckedChange: [{ type: i0.Output }],
|
|
4230
|
+
sub: [{ type: i0.ContentChildren, args: [TreeSubComponent,] }],
|
|
4231
|
+
hint: [{ type: i0.ContentChildren, args: [HintComponent,] }],
|
|
4232
|
+
label: [{ type: i0.ContentChildren, args: [LabelComponent,] }],
|
|
4233
|
+
checkbox: [{ type: i0.ViewChild, args: [TreeCheckboxComponent,] }],
|
|
4234
|
+
treeItemKey: [{ type: i0.HostBinding, args: ['attr.desy-tree-item-key',] }]
|
|
4235
|
+
};
|
|
4236
|
+
__decorate([
|
|
4237
|
+
DesyOnInputChange('setDefaultIdRecursive')
|
|
4238
|
+
], TreeItemComponent.prototype, "id", void 0);
|
|
4239
|
+
__decorate([
|
|
4240
|
+
DesyContentChild({ onSetCallbackName: 'overrideSubValues' })
|
|
4241
|
+
], TreeItemComponent.prototype, "sub", void 0);
|
|
4242
|
+
__decorate([
|
|
4243
|
+
DesyContentChild()
|
|
4244
|
+
], TreeItemComponent.prototype, "hint", void 0);
|
|
4245
|
+
__decorate([
|
|
4246
|
+
DesyContentChild()
|
|
4247
|
+
], TreeItemComponent.prototype, "label", void 0);
|
|
4248
|
+
|
|
4249
|
+
var TreeComponent = /** @class */ (function (_super) {
|
|
4250
|
+
__extends(TreeComponent, _super);
|
|
4251
|
+
function TreeComponent(changeDetector) {
|
|
4252
|
+
var _this = _super.call(this) || this;
|
|
4253
|
+
_this.changeDetector = changeDetector;
|
|
4254
|
+
_this.expandedFirstLevel = true;
|
|
4255
|
+
_this.decoupleChildFromParent = false;
|
|
4256
|
+
_this.disableDefaultSearch = false;
|
|
4257
|
+
_this.searchMatchValuesChange = new i0.EventEmitter();
|
|
4258
|
+
_this.rootItems = [];
|
|
4259
|
+
_this._itemListCheckedSubscriptions = [];
|
|
4260
|
+
_this._itemListQuitFocusSubscriptions = [];
|
|
4261
|
+
_this._alreadyConfiguringItems = false;
|
|
4262
|
+
return _this;
|
|
4263
|
+
}
|
|
4264
|
+
TreeComponent.prototype.ngOnDestroy = function () {
|
|
4265
|
+
var _a, _b;
|
|
4266
|
+
this.clearSubscriptions(this._itemListCheckedSubscriptions);
|
|
4267
|
+
this.clearSubscriptions(this._itemListQuitFocusSubscriptions);
|
|
4268
|
+
(_a = this._itemListSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
4269
|
+
(_b = this._allItemListSubscription) === null || _b === void 0 ? void 0 : _b.unsubscribe();
|
|
4270
|
+
};
|
|
4271
|
+
TreeComponent.prototype.ngOnChanges = function (changes) {
|
|
4272
|
+
this.configureAllItems();
|
|
4273
|
+
};
|
|
4274
|
+
/*
|
|
4275
|
+
* Eventos
|
|
4276
|
+
*/
|
|
4277
|
+
/**
|
|
4278
|
+
* Actualiza el valor del componente al checkquearse un ítem
|
|
4279
|
+
* @param originItem ítem modificado
|
|
4280
|
+
*/
|
|
4281
|
+
TreeComponent.prototype.updateValueFromItems = function (originItem) {
|
|
4282
|
+
var _this = this;
|
|
4283
|
+
// Si es radio, se desactivan el resto de items cuando se activa otro item
|
|
4284
|
+
if (this.type !== 'checkbox') {
|
|
4285
|
+
var items = this.getAllItemsInOrder();
|
|
4286
|
+
items.forEach(function (item) {
|
|
4287
|
+
if (item !== originItem && item.checked) {
|
|
4288
|
+
item.setChecked(false, true);
|
|
4289
|
+
}
|
|
4290
|
+
});
|
|
4291
|
+
}
|
|
4292
|
+
else if (!this.decoupleChildFromParent) {
|
|
4293
|
+
this.rootItems.forEach(function (item) { return item.setCheckedAutomaticallyDependingOnChildren(); });
|
|
4294
|
+
}
|
|
4295
|
+
// Si es checkbox se modifica el valor y se emite
|
|
4296
|
+
if (this.type === 'checkbox') {
|
|
4297
|
+
this.value = [];
|
|
4298
|
+
var items = this.getAllItemsInOrder();
|
|
4299
|
+
items.forEach(function (item) {
|
|
4300
|
+
if (item.checked) {
|
|
4301
|
+
_this.value.push(item.value);
|
|
4302
|
+
}
|
|
4303
|
+
});
|
|
4304
|
+
this.onChange(this.value);
|
|
4305
|
+
}
|
|
4306
|
+
};
|
|
4307
|
+
/**
|
|
4308
|
+
* Gestiona cuando el foco abandona un ítem desde un evento de teclado controlado
|
|
4309
|
+
* @param options
|
|
4310
|
+
*/
|
|
4311
|
+
TreeComponent.prototype.handleItemQuitFocus = function (options) {
|
|
4312
|
+
if (options && options.nextElement) {
|
|
4313
|
+
var items = this.getAllItemsInOrder();
|
|
4314
|
+
var focusableItems = items.filter(function (item) { return !item.isHidden() && !item.disabled && item.allParentsExpanded; });
|
|
4315
|
+
switch (options.nextElement) {
|
|
4316
|
+
case "first":
|
|
4317
|
+
focusableItems[0].focus();
|
|
4318
|
+
break;
|
|
4319
|
+
case "last":
|
|
4320
|
+
focusableItems[focusableItems.length - 1].focus();
|
|
4321
|
+
break;
|
|
4322
|
+
case "parent":
|
|
4323
|
+
var currentSubLevel_1 = options.currentItem.subLevel;
|
|
4324
|
+
if (currentSubLevel_1 > 0) {
|
|
4325
|
+
var currentItemIndex = focusableItems.findIndex(function (item) { return item === options.currentItem; });
|
|
4326
|
+
var parent = focusableItems.slice(0, currentItemIndex).reverse().find(function (item) { return item.subLevel < currentSubLevel_1; });
|
|
4327
|
+
if (parent) {
|
|
4328
|
+
parent.focus();
|
|
4329
|
+
}
|
|
4330
|
+
}
|
|
4331
|
+
break;
|
|
4332
|
+
case "firstChild":
|
|
4333
|
+
case "next":
|
|
4334
|
+
if (options.currentItem) {
|
|
4335
|
+
var currentItemIndex = focusableItems.findIndex(function (item) { return item === options.currentItem; });
|
|
4336
|
+
if (currentItemIndex < focusableItems.length - 1) {
|
|
4337
|
+
focusableItems[currentItemIndex + 1].focus();
|
|
4338
|
+
}
|
|
4339
|
+
}
|
|
4340
|
+
break;
|
|
4341
|
+
case "previous":
|
|
4342
|
+
if (options.currentItem) {
|
|
4343
|
+
var currentItemIndex = focusableItems.findIndex(function (item) { return item === options.currentItem; });
|
|
4344
|
+
if (currentItemIndex > 0) {
|
|
4345
|
+
focusableItems[currentItemIndex - 1].focus();
|
|
4346
|
+
}
|
|
4347
|
+
}
|
|
4348
|
+
break;
|
|
4349
|
+
}
|
|
4350
|
+
}
|
|
4351
|
+
};
|
|
4352
|
+
/**
|
|
4353
|
+
* Realiza la búsqueda interna de los items en el componente
|
|
4354
|
+
* @param value texto de búsqueda
|
|
4355
|
+
*/
|
|
4356
|
+
TreeComponent.prototype.onSearch = function (value) {
|
|
4357
|
+
if (!this.disableDefaultSearch) {
|
|
4358
|
+
if (value && value.length > 0) {
|
|
4359
|
+
this.searchMatchValues = this.allItems.filter(function (item) { return item.matchesText(value); }).map(function (item) { return item.value; });
|
|
4360
|
+
}
|
|
4361
|
+
else {
|
|
4362
|
+
this.searchMatchValues = null;
|
|
4363
|
+
}
|
|
4364
|
+
this.searchMatchValuesChange.emit(this.searchMatchValues);
|
|
4365
|
+
}
|
|
4366
|
+
};
|
|
4367
|
+
/*
|
|
4368
|
+
* Eventos al cambiar propiedades
|
|
4369
|
+
*/
|
|
4370
|
+
/**
|
|
4371
|
+
* Configura los items del árbol
|
|
4372
|
+
*/
|
|
4373
|
+
TreeComponent.prototype.configureAllItems = function () {
|
|
4374
|
+
var _this = this;
|
|
4375
|
+
if (!this._alreadyConfiguringItems) {
|
|
4376
|
+
this._alreadyConfiguringItems = true;
|
|
4377
|
+
// Lo realizamos desde un setTimeout para que todos los inputs, values y demás vivan en paz y armonía
|
|
4378
|
+
setTimeout(function () {
|
|
4379
|
+
var _a;
|
|
4380
|
+
if (((_a = _this.allItems) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
4381
|
+
_this.clearSubscriptions(_this._itemListCheckedSubscriptions);
|
|
4382
|
+
_this.clearSubscriptions(_this._itemListQuitFocusSubscriptions);
|
|
4383
|
+
_this.allItems.forEach(function (item) {
|
|
4384
|
+
item.parentName = _this.name;
|
|
4385
|
+
item.type = _this.type;
|
|
4386
|
+
item.inheritedDescribedBy = _this.getDescribedByForItems();
|
|
4387
|
+
item.inheritedExpandedFirstLevel = _this.expandedFirstLevel;
|
|
4388
|
+
item.inheritedDecoupleChildFromParent = _this.decoupleChildFromParent;
|
|
4389
|
+
if (_this.value && _this.value.length > 0) {
|
|
4390
|
+
item.setChecked(!!_this.value.find(function (v) { return v === item.value; }), true);
|
|
4391
|
+
}
|
|
4392
|
+
item.detectChanges();
|
|
4393
|
+
var checkedSubscription = item.checkedChangeForTree.subscribe(function () { return _this.updateValueFromItems(item); });
|
|
4394
|
+
_this._itemListCheckedSubscriptions.push(checkedSubscription);
|
|
4395
|
+
var quitFocusSubscription = item.quitFocus.subscribe(function (options) { return _this.handleItemQuitFocus(options); });
|
|
4396
|
+
_this._itemListQuitFocusSubscriptions.push(quitFocusSubscription);
|
|
4397
|
+
});
|
|
4398
|
+
_this.setErrorInItems(_this.hasErrorMessageComponent());
|
|
4399
|
+
_this.buildTree();
|
|
4400
|
+
if (!_this.value) {
|
|
4401
|
+
_this.updateValueFromItems();
|
|
4402
|
+
}
|
|
4403
|
+
}
|
|
4404
|
+
if (_this.allItems && !_this._allItemListSubscription) {
|
|
4405
|
+
_this._allItemListSubscription = _this.allItems.changes.subscribe(function () { return _this.configureAllItems(); });
|
|
4406
|
+
}
|
|
4407
|
+
_this.changeDetector.detectChanges();
|
|
4408
|
+
_this._alreadyConfiguringItems = false;
|
|
4409
|
+
});
|
|
4410
|
+
}
|
|
4411
|
+
};
|
|
4412
|
+
/**
|
|
4413
|
+
* Modifica los items visibles según el filtro de búsqueda
|
|
4414
|
+
*/
|
|
4415
|
+
TreeComponent.prototype.onSearchMatchValuesChange = function () {
|
|
4416
|
+
var _this = this;
|
|
4417
|
+
if (this.allItems) {
|
|
4418
|
+
this.allItems.forEach(function (item) {
|
|
4419
|
+
item.inheritedMatchesSearch = true;
|
|
4420
|
+
});
|
|
4421
|
+
if (this.searchMatchValues !== null && this.searchMatchValues !== undefined) {
|
|
4422
|
+
this.allItems.forEach(function (item) {
|
|
4423
|
+
if (_this.searchMatchValues.findIndex(function (value) { return item.value === value; }) < 0) {
|
|
4424
|
+
item.inheritedMatchesSearch = false;
|
|
4425
|
+
}
|
|
4426
|
+
});
|
|
4427
|
+
}
|
|
4428
|
+
}
|
|
4429
|
+
};
|
|
4430
|
+
/*
|
|
4431
|
+
* Getters and setters
|
|
4432
|
+
*/
|
|
4433
|
+
TreeComponent.prototype.getIdPrefix = function () {
|
|
4434
|
+
return this.idPrefix ? this.idPrefix : this.name;
|
|
4435
|
+
};
|
|
4436
|
+
TreeComponent.prototype.getDescribedBy = function () {
|
|
4437
|
+
var describedBy = '';
|
|
4438
|
+
if (this.describedBy) {
|
|
4439
|
+
describedBy = this.describedBy;
|
|
4440
|
+
}
|
|
4441
|
+
if (this.hasHintComponent() && this.hintComponent.id) {
|
|
4442
|
+
describedBy = describedBy + ' ' + this.hintComponent.id;
|
|
4443
|
+
}
|
|
4444
|
+
if (this.hasErrorMessageComponent() && this.errorMessageComponent.id) {
|
|
4445
|
+
describedBy = describedBy + ' ' + this.errorMessageComponent.id;
|
|
4446
|
+
}
|
|
4447
|
+
return describedBy;
|
|
4448
|
+
};
|
|
4449
|
+
/**
|
|
4450
|
+
* Devuelve el valor de describedBy que se transmitirá a los items
|
|
4451
|
+
*/
|
|
4452
|
+
TreeComponent.prototype.getDescribedByForItems = function () {
|
|
4453
|
+
var describedBy;
|
|
4454
|
+
if (this.hasFieldsetComponent()) {
|
|
4455
|
+
describedBy = this.fieldsetComponent.describedBy;
|
|
4456
|
+
}
|
|
4457
|
+
else {
|
|
4458
|
+
describedBy = this.getDescribedBy();
|
|
4459
|
+
}
|
|
4460
|
+
return describedBy;
|
|
4461
|
+
};
|
|
4462
|
+
TreeComponent.prototype.hasFieldsetComponent = function () {
|
|
4463
|
+
return !!this.fieldsetComponent;
|
|
4464
|
+
};
|
|
4465
|
+
/**
|
|
4466
|
+
* Overrides super.getHintId();
|
|
4467
|
+
*/
|
|
4468
|
+
TreeComponent.prototype.getHintId = function () {
|
|
4469
|
+
var _a;
|
|
4470
|
+
return this.idPrefix ? this.idPrefix + '-hint' : (_a = this.hintComponent) === null || _a === void 0 ? void 0 : _a.id;
|
|
4471
|
+
};
|
|
4472
|
+
/**
|
|
4473
|
+
* Overrides super.getHintId();
|
|
4474
|
+
*/
|
|
4475
|
+
TreeComponent.prototype.getErrorId = function () {
|
|
4476
|
+
var _a;
|
|
4477
|
+
return this.idPrefix ? this.idPrefix + '-error' : (_a = this.errorMessageComponent) === null || _a === void 0 ? void 0 : _a.id;
|
|
4478
|
+
};
|
|
4479
|
+
/*
|
|
4480
|
+
* Funciones para reemplazar el contenido del fieldset, label, hint o errormessage
|
|
4481
|
+
*/
|
|
4482
|
+
TreeComponent.prototype.overrideFieldsetParams = function (fieldset) {
|
|
4483
|
+
fieldset.caller = this.innerHtml;
|
|
4484
|
+
fieldset.errorId = this.getErrorId();
|
|
4485
|
+
fieldset.describedBy = this.getDescribedBy();
|
|
4486
|
+
fieldset.detectChanges();
|
|
4487
|
+
};
|
|
4488
|
+
TreeComponent.prototype.overrideSearchBarParams = function (searchbar) {
|
|
4489
|
+
var _this = this;
|
|
4490
|
+
var defaultOnChange = searchbar.onChange;
|
|
4491
|
+
var newOnChange = function (value) {
|
|
4492
|
+
_this.onSearch(value);
|
|
4493
|
+
defaultOnChange(value);
|
|
4494
|
+
};
|
|
4495
|
+
searchbar.registerOnChange(newOnChange);
|
|
4496
|
+
};
|
|
4497
|
+
/**
|
|
4498
|
+
* Se llama desde FormField
|
|
4499
|
+
*/
|
|
4500
|
+
TreeComponent.prototype.overrideHintParams = function (hint) {
|
|
4501
|
+
hint.id = this.getHintId();
|
|
4502
|
+
hint.detectChanges();
|
|
4503
|
+
};
|
|
4504
|
+
/**
|
|
4505
|
+
* Se llama desde FormField
|
|
4506
|
+
*/
|
|
4507
|
+
TreeComponent.prototype.overrideErrorMessageParams = function (errorMessage) {
|
|
4508
|
+
errorMessage.id = this.getErrorId();
|
|
4509
|
+
this.setErrorInItems(this.hasErrorMessageComponent());
|
|
4510
|
+
errorMessage.detectChanges();
|
|
4511
|
+
};
|
|
4512
|
+
/**
|
|
4513
|
+
* Se llama desde FormField
|
|
4514
|
+
*/
|
|
4515
|
+
TreeComponent.prototype.onDeleteErrorMessage = function (errorMessage) {
|
|
4516
|
+
this.setErrorInItems(this.hasErrorMessageComponent());
|
|
4517
|
+
};
|
|
4518
|
+
/*
|
|
4519
|
+
* Métodos privados
|
|
4520
|
+
*/
|
|
4521
|
+
/**
|
|
4522
|
+
* Configura la estructura del árbol
|
|
4523
|
+
* @private
|
|
4524
|
+
*/
|
|
4525
|
+
TreeComponent.prototype.buildTree = function () {
|
|
4526
|
+
var _this = this;
|
|
4527
|
+
// Se crea un mapa para tener accesibles los items por key y se borran los listados existentes
|
|
4528
|
+
var itemMap = {};
|
|
4529
|
+
this.rootItems = [];
|
|
4530
|
+
this.allItems.forEach(function (item) {
|
|
4531
|
+
var key = item.getKey();
|
|
4532
|
+
itemMap[key] = item;
|
|
4533
|
+
if (item.sub) {
|
|
4534
|
+
item.sub.itemList = [];
|
|
4535
|
+
}
|
|
4536
|
+
});
|
|
4537
|
+
// Se añaden los items a los listados correspondientes
|
|
4538
|
+
this.allItems.forEach(function (item) {
|
|
4539
|
+
var parentKey = item.getParentKey();
|
|
4540
|
+
if (parentKey === 'root') {
|
|
4541
|
+
_this.rootItems.push(item);
|
|
4542
|
+
}
|
|
4543
|
+
else if (parentKey) {
|
|
4544
|
+
var sub = itemMap[parentKey].sub;
|
|
4545
|
+
if (sub) {
|
|
4546
|
+
sub.itemList.push(item);
|
|
4547
|
+
}
|
|
4548
|
+
}
|
|
4549
|
+
});
|
|
4550
|
+
// Se configuran los items desde root
|
|
4551
|
+
var order = 0;
|
|
4552
|
+
this.rootItems.forEach(function (item, index) {
|
|
4553
|
+
item.setSubLevel(0);
|
|
4554
|
+
item.setDefaultId(_this.idPrefix + "-" + index);
|
|
4555
|
+
item.refreshAllParentsExpandedRecursive(true);
|
|
4556
|
+
item.setCheckedAutomaticallyDependingOnChildren();
|
|
4557
|
+
order = item.setOrderRecursively(order);
|
|
4558
|
+
});
|
|
3510
4559
|
};
|
|
3511
|
-
|
|
3512
|
-
|
|
4560
|
+
/**
|
|
4561
|
+
* Si tiene un mensaje de error, se indica a los items
|
|
4562
|
+
* @param hasError
|
|
4563
|
+
* @private
|
|
4564
|
+
*/
|
|
4565
|
+
TreeComponent.prototype.setErrorInItems = function (hasError) {
|
|
4566
|
+
var _a;
|
|
4567
|
+
if (((_a = this.allItems) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
4568
|
+
this.allItems.forEach(function (item) {
|
|
4569
|
+
item.inheritedHasError = hasError;
|
|
4570
|
+
item.detectChanges();
|
|
4571
|
+
});
|
|
4572
|
+
}
|
|
3513
4573
|
};
|
|
3514
|
-
|
|
3515
|
-
|
|
4574
|
+
/**
|
|
4575
|
+
* Limpia un listado de subscripciones
|
|
4576
|
+
* @param subscriptionList
|
|
4577
|
+
* @private
|
|
4578
|
+
*/
|
|
4579
|
+
TreeComponent.prototype.clearSubscriptions = function (subscriptionList) {
|
|
4580
|
+
if (subscriptionList.length > 0) {
|
|
4581
|
+
subscriptionList.forEach(function (s) { return s.unsubscribe(); });
|
|
4582
|
+
subscriptionList.splice(0, subscriptionList.length);
|
|
4583
|
+
}
|
|
3516
4584
|
};
|
|
3517
|
-
|
|
4585
|
+
/**
|
|
4586
|
+
* Devuelve los items del árbol ordenados
|
|
4587
|
+
* @private
|
|
4588
|
+
*/
|
|
4589
|
+
TreeComponent.prototype.getAllItemsInOrder = function () {
|
|
4590
|
+
var list = [];
|
|
4591
|
+
if (this.allItems) {
|
|
4592
|
+
list = this.allItems.toArray().sort(function (a, b) { return a.orderInTree > b.orderInTree ? 1 : -1; });
|
|
4593
|
+
}
|
|
4594
|
+
return list;
|
|
4595
|
+
};
|
|
4596
|
+
return TreeComponent;
|
|
3518
4597
|
}(FormFieldComponent));
|
|
3519
|
-
|
|
3520
|
-
{
|
|
3521
|
-
name: 'day',
|
|
3522
|
-
classes: 'w-14',
|
|
3523
|
-
maxlength: 2
|
|
3524
|
-
},
|
|
3525
|
-
{
|
|
3526
|
-
name: 'month',
|
|
3527
|
-
classes: 'w-14',
|
|
3528
|
-
maxlength: 2
|
|
3529
|
-
},
|
|
3530
|
-
{
|
|
3531
|
-
name: 'year',
|
|
3532
|
-
classes: 'w-20',
|
|
3533
|
-
maxlength: 4
|
|
3534
|
-
}
|
|
3535
|
-
];
|
|
3536
|
-
DateInputComponent.decorators = [
|
|
4598
|
+
TreeComponent.decorators = [
|
|
3537
4599
|
{ type: i0.Component, args: [{
|
|
3538
|
-
selector: 'desy-
|
|
3539
|
-
template: "\r\n<ng-template #innerHtml>\r\n <ng-container *ngIf=\"hasHintComponent()\">\r\n <ng-content select=\"desy-hint\"></ng-content>\r\n </ng-container>\r\n <ng-container *ngIf=\"!hasHintComponent()\">\r\n <ng-container *ngTemplateOutlet=\"hintRef\"></ng-container>\r\n <desy-hint *ngIf=\"!hintRef && hintData\"\r\n [id]=\"getHintId()\"\r\n [text]=\"hintData.text\"\r\n [html]=\"hintData.html\"\r\n [classes]=\"hintData.classes\"\r\n [role]=\"hintData.role\"\r\n [ariaLabel]=\"hintData.ariaLabel\"\r\n [ariaDescribedBy]=\"hintData.ariaDescribedBy\"\r\n [ariaLabelledBy]=\"hintData.ariaLabelledBy\"\r\n [ariaHidden]=\"hintData.ariaHidden\"\r\n [ariaDisabled]=\"hintData.ariaDisabled\"\r\n [ariaControls]=\"hintData.ariaControls\"\r\n [ariaCurrent]=\"hintData.ariaCurrent\"\r\n [ariaLive]=\"hintData.ariaLive\"\r\n [ariaExpanded]=\"hintData.ariaExpanded\"\r\n [ariaErrorMessage]=\"hintData.ariaErrorMessage\"\r\n [ariaHasPopup]=\"hintData.ariaHasPopup\"\r\n [tabindex]=\"hintData.tabindex\"></desy-hint>\r\n <desy-hint *ngIf=\"!hintRef && !hintData && hintText\" [text]=\"hintText\" [id]=\"getHintId()\"></desy-hint>\r\n </ng-container>\r\n\r\n\r\n <ng-container *ngIf=\"hasErrorMessageComponent()\">\r\n <ng-content select=\"desy-error-message\"></ng-content>\r\n </ng-container>\r\n <ng-container *ngIf=\"!hasErrorMessageComponent()\">\r\n <ng-container *ngTemplateOutlet=\"errorMessageRef\"></ng-container>\r\n <desy-error-message *ngIf=\"!errorMessageRef && errorMessageData\"\r\n [id]=\"getErrorId()\"\r\n [text]=\"errorMessageData.text\"\r\n [html]=\"errorMessageData.html\"\r\n [classes]=\"errorMessageData.classes\"\r\n [visuallyHiddenText]=\"errorMessageData.visuallyHiddenText\"\r\n [role]=\"errorMessageData.role\"\r\n [ariaLabel]=\"errorMessageData.ariaLabel\"\r\n [ariaDescribedBy]=\"errorMessageData.ariaDescribedBy\"\r\n [ariaLabelledBy]=\"errorMessageData.ariaLabelledBy\"\r\n [ariaHidden]=\"errorMessageData.ariaHidden\"\r\n [ariaDisabled]=\"errorMessageData.ariaDisabled\"\r\n [ariaControls]=\"errorMessageData.ariaControls\"\r\n [ariaCurrent]=\"errorMessageData.ariaCurrent\"\r\n [ariaLive]=\"errorMessageData.ariaLive\"\r\n [ariaExpanded]=\"errorMessageData.ariaExpanded\"\r\n [ariaErrorMessage]=\"errorMessageData.ariaErrorMessage\"\r\n [ariaHasPopup]=\"errorMessageData.ariaHasPopup\"\r\n [tabindex]=\"errorMessageData.tabindex\"></desy-error-message>\r\n <desy-error-message *ngIf=\"!errorMessageRef && !errorMessageData && errorMessageText\"\r\n [text]=\"errorMessageText\" [id]=\"getErrorId()\"></desy-error-message>\r\n </ng-container>\r\n\r\n <!-- With reactive forms -->\r\n <div *ngIf=\"controlContainer && !ngModelGroup\"\r\n [formGroup]=\"controlContainer.control\"\r\n [class]=\"['flex', classes] | makeHtmlList\"\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 <ng-container *ngFor=\"let item of getItems(); index as i\">\r\n <ng-container *ngIf=\"item.divider\">\r\n <div role=\"separator\" [ngClass]=\"item.divider.classes\">\r\n <ng-container *desyCustomInnerContent=\"{ template: getItemDividerTemplate(item), html: getItemDividerHtml(item) }\"></ng-container>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngIf=\"!item.divider\">\r\n <div class=\"mr-base\">\r\n <desy-input [labelData]=\"getItemLabel(item)\"\r\n [labelRef]=\"getItemLabelRef(item)\"\r\n [id]=\"item.id ? item.id : id + '-' + item.name\"\r\n [classes]=\"['mb-0', item.classes] | makeHtmlList\"\r\n [errorId]=\"item.hasErrors ? getErrorId() : null\"\r\n [name]=\"getItemName(item)\"\r\n [formControlName]=\"getItemName(item)\"\r\n [type]=\"'text'\"\r\n [inputmode]=\"'numeric'\"\r\n [autocomplete]=\"item.autocomplete\"\r\n [pattern]=\"item.pattern ? item.pattern : '[0-9]*'\"\r\n\r\n [maxlength]=\"item.maxlength\"\r\n [role]=\"item.role\"\r\n [ariaLabel]=\"item.ariaLabel\"\r\n [ariaDescribedBy]=\"item.ariaDescribedBy\"\r\n [ariaLabelledBy]=\"item.ariaLabelledBy\"\r\n [ariaHidden]=\"item.ariaHidden\"\r\n [ariaDisabled]=\"item.ariaDisabled\"\r\n [ariaControls]=\"item.ariaControls\"\r\n [ariaCurrent]=\"item.ariaCurrent\"\r\n [ariaLive]=\"item.ariaLive\"\r\n [ariaExpanded]=\"item.ariaExpanded\"\r\n [ariaErrorMessage]=\"item.ariaErrorMessage\"\r\n [ariaHasPopup]=\"item.ariaHasPopup\"\r\n [tabindex]=\"item.tabindex\"></desy-input>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n\r\n <!-- Template-driven forms -->\r\n <desy-template-driven-wrapper *ngIf=\"controlContainer && ngModelGroup\">\r\n <div [ngModelGroup]=\"ngModelGroup\"\r\n [class]=\"['flex', classes] | makeHtmlList\"\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 <ng-container *ngFor=\"let item of getItems(); index as i\">\r\n \r\n <ng-container *ngIf=\"item.divider\">\r\n <div role=\"separator\" [ngClass]=\"item.divider.classes\">\r\n <ng-container *desyCustomInnerContent=\"{ template: getItemDividerTemplate(item), html: getItemDividerHtml(item) }\"></ng-container>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngIf=\"!item.divider\">\r\n <div class=\"mr-base\">\r\n <desy-input [labelData]=\"getItemLabel(item)\"\r\n [labelRef]=\"getItemLabelRef(item)\"\r\n [id]=\"item.id ? item.id : id + '-' + item.name\"\r\n [classes]=\"['mb-0', item.classes] | makeHtmlList\"\r\n [errorId]=\"item.hasErrors ? getErrorId() : null\"\r\n [name]=\"getItemName(item)\"\r\n [ngModel]=\"item.value\" (ngModelChange)=\"onInternalChange(item, +$event)\"\r\n [type]=\"'text'\"\r\n [inputmode]=\"'numeric'\"\r\n [autocomplete]=\"item.autocomplete\"\r\n [pattern]=\"item.pattern ? item.pattern : '[0-9]*'\"\r\n [disabled]=\"disabled ? true : null\"\r\n\r\n [maxlength]=\"item.maxlength\"\r\n [role]=\"item.role\"\r\n [ariaLabel]=\"item.ariaLabel\"\r\n [ariaDescribedBy]=\"item.ariaDescribedBy\"\r\n [ariaLabelledBy]=\"item.ariaLabelledBy\"\r\n [ariaHidden]=\"item.ariaHidden\"\r\n [ariaDisabled]=\"item.ariaDisabled\"\r\n [ariaControls]=\"item.ariaControls\"\r\n [ariaCurrent]=\"item.ariaCurrent\"\r\n [ariaLive]=\"item.ariaLive\"\r\n [ariaExpanded]=\"item.ariaExpanded\"\r\n [ariaErrorMessage]=\"item.ariaErrorMessage\"\r\n [ariaHasPopup]=\"item.ariaHasPopup\"\r\n [tabindex]=\"item.tabindex\"></desy-input>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n </desy-template-driven-wrapper>\r\n\r\n <!-- With ngModel-->\r\n <div *ngIf=\"!controlContainer\"\r\n [class]=\"['flex', classes] | makeHtmlList\"\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 <ng-container *ngFor=\"let item of getItems(); index as i\">\r\n \r\n <ng-container *ngIf=\"item.divider\">\r\n <div role=\"separator\" [ngClass]=\"item.divider.classes\">\r\n <ng-container *desyCustomInnerContent=\"{ template: getItemDividerTemplate(item), html: getItemDividerHtml(item) }\"></ng-container>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngIf=\"!item.divider\">\r\n <div class=\"mr-base\">\r\n <desy-input [labelData]=\"getItemLabel(item)\"\r\n [labelRef]=\"getItemLabelRef(item)\"\r\n [id]=\"item.id ? item.id : id + '-' + item.name\"\r\n [classes]=\"['mb-0', item.classes] | makeHtmlList\"\r\n [errorId]=\"item.hasErrors ? getErrorId() : null\"\r\n [name]=\"getItemName(item)\"\r\n [ngModel]=\"item.value\" (ngModelChange)=\"onInternalChange(item, +$event)\"\r\n [type]=\"'text'\"\r\n [inputmode]=\"'numeric'\"\r\n [autocomplete]=\"item.autocomplete\"\r\n [pattern]=\"item.pattern ? item.pattern : '[0-9]*'\"\r\n [disabled]=\"disabled ? true : null\"\r\n\r\n [maxlength]=\"item.maxlength\"\r\n [role]=\"item.role\"\r\n [ariaLabel]=\"item.ariaLabel\"\r\n [ariaDescribedBy]=\"item.ariaDescribedBy\"\r\n [ariaLabelledBy]=\"item.ariaLabelledBy\"\r\n [ariaHidden]=\"item.ariaHidden\"\r\n [ariaDisabled]=\"item.ariaDisabled\"\r\n [ariaControls]=\"item.ariaControls\"\r\n [ariaCurrent]=\"item.ariaCurrent\"\r\n [ariaLive]=\"item.ariaLive\"\r\n [ariaExpanded]=\"item.ariaExpanded\"\r\n [ariaErrorMessage]=\"item.ariaErrorMessage\"\r\n [ariaHasPopup]=\"item.ariaHasPopup\"\r\n [tabindex]=\"item.tabindex\"></desy-input>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n</div>\r\n</ng-template>\r\n\r\n<div [class]=\"['c-form-group', formGroupClasses] | makeHtmlList\"\r\n [ngClass]=\"{'c-form-group--error' : (hasErrorsMessage() || formGroupClasses == 'c-form-group--error')}\">\r\n\r\n <ng-container *ngIf=\"hasFieldsetComponent()\">\r\n <ng-content select=\"desy-fieldset\"></ng-content>\r\n </ng-container>\r\n <ng-container *ngIf=\"!hasFieldsetComponent()\">\r\n <desy-fieldset *ngIf=\"fieldsetData\"\r\n [classes]=\"fieldsetData.classes\"\r\n [id]=\"fieldsetData.id\"\r\n [legendData]=\"fieldsetData.legend\"\r\n [caller]=\"innerHtml\"\r\n [errorId]=\"getErrorId()\"\r\n [describedBy]=\"[fieldsetData.describedBy, getHintId(), getErrorId()] | makeHtmlList:null\"\r\n role=\"group\"\r\n [ariaLabel]=\"fieldsetData.ariaLabel\"\r\n [ariaLabelledBy]=\"fieldsetData.ariaLabelledBy\"\r\n [ariaHidden]=\"fieldsetData.ariaHidden\"\r\n [ariaDisabled]=\"fieldsetData.ariaDisabled\"\r\n [ariaControls]=\"fieldsetData.ariaControls\"\r\n [ariaCurrent]=\"fieldsetData.ariaCurrent\"\r\n [ariaLive]=\"fieldsetData.ariaLive\"\r\n [ariaExpanded]=\"fieldsetData.ariaExpanded\"\r\n [ariaHasPopup]=\"fieldsetData.ariaHasPopup\"\r\n [tabindex]=\"fieldsetData.tabindex\"></desy-fieldset>\r\n <desy-fieldset *ngIf=\"!fieldsetData && hasLegendComponent()\"\r\n [legendRef]=\"legendTemplate\"\r\n [caller]=\"innerHtml\"\r\n [errorId]=\"getErrorId()\"\r\n [describedBy]=\"[ getHintId(), getErrorId()] | makeHtmlList:null\">\r\n <ng-template #legendTemplate>\r\n <ng-content select=\"desy-legend\"></ng-content>\r\n </ng-template>\r\n </desy-fieldset>\r\n <desy-fieldset *ngIf=\"!fieldsetData && !hasLegendComponent() && legendRef\"\r\n [legendRef]=\"legendRef\"\r\n [caller]=\"innerHtml\"\r\n [errorId]=\"getErrorId()\"\r\n [describedBy]=\"[ getHintId(), getErrorId()] | makeHtmlList:null\"\r\n role=\"group\"></desy-fieldset>\r\n <desy-fieldset *ngIf=\"!fieldsetData && !hasLegendComponent() && !legendRef && legendData\"\r\n [legendData]=\"{text: legendData.text, html: legendData.html, classes: legendData.classes, isPageHeading: legendData.isPageHeading}\"\r\n [caller]=\"innerHtml\"\r\n [errorId]=\"getErrorId()\"\r\n [describedBy]=\"[ getHintId(), getErrorId()] | makeHtmlList:null\"\r\n role=\"group\"></desy-fieldset>\r\n <desy-fieldset *ngIf=\"!fieldsetData && !hasLegendComponent() && !legendRef && !legendData && legendText\"\r\n [legendText]=\"legendText\"\r\n [caller]=\"innerHtml\"\r\n [errorId]=\"getErrorId()\"\r\n [describedBy]=\"[ getHintId(), getErrorId()] | makeHtmlList:null\"\r\n role=\"group\"></desy-fieldset>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"!hasFieldset()\">\r\n <ng-container *ngTemplateOutlet=\"innerHtml\"></ng-container>\r\n </ng-container>\r\n</div>\r\n",
|
|
4600
|
+
selector: 'desy-tree',
|
|
4601
|
+
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",
|
|
3540
4602
|
providers: [
|
|
3541
4603
|
{
|
|
3542
4604
|
provide: forms.NG_VALUE_ACCESSOR,
|
|
3543
|
-
useExisting: i0.forwardRef(function () { return
|
|
4605
|
+
useExisting: i0.forwardRef(function () { return TreeComponent; }),
|
|
3544
4606
|
multi: true
|
|
3545
4607
|
}
|
|
3546
4608
|
]
|
|
3547
4609
|
},] }
|
|
3548
4610
|
];
|
|
3549
|
-
|
|
3550
|
-
{ type:
|
|
4611
|
+
TreeComponent.ctorParameters = function () { return [
|
|
4612
|
+
{ type: i0.ChangeDetectorRef }
|
|
3551
4613
|
]; };
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
items: [{ type: i0.Input }],
|
|
3555
|
-
itemsChange: [{ type: i0.Output }],
|
|
3556
|
-
namePrefix: [{ type: i0.Input }],
|
|
4614
|
+
TreeComponent.propDecorators = {
|
|
4615
|
+
idPrefix: [{ type: i0.Input }],
|
|
3557
4616
|
classes: [{ type: i0.Input }],
|
|
3558
4617
|
formGroupClasses: [{ type: i0.Input }],
|
|
3559
|
-
|
|
3560
|
-
|
|
4618
|
+
name: [{ type: i0.Input }],
|
|
4619
|
+
type: [{ type: i0.Input }],
|
|
4620
|
+
describedBy: [{ type: i0.Input }],
|
|
4621
|
+
expandedFirstLevel: [{ type: i0.Input }],
|
|
4622
|
+
decoupleChildFromParent: [{ type: i0.Input }],
|
|
4623
|
+
disableDefaultSearch: [{ type: i0.Input }],
|
|
4624
|
+
searchMatchValues: [{ type: i0.Input }],
|
|
4625
|
+
searchMatchValuesChange: [{ type: i0.Output }],
|
|
4626
|
+
allItems: [{ type: i0.ContentChildren, args: [TreeItemComponent, { descendants: true },] }],
|
|
3561
4627
|
fieldsetComponent: [{ type: i0.ContentChildren, args: [FieldsetComponent,] }],
|
|
3562
|
-
|
|
3563
|
-
dateInputItemComponents: [{ type: i0.ContentChildren, args: [DateInputItemComponent,] }],
|
|
3564
|
-
fieldsetData: [{ type: i0.Input }],
|
|
3565
|
-
legendRef: [{ type: i0.Input }],
|
|
3566
|
-
legendData: [{ type: i0.Input }],
|
|
3567
|
-
legendText: [{ type: i0.Input }],
|
|
4628
|
+
searchBarComponent: [{ type: i0.ContentChildren, args: [SearchBarComponent,] }],
|
|
3568
4629
|
innerHtml: [{ type: i0.ViewChild, args: ['innerHtml', { static: true },] }]
|
|
3569
4630
|
};
|
|
3570
4631
|
__decorate([
|
|
3571
|
-
DesyOnInputChange('
|
|
3572
|
-
],
|
|
4632
|
+
DesyOnInputChange('onSearchMatchValuesChange')
|
|
4633
|
+
], TreeComponent.prototype, "searchMatchValues", void 0);
|
|
3573
4634
|
__decorate([
|
|
3574
|
-
DesyOnInputChange('
|
|
3575
|
-
],
|
|
4635
|
+
DesyOnInputChange('configureAllItems')
|
|
4636
|
+
], TreeComponent.prototype, "allItems", void 0);
|
|
3576
4637
|
__decorate([
|
|
3577
4638
|
DesyContentChild({ onSetCallbackName: 'overrideFieldsetParams' })
|
|
3578
|
-
],
|
|
4639
|
+
], TreeComponent.prototype, "fieldsetComponent", void 0);
|
|
3579
4640
|
__decorate([
|
|
3580
|
-
DesyContentChild()
|
|
3581
|
-
],
|
|
3582
|
-
|
|
3583
|
-
var SearchBarComponent = /** @class */ (function (_super) {
|
|
3584
|
-
__extends(SearchBarComponent, _super);
|
|
3585
|
-
function SearchBarComponent() {
|
|
3586
|
-
var _this = _super.apply(this, __spread(arguments)) || this;
|
|
3587
|
-
_this.clickEvent = new i0.EventEmitter();
|
|
3588
|
-
_this.value = '';
|
|
3589
|
-
return _this;
|
|
3590
|
-
}
|
|
3591
|
-
SearchBarComponent.prototype.ngOnChanges = function (changes) {
|
|
3592
|
-
this.checkRequiredParams();
|
|
3593
|
-
};
|
|
3594
|
-
SearchBarComponent.prototype.checkRequiredParams = function () {
|
|
3595
|
-
if (!this.id) {
|
|
3596
|
-
throw Error('id is required');
|
|
3597
|
-
}
|
|
3598
|
-
if (!this.hasLabel()) {
|
|
3599
|
-
throw Error('label is required');
|
|
3600
|
-
}
|
|
3601
|
-
};
|
|
3602
|
-
SearchBarComponent.prototype.ngAfterViewInit = function () {
|
|
3603
|
-
if (this.button && this.button.length > 1) {
|
|
3604
|
-
throw Error('only 1 button in content is allowed');
|
|
3605
|
-
}
|
|
3606
|
-
};
|
|
3607
|
-
SearchBarComponent.prototype.onClick = function (event) {
|
|
3608
|
-
if (!this.disabled) {
|
|
3609
|
-
this.clickEvent.emit(event);
|
|
3610
|
-
}
|
|
3611
|
-
};
|
|
3612
|
-
SearchBarComponent.prototype.hasButton = function () {
|
|
3613
|
-
return this.button && this.button.length > 0;
|
|
3614
|
-
};
|
|
3615
|
-
return SearchBarComponent;
|
|
3616
|
-
}(FormFieldComponent));
|
|
3617
|
-
SearchBarComponent.decorators = [
|
|
3618
|
-
{ type: i0.Component, args: [{
|
|
3619
|
-
selector: 'desy-search-bar',
|
|
3620
|
-
template: "<!-- searchbar -->\r\n<div class=\"relative\" [ngClass]=\"{'flex flex-wrap items-end': hasButton()}\">\r\n <ng-container *ngTemplateOutlet=\"labelRef\"></ng-container>\r\n <desy-label *ngIf=\"!labelRef && labelData\"\r\n [text]=\"labelData.text\"\r\n [html]=\"labelData.html\"\r\n classes=\"sr-only\"\r\n [isPageHeading]=\"labelData.isPageHeading\"\r\n [for]=\"id\"\r\n [role]=\"labelData.role\"\r\n [ariaLabel]=\"labelData.ariaLabel\"\r\n [ariaDescribedBy]=\"labelData.ariaDescribedBy\"\r\n [ariaLabelledBy]=\"labelData.ariaLabelledBy\"\r\n [ariaHidden]=\"labelData.ariaHidden\"\r\n [ariaDisabled]=\"labelData.ariaDisabled\"\r\n [ariaControls]=\"labelData.ariaControls\"\r\n [ariaCurrent]=\"labelData.ariaCurrent\"\r\n [ariaLive]=\"labelData.ariaLive\"\r\n [ariaExpanded]=\"labelData.ariaExpanded\"\r\n [ariaErrorMessage]=\"labelData.ariaErrorMessage\"\r\n [ariaHasPopup]=\"labelData.ariaHasPopup\"\r\n [tabindex]=\"labelData.tabindex\"></desy-label>\r\n <desy-label *ngIf=\"!labelRef && !labelData && labelText\" [text]=\"labelText\" classes=\"sr-only\" [for]=\"id\"></desy-label>\r\n <input type=\"search\"\r\n [class]=\"['c-input block mt-sm pr-12 border-black rounded font-semibold placeholder-neutral-dark focus:border-black focus:shadow-outline-focus-input focus:ring-4 focus:ring-warning-base disabled:bg-neutral-light disabled:border-neutral-base', classes] | makeHtmlList\"\r\n [ngClass]=\"{'border-alert-base ring-2 ring-alert-base': hasErrorsMessage(),'w-full': !hasButton()}\"\r\n [value]=\"value\" (input)=\"onInput($event.target.value)\"\r\n [attr.id]=\"id ? id : null\"\r\n [attr.name]=\"id ? id : null\"\r\n [attr.aria-describedby]=\"[describedBy, getErrorId()] | makeHtmlList:null\"\r\n [attr.aria-errormessage]=\"hasErrorsMessage() ? getErrorId() : null\"\r\n [attr.aria-invalid]=\"hasErrorsMessage() ? true : null\"\r\n [attr.disabled]=\"disabled ? true : null\"\r\n [attr.placeholder]=\"placeholder ? placeholder : null\"\r\n [attr.role]=\"role ? role : null\"\r\n [attr.aria-label]=\"ariaLabel ? ariaLabel : 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-haspopup]=\"ariaHasPopup ? ariaHasPopup : null\"\r\n [attr.tabindex]=\"tabindex ? tabindex : null\">\r\n <ng-container *ngIf=\"hasButton(); else defaultButton\">\r\n <ng-content select=\"desy-button\"></ng-content>\r\n </ng-container>\r\n <ng-template #defaultButton>\r\n <button type=\"submit\" [attr.disabled]=\"disabled ? 'disabled' : null\" [attr.aria-disabled]=\"disabled ? 'true' : null\"\r\n (click)=\"onClick($event)\"\r\n [class]=\"['absolute top-0 right-0 m-sm p-0.5 text-primary-base hover:text-primary-dark focus:bg-warning-base focus:outline-none focus:shadow-outline-focus', buttonClasses] | makeHtmlList\">\r\n <span class=\"sr-only\">Buscar</span>\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" width=\"1.375em\" height=\"1.375em\" aria-hidden=\"true\"><path d=\"M23.498 23.487a1.713 1.713 0 000-2.421l-4.572-4.575a.43.43 0 01-.062-.539 10.283 10.283 0 10-2.911 2.911.43.43 0 01.539.055l4.574 4.574a1.712 1.712 0 002.433-.005zM3.451 10.289a6.85 6.85 0 116.85 6.85 6.85 6.85 0 01-6.85-6.85z\" fill=\"currentColor\"/></svg>\r\n </button>\r\n </ng-template>\r\n <ng-container *ngTemplateOutlet=\"errorMessageRef\"></ng-container>\r\n <desy-error-message *ngIf=\"!errorMessageRef && errorMessageData\"\r\n [id]=\"getErrorId()\"\r\n [text]=\"errorMessageData.text\"\r\n [html]=\"errorMessageData.html\"\r\n [classes]=\"errorMessageData.classes\"\r\n [visuallyHiddenText]=\"errorMessageData.visuallyHiddenText\"\r\n [role]=\"errorMessageData.role\"\r\n [ariaLabel]=\"errorMessageData.ariaLabel\"\r\n [ariaDescribedBy]=\"errorMessageData.ariaDescribedBy\"\r\n [ariaLabelledBy]=\"errorMessageData.ariaLabelledBy\"\r\n [ariaHidden]=\"errorMessageData.ariaHidden\"\r\n [ariaDisabled]=\"errorMessageData.ariaDisabled\"\r\n [ariaControls]=\"errorMessageData.ariaControls\"\r\n [ariaCurrent]=\"errorMessageData.ariaCurrent\"\r\n [ariaLive]=\"errorMessageData.ariaLive\"\r\n [ariaExpanded]=\"errorMessageData.ariaExpanded\"\r\n [ariaErrorMessage]=\"errorMessageData.ariaErrorMessage\"\r\n [ariaHasPopup]=\"errorMessageData.ariaHasPopup\"\r\n [tabindex]=\"errorMessageData.tabindex\"></desy-error-message>\r\n <desy-error-message *ngIf=\"!errorMessageRef && !errorMessageData && errorMessageText\"\r\n [text]=\"errorMessageText\" [id]=\"getErrorId()\"></desy-error-message>\r\n</div>\r\n<!-- /searchbar -->\r\n",
|
|
3621
|
-
providers: [
|
|
3622
|
-
{
|
|
3623
|
-
provide: forms.NG_VALUE_ACCESSOR,
|
|
3624
|
-
useExisting: i0.forwardRef(function () { return SearchBarComponent; }),
|
|
3625
|
-
multi: true
|
|
3626
|
-
}
|
|
3627
|
-
]
|
|
3628
|
-
},] }
|
|
3629
|
-
];
|
|
3630
|
-
SearchBarComponent.propDecorators = {
|
|
3631
|
-
button: [{ type: i0.ContentChildren, args: [ButtonComponent,] }],
|
|
3632
|
-
describedBy: [{ type: i0.Input }],
|
|
3633
|
-
classes: [{ type: i0.Input }],
|
|
3634
|
-
buttonClasses: [{ type: i0.Input }],
|
|
3635
|
-
placeholder: [{ type: i0.Input }],
|
|
3636
|
-
clickEvent: [{ type: i0.Output }]
|
|
3637
|
-
};
|
|
4641
|
+
DesyContentChild({ onSetCallbackName: 'overrideSearchBarParams' })
|
|
4642
|
+
], TreeComponent.prototype, "searchBarComponent", void 0);
|
|
3638
4643
|
|
|
3639
4644
|
var ConditionDirective = /** @class */ (function () {
|
|
3640
4645
|
function ConditionDirective(templateRef) {
|
|
@@ -3682,6 +4687,31 @@
|
|
|
3682
4687
|
items: [{ type: i0.Input }]
|
|
3683
4688
|
};
|
|
3684
4689
|
|
|
4690
|
+
var TreeItemsGeneratorComponent = /** @class */ (function () {
|
|
4691
|
+
function TreeItemsGeneratorComponent(viewContainerRef) {
|
|
4692
|
+
this.viewContainerRef = viewContainerRef;
|
|
4693
|
+
}
|
|
4694
|
+
TreeItemsGeneratorComponent.prototype.ngOnInit = function () {
|
|
4695
|
+
this.viewContainerRef.createEmbeddedView(this.content);
|
|
4696
|
+
};
|
|
4697
|
+
return TreeItemsGeneratorComponent;
|
|
4698
|
+
}());
|
|
4699
|
+
TreeItemsGeneratorComponent.decorators = [
|
|
4700
|
+
{ type: i0.Component, args: [{
|
|
4701
|
+
selector: 'desy-tree-items-generator',
|
|
4702
|
+
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",
|
|
4703
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
4704
|
+
},] }
|
|
4705
|
+
];
|
|
4706
|
+
TreeItemsGeneratorComponent.ctorParameters = function () { return [
|
|
4707
|
+
{ type: i0.ViewContainerRef }
|
|
4708
|
+
]; };
|
|
4709
|
+
TreeItemsGeneratorComponent.propDecorators = {
|
|
4710
|
+
content: [{ type: i0.ViewChild, args: ['content', { static: true },] }],
|
|
4711
|
+
items: [{ type: i0.Input }],
|
|
4712
|
+
itemTemplate: [{ type: i0.Input }]
|
|
4713
|
+
};
|
|
4714
|
+
|
|
3685
4715
|
var ModalButtonPrimaryComponent = /** @class */ (function (_super) {
|
|
3686
4716
|
__extends(ModalButtonPrimaryComponent, _super);
|
|
3687
4717
|
function ModalButtonPrimaryComponent() {
|
|
@@ -4250,6 +5280,8 @@
|
|
|
4250
5280
|
if (this.isOpen()) {
|
|
4251
5281
|
this.dialogService.closeDialog(this.dialog);
|
|
4252
5282
|
this.dialog = null;
|
|
5283
|
+
var elementToFocus = document.getElementById('header-offcanvas-button');
|
|
5284
|
+
elementToFocus === null || elementToFocus === void 0 ? void 0 : elementToFocus.focus();
|
|
4253
5285
|
}
|
|
4254
5286
|
};
|
|
4255
5287
|
HeaderOffcanvasComponent.prototype.isOpen = function () {
|
|
@@ -4275,14 +5307,15 @@
|
|
|
4275
5307
|
}());
|
|
4276
5308
|
HeaderOffcanvasComponent.dialogOptions = {
|
|
4277
5309
|
id: 'header-offcanvas-dialog',
|
|
4278
|
-
focusOnClose: 'header-offcanvas',
|
|
5310
|
+
focusOnClose: 'header-offcanvas-button',
|
|
4279
5311
|
ariaModal: 'true',
|
|
4280
|
-
ariaLabelledBy: 'header-offcanvas-button-text'
|
|
5312
|
+
ariaLabelledBy: 'header-offcanvas-button-text',
|
|
5313
|
+
role: 'dialog'
|
|
4281
5314
|
};
|
|
4282
5315
|
HeaderOffcanvasComponent.decorators = [
|
|
4283
5316
|
{ type: i0.Component, args: [{
|
|
4284
5317
|
selector: 'desy-header-offcanvas',
|
|
4285
|
-
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"
|
|
5318
|
+
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"
|
|
4286
5319
|
},] }
|
|
4287
5320
|
];
|
|
4288
5321
|
HeaderOffcanvasComponent.ctorParameters = function () { return [
|
|
@@ -4464,12 +5497,48 @@
|
|
|
4464
5497
|
NavComponent.prototype.getIdPrefix = function () {
|
|
4465
5498
|
return this.idPrefix ? this.idPrefix : 'nav-item';
|
|
4466
5499
|
};
|
|
5500
|
+
NavComponent.prototype.movePrevious = function (event, currentIndex) {
|
|
5501
|
+
event.preventDefault();
|
|
5502
|
+
var items = this.getItemList();
|
|
5503
|
+
var nextIndex = currentIndex - 1;
|
|
5504
|
+
while (nextIndex >= 0 && !this.isFocusableItem(items[nextIndex])) {
|
|
5505
|
+
nextIndex--;
|
|
5506
|
+
}
|
|
5507
|
+
if (nextIndex < items.length) {
|
|
5508
|
+
var itemElem = document.getElementById(this.getItemId(items[nextIndex], nextIndex));
|
|
5509
|
+
if (itemElem) {
|
|
5510
|
+
itemElem.focus();
|
|
5511
|
+
}
|
|
5512
|
+
}
|
|
5513
|
+
};
|
|
5514
|
+
NavComponent.prototype.moveNext = function (event, currentIndex) {
|
|
5515
|
+
event.preventDefault();
|
|
5516
|
+
var items = this.getItemList();
|
|
5517
|
+
var nextIndex = currentIndex + 1;
|
|
5518
|
+
while (nextIndex < items.length && !this.isFocusableItem(items[nextIndex])) {
|
|
5519
|
+
nextIndex++;
|
|
5520
|
+
}
|
|
5521
|
+
if (nextIndex < items.length) {
|
|
5522
|
+
var itemElem = document.getElementById(this.getItemId(items[nextIndex], nextIndex));
|
|
5523
|
+
if (itemElem) {
|
|
5524
|
+
itemElem.focus();
|
|
5525
|
+
}
|
|
5526
|
+
}
|
|
5527
|
+
};
|
|
5528
|
+
NavComponent.prototype.simulateClick = function (event, item, index) {
|
|
5529
|
+
event.preventDefault();
|
|
5530
|
+
var element = document.getElementById(this.getItemId(item, index));
|
|
5531
|
+
element === null || element === void 0 ? void 0 : element.click();
|
|
5532
|
+
};
|
|
5533
|
+
NavComponent.prototype.isFocusableItem = function (item) {
|
|
5534
|
+
return !item.active && !item.disabled;
|
|
5535
|
+
};
|
|
4467
5536
|
return NavComponent;
|
|
4468
5537
|
}(AccessibilityComponent));
|
|
4469
5538
|
NavComponent.decorators = [
|
|
4470
5539
|
{ type: i0.Component, args: [{
|
|
4471
5540
|
selector: 'desy-nav',
|
|
4472
|
-
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"
|
|
5541
|
+
template: "<ng-template #innerHtml>\r\n <ng-container *ngFor=\"let item of getItemList(); index as i\">\r\n <li>\r\n <span *ngIf=\"item.active\"\r\n [class]=\"['flex items-center px-base py-sm font-semibold', item.classes] | makeHtmlList\"\r\n [attr.id]=\"getItemId(item, i)\"\r\n [attr.title]=\"item.title ? item.title : null\"\r\n [attr.role]=\"item.role ? item.role : null\"\r\n [attr.aria-label]=\"item.ariaLabel ? item.ariaLabel : null\"\r\n [attr.aria-describedby]=\"item.ariaDescribedBy ? item.ariaDescribedBy : null\"\r\n [attr.aria-labelledby]=\"item.ariaLabelledBy ? item.ariaLabelledBy : null\"\r\n [attr.aria-hidden]=\"item.ariaHidden ? item.ariaHidden : null\"\r\n [attr.aria-disabled]=\"item.disabled ? item.disabled : null\"\r\n [attr.aria-controls]=\"item.ariaControls ? item.ariaControls : null\"\r\n [attr.aria-current]=\"hasNav ? 'true' : 'page'\"\r\n [attr.aria-live]=\"item.ariaLive ? item.ariaLive : null\"\r\n [attr.aria-expanded]=\"item.ariaExpanded ? item.ariaExpanded : null\"\r\n [attr.aria-errormessage]=\"item.ariaErrorMessage ? item.ariaErrorMessage : null\"\r\n [attr.aria-haspopup]=\"item.ariaHasPopup ? item.ariaHasPopup : null\"\r\n [attr.tabindex]=\"item.tabindex\"\r\n (click)=\"onClick($event, item)\">\r\n <strong>\r\n <ng-container *desyCustomInnerContent=\"{ component: item, html: item.html, text: item.text }\"></ng-container>\r\n </strong>\r\n </span>\r\n <a *ngIf=\"!item.active && item.href\"\r\n [href]=\"item.href | externalHref\" [target]=\"item.target\"\r\n [class]=\"['flex items-center px-base py-sm hover:bg-primary-base hover:text-white focus:bg-warning-base focus:outline-none focus:shadow-outline-focus focus:text-black', item.classes] | makeHtmlList\"\r\n [ngClass]=\"{'pointer-events-none': item.disabled}\"\r\n [attr.aria-disabled]=\"item.disabled ? 'true' : null\"\r\n [attr.tabindex]=\"item.disabled ? -1 : item.tabindex\"\r\n [attr.id]=\"getItemId(item, i)\"\r\n [attr.title]=\"item.title ? item.title : null\"\r\n [attr.role]=\"item.role ? item.role : null\"\r\n [attr.aria-label]=\"item.ariaLabel ? item.ariaLabel : null\"\r\n [attr.aria-describedby]=\"item.ariaDescribedBy ? item.ariaDescribedBy : null\"\r\n [attr.aria-labelledby]=\"item.ariaLabelledBy ? item.ariaLabelledBy : null\"\r\n [attr.aria-hidden]=\"item.ariaHidden ? item.ariaHidden : null\"\r\n [attr.aria-controls]=\"item.ariaControls ? item.ariaControls : null\"\r\n [attr.aria-current]=\"item.ariaCurrent ? item.ariaCurrent : null\"\r\n [attr.aria-live]=\"item.ariaLive ? item.ariaLive : null\"\r\n [attr.aria-expanded]=\"item.ariaExpanded ? item.ariaExpanded : null\"\r\n [attr.aria-errormessage]=\"item.ariaErrorMessage ? item.ariaErrorMessage : null\"\r\n [attr.aria-haspopup]=\"item.ariaHasPopup ? item.ariaHasPopup : null\"\r\n (desyContentEmpty)=\"handleContentEmpty(i)\"\r\n (keydown.arrowUp)=\"movePrevious($event, i)\"\r\n (keydown.arrowDown)=\"moveNext($event, i)\"\r\n (click)=\"onClick($event, item)\"\r\n (keydown.space)=\"simulateClick($event, item, i)\"\r\n (keydown.enter)=\"simulateClick($event, item, i)\">\r\n <ng-container *desyCustomInnerContent=\"{ component: item, html: item.html, text: item.text }\"></ng-container>\r\n <svg #desyContentEmptyIgnore *ngIf=\"item.disabled\" viewBox=\"0 0 140 140\" height=\"1em\" width=\"1em\" xmlns=\"http://www.w3.org/2000/svg\" class=\"inline-block align-middle ml-sm text-neutral-base fill-current\" aria-hidden=\"true\" focusable=\"false\" ><path d=\"M70 0a70 70 0 1070 70A70.08 70.08 0 0070 0zM20 70a50 50 0 0174.8-43.4 2.51 2.51 0 011.23 1.84 2.48 2.48 0 01-.71 2.1L30.54 95.32a2.51 2.51 0 01-3.94-.52A49.63 49.63 0 0120 70zm100 0a50 50 0 01-74.8 43.4 2.51 2.51 0 01-1.23-1.84 2.48 2.48 0 01.71-2.1l64.78-64.78a2.51 2.51 0 013.94.52A49.63 49.63 0 01120 70z\"/></svg>\r\n </a>\r\n <a *ngIf=\"!item.active && !item.href\"\r\n [routerLink]=\"item.routerLink\" [fragment]=\"item.fragment\"\r\n [class]=\"['flex items-center px-base py-sm hover:bg-primary-base hover:text-white focus:bg-warning-base focus:outline-none focus:shadow-outline-focus focus:text-black', item.classes] | makeHtmlList\"\r\n [ngClass]=\"{'pointer-events-none': item.disabled}\"\r\n [attr.aria-disabled]=\"item.disabled ? 'true' : null\"\r\n [attr.tabindex]=\"item.disabled ? -1 : item.tabindex\"\r\n [attr.id]=\"getItemId(item, i)\"\r\n [attr.title]=\"item.title ? item.title : null\"\r\n [attr.role]=\"item.role ? item.role : null\"\r\n [attr.aria-label]=\"item.ariaLabel ? item.ariaLabel : null\"\r\n [attr.aria-describedby]=\"item.ariaDescribedBy ? item.ariaDescribedBy : null\"\r\n [attr.aria-labelledby]=\"item.ariaLabelledBy ? item.ariaLabelledBy : null\"\r\n [attr.aria-hidden]=\"item.ariaHidden ? item.ariaHidden : null\"\r\n [attr.aria-controls]=\"item.ariaControls ? item.ariaControls : null\"\r\n [attr.aria-current]=\"item.ariaCurrent ? item.ariaCurrent : null\"\r\n [attr.aria-live]=\"item.ariaLive ? item.ariaLive : null\"\r\n [attr.aria-expanded]=\"item.ariaExpanded ? item.ariaExpanded : null\"\r\n [attr.aria-errormessage]=\"item.ariaErrorMessage ? item.ariaErrorMessage : null\"\r\n [attr.aria-haspopup]=\"item.ariaHasPopup ? item.ariaHasPopup : null\"\r\n (keydown.arrowUp)=\"movePrevious($event, i)\"\r\n (keydown.arrowDown)=\"moveNext($event, i)\"\r\n (click)=\"onClick($event, item)\"\r\n (keydown.space)=\"simulateClick($event, item, i)\"\r\n (keydown.enter)=\"simulateClick($event, item, i)\"\r\n (desyContentEmpty)=\"handleContentEmpty(i)\">\r\n <ng-container *desyCustomInnerContent=\"{ component: item, html: item.html, text: item.text }\"></ng-container>\r\n <svg #desyContentEmptyIgnore *ngIf=\"item.disabled\" viewBox=\"0 0 140 140\" height=\"1em\" width=\"1em\" xmlns=\"http://www.w3.org/2000/svg\" class=\"inline-block align-middle ml-sm text-neutral-base fill-current\" aria-hidden=\"true\" focusable=\"false\" ><path d=\"M70 0a70 70 0 1070 70A70.08 70.08 0 0070 0zM20 70a50 50 0 0174.8-43.4 2.51 2.51 0 011.23 1.84 2.48 2.48 0 01-.71 2.1L30.54 95.32a2.51 2.51 0 01-3.94-.52A49.63 49.63 0 0120 70zm100 0a50 50 0 01-74.8 43.4 2.51 2.51 0 01-1.23-1.84 2.48 2.48 0 01.71-2.1l64.78-64.78a2.51 2.51 0 013.94.52A49.63 49.63 0 01120 70z\"/></svg>\r\n </a>\r\n </li>\r\n <li *ngIf=\"item.divider\" class=\"my-sm border-b border-neutral-base\" aria-hidden=\"true\">\r\n <div class=\"sr-only\">Separador</div>\r\n </li>\r\n </ng-container>\r\n</ng-template>\r\n\r\n\r\n<ul *ngIf=\"!hasNav; else wrapIntoNav\"\r\n [class]=\"['text-sm', classes] | makeHtmlList\"\r\n [attr.aria-label]=\"ariaLabel ? ariaLabel : null\"\r\n [attr.aria-describedby]=\"ariaDescribedBy ? ariaDescribedBy : null\"\r\n [attr.aria-labelledby]=\"ariaLabelledBy ? ariaLabelledBy : null\"\r\n [attr.aria-hidden]=\"ariaHidden ? ariaHidden : null\"\r\n [attr.aria-disabled]=\"ariaDisabled ? ariaDisabled : null\"\r\n [attr.aria-controls]=\"ariaControls ? ariaControls : null\"\r\n [attr.aria-current]=\"ariaCurrent ? ariaCurrent : null\"\r\n [attr.aria-live]=\"ariaLive ? ariaLive : null\"\r\n [attr.aria-expanded]=\"ariaExpanded ? ariaExpanded : null\"\r\n [attr.aria-errormessage]=\"ariaErrorMessage ? ariaErrorMessage : null\"\r\n [attr.aria-haspopup]=\"ariaHasPopup ? ariaHasPopup : null\"\r\n [attr.tabindex]=\"tabindex ? tabindex : null\">\r\n <ng-container *ngTemplateOutlet=\"innerHtml\"></ng-container>\r\n</ul>\r\n<ng-template #wrapIntoNav>\r\n <nav [class]=\"['text-sm', classes] | makeHtmlList\"\r\n [attr.role]=\"role ? role : null\"\r\n [attr.aria-label]=\"ariaLabel ? ariaLabel : null\"\r\n [attr.aria-describedby]=\"ariaDescribedBy ? ariaDescribedBy : null\"\r\n [attr.aria-labelledby]=\"ariaLabelledBy ? ariaLabelledBy : null\"\r\n [attr.aria-hidden]=\"ariaHidden ? ariaHidden : null\"\r\n [attr.aria-disabled]=\"ariaDisabled ? ariaDisabled : null\"\r\n [attr.aria-controls]=\"ariaControls ? ariaControls : null\"\r\n [attr.aria-current]=\"ariaCurrent ? ariaCurrent : null\"\r\n [attr.aria-live]=\"ariaLive ? ariaLive : null\"\r\n [attr.aria-expanded]=\"ariaExpanded ? ariaExpanded : null\"\r\n [attr.aria-errormessage]=\"ariaErrorMessage ? ariaErrorMessage : null\"\r\n [attr.aria-haspopup]=\"ariaHasPopup ? ariaHasPopup : null\"\r\n [attr.tabindex]=\"tabindex ? tabindex : null\">\r\n <ul>\r\n <ng-container *ngTemplateOutlet=\"innerHtml\"></ng-container>\r\n </ul>\r\n </nav>\r\n</ng-template>\r\n"
|
|
4473
5542
|
},] }
|
|
4474
5543
|
];
|
|
4475
5544
|
NavComponent.propDecorators = {
|
|
@@ -4504,7 +5573,7 @@
|
|
|
4504
5573
|
HeaderSubnavComponent.decorators = [
|
|
4505
5574
|
{ type: i0.Component, args: [{
|
|
4506
5575
|
selector: 'desy-header-subnav',
|
|
4507
|
-
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 <
|
|
5576
|
+
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"
|
|
4508
5577
|
},] }
|
|
4509
5578
|
];
|
|
4510
5579
|
HeaderSubnavComponent.propDecorators = {
|
|
@@ -4538,7 +5607,7 @@
|
|
|
4538
5607
|
HeaderDropdownComponent.decorators = [
|
|
4539
5608
|
{ type: i0.Component, args: [{
|
|
4540
5609
|
selector: 'desy-header-dropdown',
|
|
4541
|
-
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-
|
|
5610
|
+
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"
|
|
4542
5611
|
},] }
|
|
4543
5612
|
];
|
|
4544
5613
|
HeaderDropdownComponent.propDecorators = {
|
|
@@ -4546,11 +5615,15 @@
|
|
|
4546
5615
|
classesContainer: [{ type: i0.Input }],
|
|
4547
5616
|
classesTooltip: [{ type: i0.Input }],
|
|
4548
5617
|
classes: [{ type: i0.Input }],
|
|
4549
|
-
nav: [{ type: i0.ContentChildren, args: [NavComponent,] }]
|
|
5618
|
+
nav: [{ type: i0.ContentChildren, args: [NavComponent,] }],
|
|
5619
|
+
contentComponent: [{ type: i0.ContentChildren, args: [ContentComponent,] }]
|
|
4550
5620
|
};
|
|
4551
5621
|
__decorate([
|
|
4552
5622
|
DesyContentChild({ onSetCallbackName: 'overrideNavParams' })
|
|
4553
|
-
], HeaderDropdownComponent.prototype, "nav", void 0);
|
|
5623
|
+
], HeaderDropdownComponent.prototype, "nav", void 0);
|
|
5624
|
+
__decorate([
|
|
5625
|
+
DesyContentChild()
|
|
5626
|
+
], HeaderDropdownComponent.prototype, "contentComponent", void 0);
|
|
4554
5627
|
|
|
4555
5628
|
var SkipLinkComponent = /** @class */ (function (_super) {
|
|
4556
5629
|
__extends(SkipLinkComponent, _super);
|
|
@@ -5049,7 +6122,7 @@
|
|
|
5049
6122
|
else {
|
|
5050
6123
|
var idPrefix = this.idPrefix ? this.idPrefix : 'nav-item';
|
|
5051
6124
|
if (i === 0) {
|
|
5052
|
-
return idPrefix;
|
|
6125
|
+
return idPrefix + '-0';
|
|
5053
6126
|
}
|
|
5054
6127
|
else {
|
|
5055
6128
|
return idPrefix + '-' + i;
|
|
@@ -5091,7 +6164,7 @@
|
|
|
5091
6164
|
MenuVerticalComponent.decorators = [
|
|
5092
6165
|
{ type: i0.Component, args: [{
|
|
5093
6166
|
selector: 'desy-menu-vertical',
|
|
5094
|
-
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\"
|
|
6167
|
+
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",
|
|
5095
6168
|
animations: [
|
|
5096
6169
|
animations.trigger('displayMenuVertical', [
|
|
5097
6170
|
animations.state('void', animations.style({
|
|
@@ -5887,7 +6960,7 @@
|
|
|
5887
6960
|
MenubarComponent.decorators = [
|
|
5888
6961
|
{ type: i0.Component, args: [{
|
|
5889
6962
|
selector: 'desy-menubar',
|
|
5890
|
-
template: "<div [attr.id]=\"id\" [class]=\"['c-menubar', classes] | makeHtmlList\"\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 <ng-container *ngIf=\"getLabelRef()\">\r\n <div [id]=\"id + '-label'\" [class]=\"['mb-sm', labelComponent ? labelComponent.classes : (labelData ? labelData.classes : null)] | makeHtmlList\">\r\n <ng-container *ngTemplateOutlet=\"getLabelRef()\"></ng-container>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngIf=\"!getLabelRef() && (labelData || labelText)\">\r\n <div [id]=\"id + '-label'\" [class]=\"['mb-sm', labelData ? labelData.classes : null] | makeHtmlList\">\r\n <ng-container *desyCustomInnerContent=\"{ html: getLabelContent() }\"></ng-container>\r\n </div>\r\n </ng-container>\r\n <ul #menubar [id]=\"id + '-menubar'\" class=\"lg:flex lg:flex-wrap\" role=\"menubar\"\r\n (focusin)=\"handleMenuFocusIn()\"\r\n (focusout)=\"handleMenuFocusOut($event)\"\r\n [ngClass]=\"{ 'focus': isFocused }\"\r\n [attr.aria-label]=\"ariaLabel ? ariaLabel : null\"\r\n [attr.aria-describedby]=\"getLabelRef() || labelData || labelText ? id + '-label' : null\">\r\n <ng-container *ngFor=\"let item of getItems(); index as itemIndex\">\r\n <li class=\"relative\" role=\"none\" desyMenubaritem (contentChanged)=\"checkChanges()\">\r\n <a *ngIf=\"item.sub\" #link\r\n role=\"menuitem\" aria-haspopup=\"true\" aria-expanded=\"false\"\r\n (click)=\"handleMenuItemClick($event, itemIndex)\"\r\n (keydown)=\"handleMenuItemKeydown($event, itemIndex)\"\r\n (mouseover)=\"handleMenuItemMouseOver(itemIndex)\"\r\n (desyAttributeChange)=\"checkChanges()\" [attributesToCheck]=\"'disabled'\"\r\n [id]=\"getItemId(item, itemIndex)\"\r\n [class]=\"['c-menubar__button', item.classes] | makeHtmlList\"\r\n [ngClass]=\"{'c-menubar__button--disabled': item.disabled, 'c-menubar__button--primary': item.active}\"\r\n [attr.disabled]=\"item.disabled ? item.disabled : null\"\r\n [attr.aria-disabled]=\"item.disabled ? item.disabled : (item.ariaDisabled ? item.ariaDisabled : 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-errormessage]=\"item.ariaErrorMessage ? item.ariaErrorMessage : null\"\r\n [attr.aria-modal]=\"item.ariaModal ? item.ariaModal : null\"\r\n [attr.tabindex]=\"item.disabled ? -1 : (itemIndex === currentFocusItemIndex ? 0 : -1)\">\r\n <span class=\"inline-flex self-center max-w-xs align-middle truncate\" #itemContentWrapper\r\n (desyContentEmpty)=\"handleEmptyItem('item content, html or text is required at position ' + itemIndex)\">\r\n <ng-container *desyCustomInnerContent=\"{ component: item, html: item.html, text: item.text}\"></ng-container>\r\n </span>\r\n <svg class=\"inline-block -mr-2 align-middle -my-px\" viewBox=\"0 0 96 96\" aria-hidden=\"true\" fill=\"currentColor\" focusable=\"false\" width=\"1.5em\" height=\"1.5em\"><g><path d=\"M46.71 58.037a1.823 1.823 0 002.581 0L62.048 45.28a1.823 1.823 0 00-1.29-3.113H35.243a1.823 1.823 0 00-1.291 3.113z\"/></g></svg>\r\n </a>\r\n <a *ngIf=\"item.routerLink && !item.sub\" #link #itemContentWrapper\r\n role=\"menuitem\"\r\n (click)=\"handleMenuItemClick($event, itemIndex)\"\r\n (keydown)=\"handleMenuItemKeydown($event, itemIndex)\"\r\n (mouseover)=\"handleMenuItemMouseOver(itemIndex)\"\r\n (desyContentEmpty)=\"handleEmptyItem('item content, html or text is required at position ' + itemIndex)\"\r\n (desyAttributeChange)=\"checkChanges()\" [attributesToCheck]=\"'disabled'\"\r\n [id]=\"getItemId(item, itemIndex)\"\r\n [routerLink]=\"item.routerLink\"\r\n [routerLinkActive]=\"item.routerLinkActiveClasses ? item.routerLinkActiveClasses : ''\"\r\n [fragment]=\"item.fragment\"\r\n [class]=\"['c-menubar__button', item.classes] | makeHtmlList\"\r\n [ngClass]=\"{'c-menubar__button--disabled': item.disabled, 'c-menubar__button--primary': item.active}\"\r\n [attr.title]=\"item.title ? item.title : null\"\r\n [attr.disabled]=\"item.disabled ? item.disabled : null\"\r\n [attr.aria-disabled]=\"item.disabled ? item.disabled : (item.ariaDisabled ? item.ariaDisabled : null)\"\r\n [attr.tabindex]=\"item.disabled ? -1 : (itemIndex === currentFocusItemIndex ? 0 : -1)\"\r\n [attr.target]=\"item.target ? item.target : 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 [attr.aria-modal]=\"item.ariaModal ? item.ariaModal : null\">\r\n <ng-container *desyCustomInnerContent=\"{ component: item, html: item.html, text: item.text}\"></ng-container>\r\n </a>\r\n <a *ngIf=\"!item.routerLink && item.href && !item.sub\" #link #itemContentWrapper\r\n role=\"menuitem\"\r\n (click)=\"handleMenuItemClick($event, itemIndex)\"\r\n (keydown)=\"handleMenuItemKeydown($event, itemIndex)\"\r\n (mouseover)=\"handleMenuItemMouseOver(itemIndex)\"\r\n (desyContentEmpty)=\"handleEmptyItem('item content, html or text is required at position ' + itemIndex)\"\r\n (desyAttributeChange)=\"checkChanges()\" [attributesToCheck]=\"'disabled'\"\r\n [id]=\"getItemId(item, itemIndex)\"\r\n [href]=\"item.href | externalHref\"\r\n [class]=\"['c-menubar__button', item.classes] | makeHtmlList\"\r\n [ngClass]=\"{'c-menubar__button--disabled': item.disabled, 'c-menubar__button--primary': item.active}\"\r\n [attr.title]=\"item.title ? item.title : null\"\r\n [attr.disabled]=\"item.disabled ? item.disabled : null\"\r\n [attr.aria-disabled]=\"item.disabled ? item.disabled : (item.ariaDisabled ? item.ariaDisabled : null)\"\r\n [attr.tabindex]=\"item.disabled ? -1 : (itemIndex === currentFocusItemIndex ? 0 : -1)\"\r\n [attr.target]=\"item.target ? item.target : 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 [attr.aria-modal]=\"item.ariaModal ? item.ariaModal : null\">\r\n <ng-container *desyCustomInnerContent=\"{ component: item, html: item.html, text: item.text}\"></ng-container>\r\n </a>\r\n\r\n <ul *ngIf=\"item.sub && getItemSubitems(item)\" #popupMenu role=\"menu\" tabindex=\"-1\"\r\n [ngStyle]=\"getPopupStyle(itemIndex)\"\r\n [class]=\"['c-menubar__tooltip w-max max-w-64 hidden border border-neutral-base shadow-md bg-white text-sm', item.sub.classes] | makeHtmlList\"\r\n [attr.aria-label]=\"item.ariaLabel ? item.ariaLabel : (item.sub.ariaLabel ? item.sub.ariaLabel : null)\"\r\n [attr.aria-describedby]=\"item.sub.ariaDescribedBy ? item.sub.ariaDescribedBy : null\"\r\n [attr.aria-labelledby]=\"item.sub.ariaLabelledBy ? item.sub.ariaLabelledBy : null\"\r\n [attr.aria-hidden]=\"item.sub.ariaHidden ? item.sub.ariaHidden : null\"\r\n [attr.aria-disabled]=\"item.sub.ariaDisabled ? item.sub.ariaDisabled : null\"\r\n [attr.aria-controls]=\"item.sub.ariaControls ? item.sub.ariaControls : null\"\r\n [attr.aria-current]=\"item.sub.ariaCurrent ? item.sub.ariaCurrent : null\"\r\n [attr.aria-live]=\"item.sub.ariaLive ? item.sub.ariaLive : null\"\r\n [attr.aria-expanded]=\"!!(menuData && menuData[itemIndex].open)\"\r\n [attr.aria-errormessage]=\"item.sub.ariaErrorMessage ? item.sub.ariaErrorMessage : null\"\r\n [attr.aria-haspopup]=\"item.sub.ariaHasPopup ? item.sub.ariaHasPopup : null\"\r\n [attr.aria-modal]=\"item.sub.ariaModal ? item.sub.ariaModal : null\">\r\n <ng-container *ngFor=\"let subItem of getItemSubitems(item); index as subItemIndex\">\r\n <ng-container [ngSwitch]=\"subItem.role\">\r\n <li #popupMenuItem *ngSwitchCase=\"'none'\" role=\"none\" tabindex=\"-1\"\r\n [id]=\"getSubItemId(subItem, subItemIndex, getItemId(item, itemIndex))\"\r\n (desyContentEmpty)=\"handleEmptyItem('subitem content, html or text is required at position ' + subItemIndex + ' of item ' + itemIndex)\"\r\n (click)=\"handlePopupMenuItemClick(itemIndex, subItemIndex)\"\r\n (mouseover)=\"handlePopupMenuItemMouseOver(itemIndex, subItemIndex)\"\r\n (keydown)=\"handlePopupMenuItemKeydown($event, itemIndex, subItemIndex)\">\r\n <ng-container *desyCustomInnerContent=\"{ component: subItem, html: subItem.html, text: subItem.text}\"></ng-container>\r\n </li>\r\n <li *ngSwitchCase=\"'group'\" role=\"none\">\r\n <ul role=\"group\" [id]=\"getSubItemId(subItem, subItemIndex, getItemId(item, itemIndex))\"\r\n [attr.aria-label]=\"subItem.ariaLabel ? subItem.ariaLabel : null\">\r\n <ng-container *ngFor=\"let subsubitem of getSubItemSubitems(subItem); index as subsubIndex\">\r\n <ng-container *ngIf=\"subsubitem\">\r\n <li #popupMenuItem [attr.role]=\"subsubitem.role ? subsubitem.role : null\" tabindex=\"-1\"\r\n [id]=\"getSubItemId(subsubitem, subsubIndex, getSubItemId(subItem, subItemIndex, getItemId(item, itemIndex)))\"\r\n (desyContentEmpty)=\"handleEmptyItem('subsubitem content, html or text is required at position ' + subsubIndex + ' of subItem ' + subItemIndex + ' of item ' + itemIndex)\"\r\n (click)=\"handlePopupMenuItemClick(itemIndex, subItemIndex, subsubIndex)\"\r\n (mouseover)=\"handlePopupMenuItemMouseOver(itemIndex, subItemIndex, subsubIndex)\"\r\n (keydown)=\"handlePopupMenuItemKeydown($event, itemIndex, subItemIndex, subsubIndex)\"\r\n [attr.aria-checked]=\"getSubSubItemAriaChecked(subsubitem)\"\r\n class=\"flex items-center pr-base pl-lg py-sm cursor-pointer hover:bg-primary-base hover:text-white\">\r\n <ng-container *desyCustomInnerContent=\"{ component: subsubitem, html: subsubitem.html, text: subsubitem.text}\"></ng-container>\r\n </li>\r\n </ng-container>\r\n </ng-container>\r\n </ul>\r\n </li>\r\n <li #popupMenuItem *ngSwitchCase=\"'menuitem'\" role=\"menuitem\" tabindex=\"-1\"\r\n (desyContentEmpty)=\"handleEmptyItem('subitem content, html or text is required at position ' + subItemIndex + ' of item ' + itemIndex)\"\r\n (click)=\"handlePopupMenuItemClick(itemIndex, subItemIndex)\"\r\n (mouseover)=\"handlePopupMenuItemMouseOver(itemIndex, subItemIndex)\"\r\n (keydown)=\"handlePopupMenuItemKeydown($event, itemIndex, subItemIndex)\"\r\n [id]=\"getSubItemId(subItem, subItemIndex, getItemId(item, itemIndex))\"\r\n class=\"flex items-center pr-base pl-lg py-sm cursor-pointer hover:bg-primary-base hover:text-white focus:bg-primary-base focus:text-white focus:outline-none\">\r\n <ng-container *desyCustomInnerContent=\"{ component: subItem, html: subItem.html, text: subItem.text}\"></ng-container>\r\n </li>\r\n <li #popupMenuItem *ngSwitchCase=\"'menuitemcheckbox'\" role=\"menuitemcheckbox\" tabindex=\"-1\"\r\n (desyContentEmpty)=\"handleEmptyItem('subitem content, html or text is required at position ' + subItemIndex + ' of item ' + itemIndex)\"\r\n (click)=\"handlePopupMenuItemClick(itemIndex, subItemIndex)\"\r\n (mouseover)=\"handlePopupMenuItemMouseOver(itemIndex, subItemIndex)\"\r\n (keydown)=\"handlePopupMenuItemKeydown($event, itemIndex, subItemIndex)\"\r\n [id]=\"getSubItemId(subItem, subItemIndex, getItemId(item, itemIndex))\"\r\n [attr.aria-checked]=\"!!subItem.checked\"\r\n class=\"flex items-center pr-base pl-lg py-sm cursor-pointer hover:bg-primary-base hover:text-white\">\r\n <ng-container *desyCustomInnerContent=\"{ component: subItem, html: subItem.html, text: subItem.text}\"></ng-container>\r\n </li>\r\n <li #popupMenuItem *ngSwitchCase=\"'separator'\" role=\"separator\"\r\n [id]=\"getSubItemId(subItem, subItemIndex, getItemId(item, itemIndex))\"\r\n class=\"my-sm border-b border-neutral-base\">\r\n </li>\r\n </ng-container>\r\n </ng-container>\r\n </ul>\r\n </li>\r\n </ng-container>\r\n </ul>\r\n</div>\r\n"
|
|
6963
|
+
template: "<div [attr.id]=\"id\" [class]=\"['c-menubar', classes] | makeHtmlList\"\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 <ng-container *ngIf=\"getLabelRef()\">\r\n <div [id]=\"id + '-label'\" [class]=\"['mb-sm', labelComponent ? labelComponent.classes : (labelData ? labelData.classes : null)] | makeHtmlList\">\r\n <ng-container *ngTemplateOutlet=\"getLabelRef()\"></ng-container>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngIf=\"!getLabelRef() && (labelData || labelText)\">\r\n <div [id]=\"id + '-label'\" [class]=\"['mb-sm', labelData ? labelData.classes : null] | makeHtmlList\">\r\n <ng-container *desyCustomInnerContent=\"{ html: getLabelContent() }\"></ng-container>\r\n </div>\r\n </ng-container>\r\n <ul #menubar [id]=\"id + '-menubar'\" class=\"lg:flex lg:flex-wrap\" role=\"menubar\"\r\n (focusin)=\"handleMenuFocusIn()\"\r\n (focusout)=\"handleMenuFocusOut($event)\"\r\n [ngClass]=\"{ 'focus': isFocused }\"\r\n [attr.aria-label]=\"ariaLabel ? ariaLabel : null\"\r\n [attr.aria-describedby]=\"getLabelRef() || labelData || labelText ? id + '-label' : null\">\r\n <ng-container *ngFor=\"let item of getItems(); index as itemIndex\">\r\n <li class=\"relative\" role=\"none\" desyMenubaritem (contentChanged)=\"checkChanges()\">\r\n <a *ngIf=\"item.sub\" #link\r\n role=\"menuitem\" aria-haspopup=\"true\" aria-expanded=\"false\"\r\n (click)=\"handleMenuItemClick($event, itemIndex)\"\r\n (keydown)=\"handleMenuItemKeydown($event, itemIndex)\"\r\n (mouseover)=\"handleMenuItemMouseOver(itemIndex)\"\r\n (desyAttributeChange)=\"checkChanges()\" [attributesToCheck]=\"'disabled'\"\r\n [id]=\"getItemId(item, itemIndex)\"\r\n [class]=\"['c-menubar__button', item.classes] | makeHtmlList\"\r\n [ngClass]=\"{'c-menubar__button--disabled': item.disabled, 'c-menubar__button--primary': item.active}\"\r\n [attr.disabled]=\"item.disabled ? item.disabled : null\"\r\n [attr.aria-disabled]=\"item.disabled ? item.disabled : (item.ariaDisabled ? item.ariaDisabled : 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-errormessage]=\"item.ariaErrorMessage ? item.ariaErrorMessage : null\"\r\n [attr.aria-modal]=\"item.ariaModal ? item.ariaModal : null\"\r\n [attr.tabindex]=\"item.disabled ? -1 : (itemIndex === currentFocusItemIndex ? 0 : -1)\">\r\n <span class=\"inline-flex self-center max-w-xs align-middle truncate\" #itemContentWrapper\r\n (desyContentEmpty)=\"handleEmptyItem('item content, html or text is required at position ' + itemIndex)\">\r\n <ng-container *desyCustomInnerContent=\"{ component: item, html: item.html, text: item.text}\"></ng-container>\r\n </span>\r\n <svg class=\"inline-block -mr-2 align-middle -my-px\" viewBox=\"0 0 96 96\" aria-hidden=\"true\" fill=\"currentColor\" focusable=\"false\" width=\"1.5em\" height=\"1.5em\"><g><path d=\"M46.71 58.037a1.823 1.823 0 002.581 0L62.048 45.28a1.823 1.823 0 00-1.29-3.113H35.243a1.823 1.823 0 00-1.291 3.113z\"/></g></svg>\r\n </a>\r\n <a *ngIf=\"item.routerLink && !item.sub\" #link #itemContentWrapper\r\n role=\"menuitem\"\r\n (click)=\"handleMenuItemClick($event, itemIndex)\"\r\n (keydown)=\"handleMenuItemKeydown($event, itemIndex)\"\r\n (mouseover)=\"handleMenuItemMouseOver(itemIndex)\"\r\n (desyContentEmpty)=\"handleEmptyItem('item content, html or text is required at position ' + itemIndex)\"\r\n (desyAttributeChange)=\"checkChanges()\" [attributesToCheck]=\"'disabled'\"\r\n [id]=\"getItemId(item, itemIndex)\"\r\n [routerLink]=\"item.routerLink\"\r\n [routerLinkActive]=\"item.routerLinkActiveClasses ? item.routerLinkActiveClasses : []\"\r\n [fragment]=\"item.fragment\"\r\n [class]=\"['c-menubar__button', item.classes] | makeHtmlList\"\r\n [ngClass]=\"{'c-menubar__button--disabled': item.disabled, 'c-menubar__button--primary': item.active}\"\r\n [attr.title]=\"item.title ? item.title : null\"\r\n [attr.disabled]=\"item.disabled ? item.disabled : null\"\r\n [attr.aria-disabled]=\"item.disabled ? item.disabled : (item.ariaDisabled ? item.ariaDisabled : null)\"\r\n [attr.tabindex]=\"item.disabled ? -1 : (itemIndex === currentFocusItemIndex ? 0 : -1)\"\r\n [attr.target]=\"item.target ? item.target : 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 [attr.aria-modal]=\"item.ariaModal ? item.ariaModal : null\">\r\n <ng-container *desyCustomInnerContent=\"{ component: item, html: item.html, text: item.text}\"></ng-container>\r\n </a>\r\n <a *ngIf=\"!item.routerLink && item.href && !item.sub\" #link #itemContentWrapper\r\n role=\"menuitem\"\r\n (click)=\"handleMenuItemClick($event, itemIndex)\"\r\n (keydown)=\"handleMenuItemKeydown($event, itemIndex)\"\r\n (mouseover)=\"handleMenuItemMouseOver(itemIndex)\"\r\n (desyContentEmpty)=\"handleEmptyItem('item content, html or text is required at position ' + itemIndex)\"\r\n (desyAttributeChange)=\"checkChanges()\" [attributesToCheck]=\"'disabled'\"\r\n [id]=\"getItemId(item, itemIndex)\"\r\n [href]=\"item.href | externalHref\"\r\n [class]=\"['c-menubar__button', item.classes] | makeHtmlList\"\r\n [ngClass]=\"{'c-menubar__button--disabled': item.disabled, 'c-menubar__button--primary': item.active}\"\r\n [attr.title]=\"item.title ? item.title : null\"\r\n [attr.disabled]=\"item.disabled ? item.disabled : null\"\r\n [attr.aria-disabled]=\"item.disabled ? item.disabled : (item.ariaDisabled ? item.ariaDisabled : null)\"\r\n [attr.tabindex]=\"item.disabled ? -1 : (itemIndex === currentFocusItemIndex ? 0 : -1)\"\r\n [attr.target]=\"item.target ? item.target : 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 [attr.aria-modal]=\"item.ariaModal ? item.ariaModal : null\">\r\n <ng-container *desyCustomInnerContent=\"{ component: item, html: item.html, text: item.text}\"></ng-container>\r\n </a>\r\n\r\n <ul *ngIf=\"item.sub && getItemSubitems(item)\" #popupMenu role=\"menu\" tabindex=\"-1\"\r\n [ngStyle]=\"getPopupStyle(itemIndex)\"\r\n [class]=\"['c-menubar__tooltip w-max max-w-64 hidden border border-neutral-base shadow-md bg-white text-sm', item.sub.classes] | makeHtmlList\"\r\n [attr.aria-label]=\"item.ariaLabel ? item.ariaLabel : (item.sub.ariaLabel ? item.sub.ariaLabel : null)\"\r\n [attr.aria-describedby]=\"item.sub.ariaDescribedBy ? item.sub.ariaDescribedBy : null\"\r\n [attr.aria-labelledby]=\"item.sub.ariaLabelledBy ? item.sub.ariaLabelledBy : null\"\r\n [attr.aria-hidden]=\"item.sub.ariaHidden ? item.sub.ariaHidden : null\"\r\n [attr.aria-disabled]=\"item.sub.ariaDisabled ? item.sub.ariaDisabled : null\"\r\n [attr.aria-controls]=\"item.sub.ariaControls ? item.sub.ariaControls : null\"\r\n [attr.aria-current]=\"item.sub.ariaCurrent ? item.sub.ariaCurrent : null\"\r\n [attr.aria-live]=\"item.sub.ariaLive ? item.sub.ariaLive : null\"\r\n [attr.aria-expanded]=\"!!(menuData && menuData[itemIndex].open)\"\r\n [attr.aria-errormessage]=\"item.sub.ariaErrorMessage ? item.sub.ariaErrorMessage : null\"\r\n [attr.aria-haspopup]=\"item.sub.ariaHasPopup ? item.sub.ariaHasPopup : null\"\r\n [attr.aria-modal]=\"item.sub.ariaModal ? item.sub.ariaModal : null\">\r\n <ng-container *ngFor=\"let subItem of getItemSubitems(item); index as subItemIndex\">\r\n <ng-container [ngSwitch]=\"subItem.role\">\r\n <li #popupMenuItem *ngSwitchCase=\"'none'\" role=\"none\" tabindex=\"-1\"\r\n [id]=\"getSubItemId(subItem, subItemIndex, getItemId(item, itemIndex))\"\r\n (desyContentEmpty)=\"handleEmptyItem('subitem content, html or text is required at position ' + subItemIndex + ' of item ' + itemIndex)\"\r\n (click)=\"handlePopupMenuItemClick(itemIndex, subItemIndex)\"\r\n (mouseover)=\"handlePopupMenuItemMouseOver(itemIndex, subItemIndex)\"\r\n (keydown)=\"handlePopupMenuItemKeydown($event, itemIndex, subItemIndex)\">\r\n <ng-container *desyCustomInnerContent=\"{ component: subItem, html: subItem.html, text: subItem.text}\"></ng-container>\r\n </li>\r\n <li *ngSwitchCase=\"'group'\" role=\"none\">\r\n <ul role=\"group\" [id]=\"getSubItemId(subItem, subItemIndex, getItemId(item, itemIndex))\"\r\n [attr.aria-label]=\"subItem.ariaLabel ? subItem.ariaLabel : null\">\r\n <ng-container *ngFor=\"let subsubitem of getSubItemSubitems(subItem); index as subsubIndex\">\r\n <ng-container *ngIf=\"subsubitem\">\r\n <li #popupMenuItem [attr.role]=\"subsubitem.role ? subsubitem.role : null\" tabindex=\"-1\"\r\n [id]=\"getSubItemId(subsubitem, subsubIndex, getSubItemId(subItem, subItemIndex, getItemId(item, itemIndex)))\"\r\n (desyContentEmpty)=\"handleEmptyItem('subsubitem content, html or text is required at position ' + subsubIndex + ' of subItem ' + subItemIndex + ' of item ' + itemIndex)\"\r\n (click)=\"handlePopupMenuItemClick(itemIndex, subItemIndex, subsubIndex)\"\r\n (mouseover)=\"handlePopupMenuItemMouseOver(itemIndex, subItemIndex, subsubIndex)\"\r\n (keydown)=\"handlePopupMenuItemKeydown($event, itemIndex, subItemIndex, subsubIndex)\"\r\n [attr.aria-checked]=\"getSubSubItemAriaChecked(subsubitem)\"\r\n class=\"flex items-center pr-base pl-lg py-sm cursor-pointer hover:bg-primary-base hover:text-white\">\r\n <ng-container *desyCustomInnerContent=\"{ component: subsubitem, html: subsubitem.html, text: subsubitem.text}\"></ng-container>\r\n </li>\r\n </ng-container>\r\n </ng-container>\r\n </ul>\r\n </li>\r\n <li #popupMenuItem *ngSwitchCase=\"'menuitem'\" role=\"menuitem\" tabindex=\"-1\"\r\n (desyContentEmpty)=\"handleEmptyItem('subitem content, html or text is required at position ' + subItemIndex + ' of item ' + itemIndex)\"\r\n (click)=\"handlePopupMenuItemClick(itemIndex, subItemIndex)\"\r\n (mouseover)=\"handlePopupMenuItemMouseOver(itemIndex, subItemIndex)\"\r\n (keydown)=\"handlePopupMenuItemKeydown($event, itemIndex, subItemIndex)\"\r\n [id]=\"getSubItemId(subItem, subItemIndex, getItemId(item, itemIndex))\"\r\n class=\"flex items-center pr-base pl-lg py-sm cursor-pointer hover:bg-primary-base hover:text-white focus:bg-primary-base focus:text-white focus:outline-none\">\r\n <ng-container *desyCustomInnerContent=\"{ component: subItem, html: subItem.html, text: subItem.text}\"></ng-container>\r\n </li>\r\n <li #popupMenuItem *ngSwitchCase=\"'menuitemcheckbox'\" role=\"menuitemcheckbox\" tabindex=\"-1\"\r\n (desyContentEmpty)=\"handleEmptyItem('subitem content, html or text is required at position ' + subItemIndex + ' of item ' + itemIndex)\"\r\n (click)=\"handlePopupMenuItemClick(itemIndex, subItemIndex)\"\r\n (mouseover)=\"handlePopupMenuItemMouseOver(itemIndex, subItemIndex)\"\r\n (keydown)=\"handlePopupMenuItemKeydown($event, itemIndex, subItemIndex)\"\r\n [id]=\"getSubItemId(subItem, subItemIndex, getItemId(item, itemIndex))\"\r\n [attr.aria-checked]=\"!!subItem.checked\"\r\n class=\"flex items-center pr-base pl-lg py-sm cursor-pointer hover:bg-primary-base hover:text-white\">\r\n <ng-container *desyCustomInnerContent=\"{ component: subItem, html: subItem.html, text: subItem.text}\"></ng-container>\r\n </li>\r\n <li #popupMenuItem *ngSwitchCase=\"'separator'\" role=\"separator\"\r\n [id]=\"getSubItemId(subItem, subItemIndex, getItemId(item, itemIndex))\"\r\n class=\"my-sm border-b border-neutral-base\">\r\n </li>\r\n </ng-container>\r\n </ng-container>\r\n </ul>\r\n </li>\r\n </ng-container>\r\n </ul>\r\n</div>\r\n"
|
|
5891
6964
|
},] }
|
|
5892
6965
|
];
|
|
5893
6966
|
MenubarComponent.ctorParameters = function () { return [
|
|
@@ -6169,67 +7242,6 @@
|
|
|
6169
7242
|
DesyContentChild()
|
|
6170
7243
|
], TableComponent.prototype, "headerComponent", void 0);
|
|
6171
7244
|
|
|
6172
|
-
var SearchUtils = /** @class */ (function () {
|
|
6173
|
-
function SearchUtils() {
|
|
6174
|
-
}
|
|
6175
|
-
/**
|
|
6176
|
-
* Comprueba si una cadena de texto (target) contiene cualquier palabra de otro texto (text)
|
|
6177
|
-
* @param target - Texto en el que buscar
|
|
6178
|
-
* @param text - Texto a buscar
|
|
6179
|
-
* @param fullWord - Indica si las palabras del texto a buscar deben aparecer enteras
|
|
6180
|
-
*/
|
|
6181
|
-
SearchUtils.containsAnyWordFrom = function (target, text, fullWord) {
|
|
6182
|
-
var _this = this;
|
|
6183
|
-
var words = [];
|
|
6184
|
-
var includes = false;
|
|
6185
|
-
var simplifiedTarget = this.getSimplifiedString(target);
|
|
6186
|
-
if (text && text.split(' ').length > 1) {
|
|
6187
|
-
words = text.split(' ');
|
|
6188
|
-
}
|
|
6189
|
-
words.push(text);
|
|
6190
|
-
words.forEach(function (word) {
|
|
6191
|
-
if (simplifiedTarget && word) {
|
|
6192
|
-
if ((fullWord && simplifiedTarget === _this.getSimplifiedString(word))
|
|
6193
|
-
|| (!fullWord && simplifiedTarget.includes(_this.getSimplifiedString(word)))) {
|
|
6194
|
-
includes = true;
|
|
6195
|
-
}
|
|
6196
|
-
}
|
|
6197
|
-
});
|
|
6198
|
-
return includes;
|
|
6199
|
-
};
|
|
6200
|
-
/**
|
|
6201
|
-
* Convierte a mayúsculas, elimina espacios y reemplaza/elimina caracteres especiales para realizar comparaciones más tolerantes
|
|
6202
|
-
* @param str - cadena de entrada
|
|
6203
|
-
*/
|
|
6204
|
-
SearchUtils.getSimplifiedString = function (str) {
|
|
6205
|
-
var res = str;
|
|
6206
|
-
if (str) {
|
|
6207
|
-
res = str.toLocaleUpperCase().trim();
|
|
6208
|
-
res = res.replace('Á', 'A');
|
|
6209
|
-
res = res.replace('É', 'E');
|
|
6210
|
-
res = res.replace('Í', 'I');
|
|
6211
|
-
res = res.replace('Ó', 'O');
|
|
6212
|
-
res = res.replace('Ú', 'U');
|
|
6213
|
-
res = res.replace('À', 'A');
|
|
6214
|
-
res = res.replace('È', 'E');
|
|
6215
|
-
res = res.replace('Ì', 'I');
|
|
6216
|
-
res = res.replace('Ò', 'O');
|
|
6217
|
-
res = res.replace('Ù', 'U');
|
|
6218
|
-
res = res.replace('Ä', 'A');
|
|
6219
|
-
res = res.replace('Ë', 'E');
|
|
6220
|
-
res = res.replace('Ï', 'I');
|
|
6221
|
-
res = res.replace('Ö', 'O');
|
|
6222
|
-
res = res.replace('Ü', 'U');
|
|
6223
|
-
res = res.replace(',', '');
|
|
6224
|
-
res = res.replace('.', '');
|
|
6225
|
-
res = res.replace('\'', '');
|
|
6226
|
-
res = res.replace('"', '');
|
|
6227
|
-
}
|
|
6228
|
-
return res;
|
|
6229
|
-
};
|
|
6230
|
-
return SearchUtils;
|
|
6231
|
-
}());
|
|
6232
|
-
|
|
6233
7245
|
exports.OrderBy = void 0;
|
|
6234
7246
|
(function (OrderBy) {
|
|
6235
7247
|
OrderBy["none"] = "none";
|
|
@@ -7732,7 +8744,7 @@
|
|
|
7732
8744
|
PaginationComponent.decorators = [
|
|
7733
8745
|
{ type: i0.Component, args: [{
|
|
7734
8746
|
selector: 'desy-pagination',
|
|
7735
|
-
template: "<div [attr.id]=\"id ? id : null\" [class]=\"['lg:flex lg:flex-wrap lg:align-center', classesContainer] | makeHtmlList\">\r\n <ng-container *ngIf=\"hasSelect\">\r\n <p class=\"w-full mb-xs text-sm text-neutral-dark\">\r\n Selecciona una p\u00E1gina para cargar datos\r\n </p>\r\n <nav [class]=\"['flex flex-wrap items-center flex-1 mb-base lg:mb-0 text-sm', classes] | makeHtmlList\"\r\n [attr.aria-label]=\"ariaLabel ? ariaLabel : null\"\r\n [attr.aria-describedby]=\"ariaDescribedBy ? ariaDescribedBy : null\"\r\n [attr.aria-labelledby]=\"ariaLabelledBy ? ariaLabelledBy : null\"\r\n [attr.aria-hidden]=\"ariaHidden ? ariaHidden : null\"\r\n [attr.aria-disabled]=\"ariaDisabled ? ariaDisabled : null\"\r\n [attr.aria-controls]=\"ariaControls ? ariaControls : null\"\r\n [attr.aria-current]=\"ariaCurrent ? ariaCurrent : null\"\r\n [attr.aria-live]=\"ariaLive ? ariaLive : null\"\r\n [attr.aria-expanded]=\"ariaExpanded ? ariaExpanded : null\"\r\n [attr.aria-errormessage]=\"ariaErrorMessage ? ariaErrorMessage : null\"\r\n [attr.aria-haspopup]=\"ariaHasPopup ? ariaHasPopup : null\"\r\n [attr.tabindex]=\"tabindex ? tabindex : null\">\r\n <desy-button (clickEvent)=\"previous()\" [id]=\"getIdPrefix() + '-previous'\"\r\n [html]=\"previousIcon + prefix + previousText + getSuffix(currentPage - 2)\" [disabled]=\"currentPage === 1 || !hasPrevious\"\r\n classes=\"c-button--sm c-button--transparent mr-xs\"></desy-button>\r\n <desy-listbox [id]=\"id + '-listbox'\"\r\n [idPrefix]=\"idPrefix\"\r\n [text]=\"'P\u00E1gina ' + getActiveItemText()\"\r\n [classes]=\"'c-listbox--sm c-listbox--transparent mr-xs'\"\r\n [doesChangeButtonText]=\"true\"\r\n [label]=\"{ text: 'Selecciona una p\u00E1gina para cargar datos', classes: 'sr-only' }\"\r\n [(items)]=\"items\"\r\n (activeItemChange)=\"changePage(+$event.text)\"></desy-listbox>\r\n <desy-button (clickEvent)=\"next()\" [id]=\"getIdPrefix() + '-next'\"\r\n [html]=\"prefix + nextText + getSuffix(currentPage) + nextIcon\" [disabled]=\"currentPage === nPages || !hasNext\"\r\n classes=\"c-button--sm c-button--transparent mr-xs\"></desy-button>\r\n </nav>\r\n </ng-container>\r\n <ng-container *ngIf=\"!hasSelect\">\r\n <nav [class]=\"['flex flex-wrap items-center flex-1 mb-base lg:mb-0 text-sm', classes] | makeHtmlList\"\r\n [attr.role]=\"role ? role : null\"\r\n [attr.aria-label]=\"ariaLabel ? ariaLabel : null\"\r\n [attr.aria-describedby]=\"ariaDescribedBy ? ariaDescribedBy : null\"\r\n [attr.aria-labelledby]=\"ariaLabelledBy ? ariaLabelledBy : null\"\r\n [attr.aria-hidden]=\"ariaHidden ? ariaHidden : null\"\r\n [attr.aria-disabled]=\"ariaDisabled ? ariaDisabled : null\"\r\n [attr.aria-controls]=\"ariaControls ? ariaControls : null\"\r\n [attr.aria-current]=\"ariaCurrent ? ariaCurrent : null\"\r\n [attr.aria-live]=\"ariaLive ? ariaLive : null\"\r\n [attr.aria-expanded]=\"ariaExpanded ? ariaExpanded : null\"\r\n [attr.aria-errormessage]=\"ariaErrorMessage ? ariaErrorMessage : null\"\r\n [attr.aria-haspopup]=\"ariaHasPopup ? ariaHasPopup : null\"\r\n [attr.tabindex]=\"tabindex ? tabindex : null\">\r\n <ul class=\"flex flex-wrap\">\r\n <li *ngFor=\"let item of items; index as i\">\r\n <desy-button *ngIf=\"item.active\" [id]=\"getButtonId(i)\"\r\n [html]=\"'<strong>' + prefix + (i + 1) + getSuffix(i) + '</strong>'\"\r\n classes=\"c-button--primary c-button--disabled mb-sm mr-sm\"\r\n disabled=\"true\" ariaCurrent=\"page\" tabindex=\"-1\" ></desy-button>\r\n <desy-button *ngIf=\"!item.active\" [id]=\"getButtonId(i)\"\r\n [html]=\"prefix + (i + 1) + getSuffix(i)\"\r\n (clickEvent)=\"changePage(i + 1)\"\r\n classes=\"mb-sm mr-sm\"></desy-button>\r\n </li>\r\n </ul>\r\n </nav>\r\n </ng-container>\r\n <p class=\"block lg:ml-auto text-sm text-neutral-dark\">\r\n <span class=\"sr-only\">Posici\u00F3n de paginaci\u00F3n: </span>{{(currentPage - 1) * itemsPerPage + 1}} - {{getLastItemNumber(currentPage - 1)}} de {{totalItems}}\r\n </p>\r\n</div>\r\n"
|
|
8747
|
+
template: "<div [attr.id]=\"id ? id : null\" [class]=\"['lg:flex lg:flex-wrap lg:align-center', classesContainer] | makeHtmlList\">\r\n <ng-container *ngIf=\"hasSelect\">\r\n <p class=\"w-full mb-xs text-sm text-neutral-dark\">\r\n Selecciona una p\u00E1gina para cargar datos\r\n </p>\r\n <nav [class]=\"['flex flex-wrap items-center flex-1 mb-base lg:mb-0 text-sm', classes] | makeHtmlList\"\r\n [attr.aria-label]=\"ariaLabel ? ariaLabel : null\"\r\n [attr.aria-describedby]=\"ariaDescribedBy ? ariaDescribedBy : null\"\r\n [attr.aria-labelledby]=\"ariaLabelledBy ? ariaLabelledBy : null\"\r\n [attr.aria-hidden]=\"ariaHidden ? ariaHidden : null\"\r\n [attr.aria-disabled]=\"ariaDisabled ? ariaDisabled : null\"\r\n [attr.aria-controls]=\"ariaControls ? ariaControls : null\"\r\n [attr.aria-current]=\"ariaCurrent ? ariaCurrent : null\"\r\n [attr.aria-live]=\"ariaLive ? ariaLive : null\"\r\n [attr.aria-expanded]=\"ariaExpanded ? ariaExpanded : null\"\r\n [attr.aria-errormessage]=\"ariaErrorMessage ? ariaErrorMessage : null\"\r\n [attr.aria-haspopup]=\"ariaHasPopup ? ariaHasPopup : null\"\r\n [attr.tabindex]=\"tabindex ? tabindex : null\">\r\n <desy-button (clickEvent)=\"previous()\" [id]=\"getIdPrefix() + '-previous'\"\r\n [html]=\"previousIcon + prefix + previousText + getSuffix(currentPage - 2)\" [disabled]=\"currentPage === 1 || !hasPrevious\"\r\n classes=\"c-button--sm c-button--transparent mr-xs\"></desy-button>\r\n <desy-listbox [id]=\"id + '-listbox'\"\r\n [idPrefix]=\"idPrefix\"\r\n [text]=\"'P\u00E1gina ' + getActiveItemText()\"\r\n [classes]=\"'c-listbox--sm c-listbox--transparent mr-xs'\"\r\n [classesTooltip]=\"'max-h-52 overflow-y-auto'\"\r\n [doesChangeButtonText]=\"true\"\r\n [label]=\"{ text: 'Selecciona una p\u00E1gina para cargar datos', classes: 'sr-only' }\"\r\n [(items)]=\"items\"\r\n (activeItemChange)=\"changePage(+$event.text)\"></desy-listbox>\r\n <desy-button (clickEvent)=\"next()\" [id]=\"getIdPrefix() + '-next'\"\r\n [html]=\"prefix + nextText + getSuffix(currentPage) + nextIcon\" [disabled]=\"currentPage === nPages || !hasNext\"\r\n classes=\"c-button--sm c-button--transparent mr-xs\"></desy-button>\r\n </nav>\r\n </ng-container>\r\n <ng-container *ngIf=\"!hasSelect\">\r\n <nav [class]=\"['flex flex-wrap items-center flex-1 mb-base lg:mb-0 text-sm', classes] | makeHtmlList\"\r\n [attr.role]=\"role ? role : null\"\r\n [attr.aria-label]=\"ariaLabel ? ariaLabel : null\"\r\n [attr.aria-describedby]=\"ariaDescribedBy ? ariaDescribedBy : null\"\r\n [attr.aria-labelledby]=\"ariaLabelledBy ? ariaLabelledBy : null\"\r\n [attr.aria-hidden]=\"ariaHidden ? ariaHidden : null\"\r\n [attr.aria-disabled]=\"ariaDisabled ? ariaDisabled : null\"\r\n [attr.aria-controls]=\"ariaControls ? ariaControls : null\"\r\n [attr.aria-current]=\"ariaCurrent ? ariaCurrent : null\"\r\n [attr.aria-live]=\"ariaLive ? ariaLive : null\"\r\n [attr.aria-expanded]=\"ariaExpanded ? ariaExpanded : null\"\r\n [attr.aria-errormessage]=\"ariaErrorMessage ? ariaErrorMessage : null\"\r\n [attr.aria-haspopup]=\"ariaHasPopup ? ariaHasPopup : null\"\r\n [attr.tabindex]=\"tabindex ? tabindex : null\">\r\n <ul class=\"flex flex-wrap\">\r\n <li *ngFor=\"let item of items; index as i\">\r\n <desy-button *ngIf=\"item.active\" [id]=\"getButtonId(i)\"\r\n [html]=\"'<strong>' + prefix + (i + 1) + getSuffix(i) + '</strong>'\"\r\n classes=\"c-button--primary c-button--disabled mb-sm mr-sm\"\r\n disabled=\"true\" ariaCurrent=\"page\" tabindex=\"-1\" ></desy-button>\r\n <desy-button *ngIf=\"!item.active\" [id]=\"getButtonId(i)\"\r\n [html]=\"prefix + (i + 1) + getSuffix(i)\"\r\n (clickEvent)=\"changePage(i + 1)\"\r\n classes=\"mb-sm mr-sm\"></desy-button>\r\n </li>\r\n </ul>\r\n </nav>\r\n </ng-container>\r\n <p class=\"block lg:ml-auto text-sm text-neutral-dark\">\r\n <span class=\"sr-only\">Posici\u00F3n de paginaci\u00F3n: </span>{{(currentPage - 1) * itemsPerPage + 1}} - {{getLastItemNumber(currentPage - 1)}} de {{totalItems}}\r\n </p>\r\n</div>\r\n"
|
|
7736
8748
|
},] }
|
|
7737
8749
|
];
|
|
7738
8750
|
PaginationComponent.propDecorators = {
|
|
@@ -8236,6 +9248,11 @@
|
|
|
8236
9248
|
DateInputDayComponent,
|
|
8237
9249
|
DateInputMonthComponent,
|
|
8238
9250
|
DateInputYearComponent,
|
|
9251
|
+
TreeComponent,
|
|
9252
|
+
TreeSubComponent,
|
|
9253
|
+
TreeItemComponent,
|
|
9254
|
+
TreeCheckboxComponent,
|
|
9255
|
+
TreeItemsGeneratorComponent,
|
|
8239
9256
|
ConditionDirective,
|
|
8240
9257
|
],
|
|
8241
9258
|
imports: [
|
|
@@ -8272,6 +9289,10 @@
|
|
|
8272
9289
|
DateInputDayComponent,
|
|
8273
9290
|
DateInputMonthComponent,
|
|
8274
9291
|
DateInputYearComponent,
|
|
9292
|
+
TreeComponent,
|
|
9293
|
+
TreeSubComponent,
|
|
9294
|
+
TreeItemComponent,
|
|
9295
|
+
TreeItemsGeneratorComponent,
|
|
8275
9296
|
ConditionDirective
|
|
8276
9297
|
]
|
|
8277
9298
|
},] }
|
|
@@ -8473,6 +9494,80 @@
|
|
|
8473
9494
|
},] }
|
|
8474
9495
|
];
|
|
8475
9496
|
|
|
9497
|
+
var ToggleOffStateComponent = /** @class */ (function (_super) {
|
|
9498
|
+
__extends(ToggleOffStateComponent, _super);
|
|
9499
|
+
function ToggleOffStateComponent() {
|
|
9500
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
9501
|
+
}
|
|
9502
|
+
return ToggleOffStateComponent;
|
|
9503
|
+
}(AccessibilityComponent));
|
|
9504
|
+
ToggleOffStateComponent.decorators = [
|
|
9505
|
+
{ type: i0.Component, args: [{
|
|
9506
|
+
selector: 'desy-toggle-off-state',
|
|
9507
|
+
template: "<ng-template #contentTemplateOffState>\r\n <ng-content></ng-content>\r\n</ng-template>"
|
|
9508
|
+
},] }
|
|
9509
|
+
];
|
|
9510
|
+
ToggleOffStateComponent.propDecorators = {
|
|
9511
|
+
content: [{ type: i0.ViewChild, args: ['contentTemplateOffState', { static: true },] }],
|
|
9512
|
+
classes: [{ type: i0.Input }]
|
|
9513
|
+
};
|
|
9514
|
+
|
|
9515
|
+
var ToggleOnStateComponent = /** @class */ (function (_super) {
|
|
9516
|
+
__extends(ToggleOnStateComponent, _super);
|
|
9517
|
+
function ToggleOnStateComponent() {
|
|
9518
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
9519
|
+
}
|
|
9520
|
+
return ToggleOnStateComponent;
|
|
9521
|
+
}(AccessibilityComponent));
|
|
9522
|
+
ToggleOnStateComponent.decorators = [
|
|
9523
|
+
{ type: i0.Component, args: [{
|
|
9524
|
+
selector: 'desy-toggle-on-state',
|
|
9525
|
+
template: "<ng-template #contentTemplateOnState>\r\n <ng-content></ng-content>\r\n</ng-template>"
|
|
9526
|
+
},] }
|
|
9527
|
+
];
|
|
9528
|
+
ToggleOnStateComponent.propDecorators = {
|
|
9529
|
+
content: [{ type: i0.ViewChild, args: ['contentTemplateOnState', { static: true },] }],
|
|
9530
|
+
classes: [{ type: i0.Input }]
|
|
9531
|
+
};
|
|
9532
|
+
|
|
9533
|
+
var ToggleComponent = /** @class */ (function (_super) {
|
|
9534
|
+
__extends(ToggleComponent, _super);
|
|
9535
|
+
function ToggleComponent() {
|
|
9536
|
+
var _this = _super.apply(this, __spread(arguments)) || this;
|
|
9537
|
+
_this.clickEvent = new i0.EventEmitter();
|
|
9538
|
+
_this.pressedChange = new i0.EventEmitter();
|
|
9539
|
+
return _this;
|
|
9540
|
+
}
|
|
9541
|
+
ToggleComponent.prototype.onClick = function (event) {
|
|
9542
|
+
this.pressed = !this.pressed;
|
|
9543
|
+
this.pressedChange.emit(this.pressed);
|
|
9544
|
+
this.clickEvent.emit(event);
|
|
9545
|
+
};
|
|
9546
|
+
return ToggleComponent;
|
|
9547
|
+
}(AccessibilityComponent));
|
|
9548
|
+
ToggleComponent.decorators = [
|
|
9549
|
+
{ type: i0.Component, args: [{
|
|
9550
|
+
selector: 'desy-toggle',
|
|
9551
|
+
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 -->"
|
|
9552
|
+
},] }
|
|
9553
|
+
];
|
|
9554
|
+
ToggleComponent.propDecorators = {
|
|
9555
|
+
id: [{ type: i0.Input }],
|
|
9556
|
+
isSwitch: [{ type: i0.Input }],
|
|
9557
|
+
pressed: [{ type: i0.Input }],
|
|
9558
|
+
classes: [{ type: i0.Input }],
|
|
9559
|
+
clickEvent: [{ type: i0.Output }],
|
|
9560
|
+
pressedChange: [{ type: i0.Output }],
|
|
9561
|
+
contentTemplateOnState: [{ type: i0.ContentChildren, args: [ToggleOnStateComponent,] }],
|
|
9562
|
+
contentTemplateOffState: [{ type: i0.ContentChildren, args: [ToggleOffStateComponent,] }]
|
|
9563
|
+
};
|
|
9564
|
+
__decorate([
|
|
9565
|
+
DesyContentChild()
|
|
9566
|
+
], ToggleComponent.prototype, "contentTemplateOnState", void 0);
|
|
9567
|
+
__decorate([
|
|
9568
|
+
DesyContentChild()
|
|
9569
|
+
], ToggleComponent.prototype, "contentTemplateOffState", void 0);
|
|
9570
|
+
|
|
8476
9571
|
var DesyButtonsModule = /** @class */ (function () {
|
|
8477
9572
|
function DesyButtonsModule() {
|
|
8478
9573
|
}
|
|
@@ -8487,7 +9582,10 @@
|
|
|
8487
9582
|
ListboxComponent,
|
|
8488
9583
|
PillComponent,
|
|
8489
9584
|
ListboxItemComponent,
|
|
8490
|
-
ListboxLabelComponent
|
|
9585
|
+
ListboxLabelComponent,
|
|
9586
|
+
ToggleComponent,
|
|
9587
|
+
ToggleOnStateComponent,
|
|
9588
|
+
ToggleOffStateComponent
|
|
8491
9589
|
],
|
|
8492
9590
|
imports: [
|
|
8493
9591
|
common.CommonModule,
|
|
@@ -8502,7 +9600,10 @@
|
|
|
8502
9600
|
ListboxComponent,
|
|
8503
9601
|
PillComponent,
|
|
8504
9602
|
ListboxItemComponent,
|
|
8505
|
-
ListboxLabelComponent
|
|
9603
|
+
ListboxLabelComponent,
|
|
9604
|
+
ToggleComponent,
|
|
9605
|
+
ToggleOnStateComponent,
|
|
9606
|
+
ToggleOffStateComponent
|
|
8506
9607
|
]
|
|
8507
9608
|
},] }
|
|
8508
9609
|
];
|
|
@@ -8930,17 +10031,26 @@
|
|
|
8930
10031
|
exports.TextareaComponent = TextareaComponent;
|
|
8931
10032
|
exports.TitleComponent = TitleComponent;
|
|
8932
10033
|
exports.TooltipContentComponent = TooltipContentComponent;
|
|
10034
|
+
exports.TreeComponent = TreeComponent;
|
|
10035
|
+
exports.TreeItemComponent = TreeItemComponent;
|
|
10036
|
+
exports.TreeItemsGeneratorComponent = TreeItemsGeneratorComponent;
|
|
10037
|
+
exports.TreeSubComponent = TreeSubComponent;
|
|
8933
10038
|
exports.summaryTextOrSummaryHtmlRequiredFunction = summaryTextOrSummaryHtmlRequiredFunction;
|
|
8934
10039
|
exports.ɵa = AccessibilityComponent;
|
|
8935
10040
|
exports.ɵb = AccessibilityAndContentRequiredComponent;
|
|
8936
|
-
exports.ɵba =
|
|
8937
|
-
exports.ɵbb =
|
|
8938
|
-
exports.ɵbc =
|
|
8939
|
-
exports.ɵbd =
|
|
8940
|
-
exports.ɵbe =
|
|
8941
|
-
exports.ɵbf =
|
|
8942
|
-
exports.ɵbg =
|
|
8943
|
-
exports.ɵbh =
|
|
10041
|
+
exports.ɵba = AttributeChangeDirective;
|
|
10042
|
+
exports.ɵbb = InnerContentDirective;
|
|
10043
|
+
exports.ɵbc = ClickOutsideDirective;
|
|
10044
|
+
exports.ɵbd = ContentChangeDirective;
|
|
10045
|
+
exports.ɵbe = ContentEmptyDirective;
|
|
10046
|
+
exports.ɵbf = CustomInnerContentDirective;
|
|
10047
|
+
exports.ɵbg = TooltipComponent;
|
|
10048
|
+
exports.ɵbh = TemplateDrivenWrapperComponent;
|
|
10049
|
+
exports.ɵbi = DateInputDividerComponent;
|
|
10050
|
+
exports.ɵbj = DateInputDayComponent;
|
|
10051
|
+
exports.ɵbk = DateInputMonthComponent;
|
|
10052
|
+
exports.ɵbl = DateInputYearComponent;
|
|
10053
|
+
exports.ɵbm = FocusClickedCellDirective;
|
|
8944
10054
|
exports.ɵc = AccessibilityAndTextOrHtmlRequiredComponent;
|
|
8945
10055
|
exports.ɵd = DesyContentChild;
|
|
8946
10056
|
exports.ɵe = ContentBaseComponent;
|
|
@@ -8949,22 +10059,22 @@
|
|
|
8949
10059
|
exports.ɵh = DesyOnInputChange;
|
|
8950
10060
|
exports.ɵi = InputGroupItemComponent;
|
|
8951
10061
|
exports.ɵj = DateInputItemComponent;
|
|
8952
|
-
exports.ɵk =
|
|
8953
|
-
exports.ɵl =
|
|
8954
|
-
exports.ɵm =
|
|
8955
|
-
exports.ɵn =
|
|
8956
|
-
exports.ɵo =
|
|
8957
|
-
exports.ɵp =
|
|
8958
|
-
exports.ɵq =
|
|
8959
|
-
exports.ɵr =
|
|
8960
|
-
exports.ɵs =
|
|
8961
|
-
exports.ɵt =
|
|
8962
|
-
exports.ɵu =
|
|
8963
|
-
exports.ɵv =
|
|
8964
|
-
exports.ɵw =
|
|
8965
|
-
exports.ɵx =
|
|
8966
|
-
exports.ɵy =
|
|
8967
|
-
exports.ɵz =
|
|
10062
|
+
exports.ɵk = ITreeItem;
|
|
10063
|
+
exports.ɵl = TreeCheckboxComponent;
|
|
10064
|
+
exports.ɵm = HeaderNavigationItemComponent;
|
|
10065
|
+
exports.ɵn = MenubaritemDirective;
|
|
10066
|
+
exports.ɵo = RowDirective;
|
|
10067
|
+
exports.ɵp = CellDirective;
|
|
10068
|
+
exports.ɵq = TabItemComponent;
|
|
10069
|
+
exports.ɵr = PanelComponent;
|
|
10070
|
+
exports.ɵs = ToggleComponent;
|
|
10071
|
+
exports.ɵt = ToggleOnStateComponent;
|
|
10072
|
+
exports.ɵu = ToggleOffStateComponent;
|
|
10073
|
+
exports.ɵv = SharedModule;
|
|
10074
|
+
exports.ɵw = TextOrHtmlRequiredComponent;
|
|
10075
|
+
exports.ɵx = InnerHtmlPipe;
|
|
10076
|
+
exports.ɵy = MakeHtmlListPipe;
|
|
10077
|
+
exports.ɵz = ExternalHrefPipe;
|
|
8968
10078
|
|
|
8969
10079
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
8970
10080
|
|