@energycap/components 0.39.16-ECAP-23124-menu-item-divider-improvements.20240516-1629 → 0.39.16-ECAP-23124-menu-item-divider-improvements.20240523-1101
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/esm2020/lib/controls/checkbox/checkbox.component.mjs +5 -4
- package/esm2020/lib/controls/combobox/combobox.component.mjs +35 -42
- package/esm2020/lib/controls/file-upload/file-upload.component.mjs +3 -3
- package/esm2020/lib/controls/form-control-base.mjs +10 -2
- package/esm2020/lib/controls/form-group/form-group.component.mjs +12 -3
- package/esm2020/lib/controls/menu/menu.component.mjs +67 -39
- package/esm2020/lib/controls/numericbox/numericbox.component.mjs +5 -4
- package/esm2020/lib/controls/radio-button/radio-button.component.mjs +5 -4
- package/esm2020/lib/controls/select/select.component.mjs +5 -4
- package/esm2020/lib/controls/textbox/textbox.component.mjs +4 -3
- package/fesm2015/energycap-components.mjs +1184 -1148
- package/fesm2015/energycap-components.mjs.map +1 -1
- package/fesm2020/energycap-components.mjs +1549 -1514
- package/fesm2020/energycap-components.mjs.map +1 -1
- package/lib/controls/combobox/combobox.component.d.ts +5 -0
- package/lib/controls/form-control-base.d.ts +10 -1
- package/lib/controls/form-group/form-group.component.d.ts +10 -1
- package/lib/controls/menu/menu.component.d.ts +25 -11
- package/package.json +1 -1
@@ -1,24 +1,24 @@
|
|
1
1
|
import * as i3 from '@angular/cdk/a11y';
|
2
2
|
import { A11yModule } from '@angular/cdk/a11y';
|
3
|
-
import * as i1$
|
3
|
+
import * as i1$1 from '@angular/cdk/overlay';
|
4
4
|
import { OverlayConfig, OverlayModule } from '@angular/cdk/overlay';
|
5
5
|
import * as i1 from '@angular/common';
|
6
6
|
import { DOCUMENT, CommonModule } from '@angular/common';
|
7
7
|
import * as i0 from '@angular/core';
|
8
|
-
import { Injectable, EventEmitter, Component, HostBinding, Input, Output, ViewChild, Directive, Host, Pipe,
|
8
|
+
import { Injectable, EventEmitter, Component, HostBinding, Input, Output, ViewChild, Directive, Host, Pipe, HostListener, Inject, ElementRef, ViewEncapsulation, ContentChild, TemplateRef, ViewContainerRef, ContentChildren, NgModule, Injector } from '@angular/core';
|
9
9
|
import * as i4 from '@angular/forms';
|
10
10
|
import { Validators, UntypedFormControl, FormControlDirective, UntypedFormGroup, UntypedFormArray, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
11
|
-
import * as i1$
|
11
|
+
import * as i1$2 from '@angular/router';
|
12
12
|
import { NavigationEnd, convertToParamMap, NavigationStart, Router, RouterModule, ActivatedRoute } from '@angular/router';
|
13
13
|
import * as i2 from '@ngx-translate/core';
|
14
14
|
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
15
15
|
import { ClipboardService } from 'ngx-clipboard';
|
16
16
|
import { Subject, of, forkJoin, merge, fromEvent, timer, EMPTY, race, ReplaySubject } from 'rxjs';
|
17
|
-
import { takeUntil, distinctUntilChanged, filter, take, debounceTime,
|
17
|
+
import { takeUntil, switchMap, delay, distinctUntilChanged, filter, take, debounceTime, skipWhile, map, tap, skipUntil, pluck, catchError } from 'rxjs/operators';
|
18
18
|
import moment from 'moment';
|
19
|
+
import { ComponentPortal, TemplatePortal } from '@angular/cdk/portal';
|
19
20
|
import Popper from 'popper.js';
|
20
21
|
import { cloneDeep, uniqueId, isEqual, sortBy, orderBy, get, upperFirst } from 'lodash';
|
21
|
-
import { ComponentPortal, TemplatePortal } from '@angular/cdk/portal';
|
22
22
|
|
23
23
|
class CacheService {
|
24
24
|
constructor() {
|
@@ -903,6 +903,10 @@ class FormControlBase {
|
|
903
903
|
* The tabindex of the control
|
904
904
|
*/
|
905
905
|
this.tabindex = 0;
|
906
|
+
/**
|
907
|
+
* When a help popover is present, allows the popover to be positioned in different locations.
|
908
|
+
*/
|
909
|
+
this.helpPopoverPosition = 'top-left';
|
906
910
|
/**
|
907
911
|
* All current validation errors
|
908
912
|
*/
|
@@ -979,7 +983,7 @@ class FormControlBase {
|
|
979
983
|
}
|
980
984
|
}
|
981
985
|
FormControlBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FormControlBase, deps: [{ token: ValidationMessageService }, { token: FormGroupHelper }], target: i0.ɵɵFactoryTarget.Directive });
|
982
|
-
FormControlBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: FormControlBase, inputs: { autofocus: "autofocus", formModel: "formModel", label: "label", labelPosition: "labelPosition", id: "id", pending: "pending", required: "required", tabindex: "tabindex", readonly: "readonly", tooltip: "tooltip" }, usesOnChanges: true, ngImport: i0 });
|
986
|
+
FormControlBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: FormControlBase, inputs: { autofocus: "autofocus", formModel: "formModel", label: "label", labelPosition: "labelPosition", id: "id", pending: "pending", required: "required", tabindex: "tabindex", readonly: "readonly", tooltip: "tooltip", helpPopover: "helpPopover", helpPopoverPosition: "helpPopoverPosition" }, usesOnChanges: true, ngImport: i0 });
|
983
987
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FormControlBase, decorators: [{
|
984
988
|
type: Directive
|
985
989
|
}], ctorParameters: function () { return [{ type: ValidationMessageService }, { type: FormGroupHelper }]; }, propDecorators: { autofocus: [{
|
@@ -1002,329 +1006,659 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
1002
1006
|
type: Input
|
1003
1007
|
}], tooltip: [{
|
1004
1008
|
type: Input
|
1009
|
+
}], helpPopover: [{
|
1010
|
+
type: Input
|
1011
|
+
}], helpPopoverPosition: [{
|
1012
|
+
type: Input
|
1005
1013
|
}] } });
|
1006
1014
|
|
1007
|
-
class
|
1008
|
-
constructor(
|
1009
|
-
|
1010
|
-
this.
|
1011
|
-
this.
|
1012
|
-
/**
|
1013
|
-
* The name of the checkbox input element
|
1014
|
-
*/
|
1015
|
-
this.name = '';
|
1016
|
-
/**
|
1017
|
-
* Determines whether to ignore or include disabled dependent checkboxes in the check to determine the checkbox state.
|
1018
|
-
*/
|
1019
|
-
this.ignoreDisabledDependents = true;
|
1020
|
-
/**
|
1021
|
-
* If the checkbox is a master checkbox (i.e. it has a dependentCheckboxesGroup),
|
1022
|
-
* indeterminate is true if there are some checked dependents and some unchecked dependents.
|
1023
|
-
*/
|
1024
|
-
this.indeterminate = false;
|
1025
|
-
//Used to prevent valueChanges loops in the master checkbox and dependent checkboxes value changes.
|
1026
|
-
this.ignoreCall = false;
|
1027
|
-
/** Fired whenever the dependent checkboxes are changed to clear out subscriptions to the previous dependents */
|
1028
|
-
this.resetDependentSubscriptions = new Subject();
|
1029
|
-
}
|
1030
|
-
ngAfterViewInit() {
|
1031
|
-
if (this.autofocus) {
|
1032
|
-
this.inputElement.nativeElement.focus();
|
1033
|
-
}
|
1015
|
+
class TooltipComponent {
|
1016
|
+
constructor() {
|
1017
|
+
this.position = 'top-center';
|
1018
|
+
this.dismissible = false;
|
1019
|
+
this.onHide = new EventEmitter();
|
1034
1020
|
}
|
1035
|
-
|
1036
|
-
|
1037
|
-
|
1038
|
-
}
|
1021
|
+
hide() {
|
1022
|
+
this.onHide.next();
|
1023
|
+
this.overlayRef?.dispose();
|
1039
1024
|
}
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1025
|
+
}
|
1026
|
+
TooltipComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TooltipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
1027
|
+
TooltipComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: TooltipComponent, selector: "ec-tooltip", host: { properties: { "style.--ec-tooltip-background-color": "this.backgroundColor", "style.--ec-tooltip-color-title": "this.titleColor" } }, ngImport: i0, template: "<article id=\"{{id}}\" class=\"py-3 position-{{position}}\" [class.show-arrow]=\"!hideArrow\">\r\n <header *ngIf=\"title || subtitle\" class=\"mb-3\">\r\n <h1 class=\"text-heading-2 px-3 mb-0\">{{title}}</h1>\r\n <p class=\"text-caption-1 px-3 mb-0\">{{subtitle}}</p>\r\n </header>\r\n\r\n <ng-container *ngIf=\"customContent; else textTemplate\">\r\n <ng-container *ngTemplateOutlet=\"customContent\"></ng-container>\r\n </ng-container>\r\n\r\n <ng-template #textTemplate>\r\n <div class=\"text-body-1 px-3\" [innerHTML]=\"text\"></div>\r\n </ng-template>\r\n\r\n <ec-button *ngIf=\"dismissible\" id=\"tooltipDismiss\" type=\"icon\" icon=\"icon-cancel\" (clicked)=\"hide()\"></ec-button>\r\n</article>\r\n", styles: [":host{display:block;padding:.75rem}article{background-color:var(--ec-tooltip-background-color, #162F3B);color:var(--ec-tooltip-color, var(--ec-color-primary-light));border-radius:var(--ec-border-radius-card);position:relative;box-shadow:var(--ec-box-shadow-overlay);--ec-color-link: var(--ec-color-link-light)}article.show-arrow:after{content:\"\";height:0;width:0;border:.625rem solid transparent;display:block;position:absolute;pointer-events:none}article.show-arrow.position-top-left:after,article.show-arrow.position-top-center:after,article.show-arrow.position-top-right:after{bottom:-1.25rem;border-top-color:var(--ec-tooltip-background-color, #162F3B)}article.show-arrow.position-bottom-left:after,article.show-arrow.position-bottom-center:after,article.show-arrow.position-bottom-right:after{top:-1.25rem;border-bottom-color:var(--ec-tooltip-background-color, #162F3B)}article.show-arrow.position-top-left:after,article.show-arrow.position-bottom-left:after{right:1rem}article.show-arrow.position-top-right:after,article.show-arrow.position-bottom-right:after{left:1rem}article.show-arrow.position-top-center:after,article.show-arrow.position-bottom-center:after{right:50%;transform:translate(50%)}article.show-arrow.position-right-top:after,article.show-arrow.position-right-center:after,article.show-arrow.position-right-bottom:after{left:-1.25rem;border-right-color:var(--ec-tooltip-background-color, #162F3B)}article.show-arrow.position-left-top:after,article.show-arrow.position-left-center:after,article.show-arrow.position-left-bottom:after{right:-1.25rem;border-left-color:var(--ec-tooltip-background-color, #162F3B)}article.show-arrow.position-left-top:after,article.show-arrow.position-right-top:after{top:1rem}article.show-arrow.position-left-bottom:after,article.show-arrow.position-right-bottom:after{bottom:1rem}article.show-arrow.position-left-center:after,article.show-arrow.position-right-center:after{bottom:50%;transform:translateY(50%)}.text-heading-2{color:var(--ec-tooltip-color-title, var(--ec-color-primary-light))}.text-body-1{color:var(--ec-color-primary-light)}.text-body-1 ::ng-deep p:last-child{margin-bottom:0}.text-body-1 ::ng-deep a{font-weight:var(--ec-font-weight-bold)}.text-caption-1{color:var(--ec-color-secondary-light)}ec-button{--ec-button-color-icon: var(--ec-color-secondary-light);--ec-button-color-icon-hover: var(--ec-color-primary-light);--ec-background-color-hover: rgba(255,255,255,.15);position:absolute;top:.25rem;right:.25rem}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ButtonComponent, selector: "ec-button", inputs: ["id", "disabled", "icon", "label", "badge", "tabindex", "type", "pending", "pendingIcon", "customTemplate", "isSubmit", "autofocus"], outputs: ["clicked"] }] });
|
1028
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TooltipComponent, decorators: [{
|
1029
|
+
type: Component,
|
1030
|
+
args: [{ selector: 'ec-tooltip', template: "<article id=\"{{id}}\" class=\"py-3 position-{{position}}\" [class.show-arrow]=\"!hideArrow\">\r\n <header *ngIf=\"title || subtitle\" class=\"mb-3\">\r\n <h1 class=\"text-heading-2 px-3 mb-0\">{{title}}</h1>\r\n <p class=\"text-caption-1 px-3 mb-0\">{{subtitle}}</p>\r\n </header>\r\n\r\n <ng-container *ngIf=\"customContent; else textTemplate\">\r\n <ng-container *ngTemplateOutlet=\"customContent\"></ng-container>\r\n </ng-container>\r\n\r\n <ng-template #textTemplate>\r\n <div class=\"text-body-1 px-3\" [innerHTML]=\"text\"></div>\r\n </ng-template>\r\n\r\n <ec-button *ngIf=\"dismissible\" id=\"tooltipDismiss\" type=\"icon\" icon=\"icon-cancel\" (clicked)=\"hide()\"></ec-button>\r\n</article>\r\n", styles: [":host{display:block;padding:.75rem}article{background-color:var(--ec-tooltip-background-color, #162F3B);color:var(--ec-tooltip-color, var(--ec-color-primary-light));border-radius:var(--ec-border-radius-card);position:relative;box-shadow:var(--ec-box-shadow-overlay);--ec-color-link: var(--ec-color-link-light)}article.show-arrow:after{content:\"\";height:0;width:0;border:.625rem solid transparent;display:block;position:absolute;pointer-events:none}article.show-arrow.position-top-left:after,article.show-arrow.position-top-center:after,article.show-arrow.position-top-right:after{bottom:-1.25rem;border-top-color:var(--ec-tooltip-background-color, #162F3B)}article.show-arrow.position-bottom-left:after,article.show-arrow.position-bottom-center:after,article.show-arrow.position-bottom-right:after{top:-1.25rem;border-bottom-color:var(--ec-tooltip-background-color, #162F3B)}article.show-arrow.position-top-left:after,article.show-arrow.position-bottom-left:after{right:1rem}article.show-arrow.position-top-right:after,article.show-arrow.position-bottom-right:after{left:1rem}article.show-arrow.position-top-center:after,article.show-arrow.position-bottom-center:after{right:50%;transform:translate(50%)}article.show-arrow.position-right-top:after,article.show-arrow.position-right-center:after,article.show-arrow.position-right-bottom:after{left:-1.25rem;border-right-color:var(--ec-tooltip-background-color, #162F3B)}article.show-arrow.position-left-top:after,article.show-arrow.position-left-center:after,article.show-arrow.position-left-bottom:after{right:-1.25rem;border-left-color:var(--ec-tooltip-background-color, #162F3B)}article.show-arrow.position-left-top:after,article.show-arrow.position-right-top:after{top:1rem}article.show-arrow.position-left-bottom:after,article.show-arrow.position-right-bottom:after{bottom:1rem}article.show-arrow.position-left-center:after,article.show-arrow.position-right-center:after{bottom:50%;transform:translateY(50%)}.text-heading-2{color:var(--ec-tooltip-color-title, var(--ec-color-primary-light))}.text-body-1{color:var(--ec-color-primary-light)}.text-body-1 ::ng-deep p:last-child{margin-bottom:0}.text-body-1 ::ng-deep a{font-weight:var(--ec-font-weight-bold)}.text-caption-1{color:var(--ec-color-secondary-light)}ec-button{--ec-button-color-icon: var(--ec-color-secondary-light);--ec-button-color-icon-hover: var(--ec-color-primary-light);--ec-background-color-hover: rgba(255,255,255,.15);position:absolute;top:.25rem;right:.25rem}\n"] }]
|
1031
|
+
}], propDecorators: { backgroundColor: [{
|
1032
|
+
type: HostBinding,
|
1033
|
+
args: ['style.--ec-tooltip-background-color']
|
1034
|
+
}], titleColor: [{
|
1035
|
+
type: HostBinding,
|
1036
|
+
args: ['style.--ec-tooltip-color-title']
|
1037
|
+
}] } });
|
1038
|
+
|
1039
|
+
class TooltipService {
|
1040
|
+
constructor(overlay) {
|
1041
|
+
this.overlay = overlay;
|
1042
|
+
this.positions = {
|
1043
|
+
'top-left': { originX: 'center', originY: 'top', overlayX: 'end', overlayY: 'bottom', offsetX: 38 },
|
1044
|
+
'top-center': { originX: 'center', originY: 'top', overlayX: 'center', overlayY: 'bottom' },
|
1045
|
+
'top-right': { originX: 'center', originY: 'top', overlayX: 'start', overlayY: 'bottom', offsetX: -38 },
|
1046
|
+
'bottom-left': { originX: 'center', originY: 'bottom', overlayX: 'end', overlayY: 'top', offsetX: 38 },
|
1047
|
+
'bottom-center': { originX: 'center', originY: 'bottom', overlayX: 'center', overlayY: 'top' },
|
1048
|
+
'bottom-right': { originX: 'center', originY: 'bottom', overlayX: 'start', overlayY: 'top', offsetX: -38 },
|
1049
|
+
'left-top': { originX: 'start', originY: 'center', overlayX: 'end', overlayY: 'top', offsetY: -38 },
|
1050
|
+
'left-center': { originX: 'start', originY: 'center', overlayX: 'end', overlayY: 'center' },
|
1051
|
+
'left-bottom': { originX: 'start', originY: 'center', overlayX: 'end', overlayY: 'bottom', offsetY: 38 },
|
1052
|
+
'right-top': { originX: 'end', originY: 'center', overlayX: 'start', overlayY: 'top', offsetY: -38 },
|
1053
|
+
'right-center': { originX: 'end', originY: 'center', overlayX: 'start', overlayY: 'center' },
|
1054
|
+
'right-bottom': { originX: 'end', originY: 'center', overlayX: 'start', overlayY: 'bottom', offsetY: 38 }
|
1055
|
+
};
|
1044
1056
|
}
|
1045
1057
|
/**
|
1046
|
-
*
|
1047
|
-
* Dependents can update the master when their values change and the master updates dependents when the value changes.
|
1058
|
+
* Show a tooltip attached to a specified element
|
1048
1059
|
*/
|
1049
|
-
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
}
|
1067
|
-
});
|
1068
|
-
this.indeterminate = false;
|
1069
|
-
this.ignoreCall = false;
|
1070
|
-
}
|
1071
|
-
});
|
1072
|
-
//When a dependent value changes, we need to reevaluate the master state.
|
1073
|
-
//We are subscribing to the form models directly instead of the entire group because we found that adding checkboxes to
|
1074
|
-
// more than one form group causes only the last group to emit valueChanges events.
|
1075
|
-
//That prevented combined row-master and table-master setups from working properly.
|
1076
|
-
dependentCheckboxes.forEach(checkbox => {
|
1077
|
-
checkbox.valueChanges.pipe(distinctUntilChanged(), takeUntil(merge(this.componentDestroyed, this.resetDependentSubscriptions))).subscribe((value) => {
|
1078
|
-
if (value !== true && value !== false) {
|
1079
|
-
console.error(`The value ${value} is not true or false, which are the only supported values for FormControls in the dependentCheckboxesGroup`);
|
1080
|
-
return;
|
1081
|
-
}
|
1082
|
-
if (!this.ignoreCall) {
|
1083
|
-
this.ignoreCall = true; //Ignore any value changes calls on the master to prevent a loop.
|
1084
|
-
this.updateMasterState(dependentCheckboxes);
|
1085
|
-
this.ignoreCall = false;
|
1086
|
-
}
|
1087
|
-
});
|
1088
|
-
});
|
1060
|
+
show(anchor, position = 'top-center', options) {
|
1061
|
+
const overlayConfig = this.getOverlayConfig(anchor, this.positions[position], options?.width, options?.maxWidth);
|
1062
|
+
const overlayRef = this.overlay.create(overlayConfig);
|
1063
|
+
const contentPortal = new ComponentPortal(TooltipComponent);
|
1064
|
+
const contentViewRef = overlayRef.attach(contentPortal);
|
1065
|
+
contentViewRef.instance.position = position;
|
1066
|
+
contentViewRef.instance.id = options?.id;
|
1067
|
+
contentViewRef.instance.title = options?.title;
|
1068
|
+
contentViewRef.instance.subtitle = options?.subtitle;
|
1069
|
+
contentViewRef.instance.text = options?.text;
|
1070
|
+
contentViewRef.instance.customContent = options?.customContent;
|
1071
|
+
contentViewRef.instance.dismissible = options?.dismissible || false;
|
1072
|
+
contentViewRef.instance.backgroundColor = options?.backgroundColor;
|
1073
|
+
contentViewRef.instance.titleColor = options?.titleColor;
|
1074
|
+
contentViewRef.instance.hideArrow = options?.hideArrow;
|
1075
|
+
contentViewRef.instance.overlayRef = overlayRef;
|
1076
|
+
return contentViewRef.instance;
|
1089
1077
|
}
|
1090
|
-
|
1091
|
-
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1096
|
-
|
1097
|
-
|
1098
|
-
|
1099
|
-
if (this.ignoreDisabledDependents) {
|
1100
|
-
dependentsToCheck = dependentCheckboxes.filter(checkbox => checkbox.enabled);
|
1101
|
-
}
|
1102
|
-
else {
|
1103
|
-
dependentsToCheck = dependentCheckboxes;
|
1104
|
-
}
|
1105
|
-
let isTrue = (checkbox) => { return checkbox.value === true; };
|
1106
|
-
if (dependentsToCheck.every(isTrue)) {
|
1107
|
-
this.formModel.setValue(true);
|
1108
|
-
this.indeterminate = false;
|
1109
|
-
}
|
1110
|
-
else if (dependentsToCheck.some(isTrue)) {
|
1111
|
-
this.formModel.setValue(false);
|
1112
|
-
this.indeterminate = true;
|
1113
|
-
}
|
1114
|
-
else {
|
1115
|
-
this.formModel.setValue(false);
|
1116
|
-
this.indeterminate = false;
|
1078
|
+
onMove(event, contentRect) {
|
1079
|
+
let callCallback = false;
|
1080
|
+
if (contentRect) {
|
1081
|
+
if (event.clientX > contentRect.right
|
1082
|
+
|| event.clientX < contentRect.left
|
1083
|
+
|| event.clientY > contentRect.bottom
|
1084
|
+
|| event.clientY < contentRect.top) {
|
1085
|
+
callCallback = true;
|
1086
|
+
}
|
1117
1087
|
}
|
1088
|
+
return callCallback;
|
1089
|
+
}
|
1090
|
+
getOverlayConfig(element, position, width, maxWidth) {
|
1091
|
+
const positionStrategy = this.overlay.position()
|
1092
|
+
.flexibleConnectedTo(element)
|
1093
|
+
.withPositions([position]);
|
1094
|
+
const config = new OverlayConfig({
|
1095
|
+
positionStrategy: positionStrategy,
|
1096
|
+
width: width,
|
1097
|
+
maxWidth: maxWidth
|
1098
|
+
});
|
1099
|
+
return config;
|
1118
1100
|
}
|
1119
1101
|
}
|
1120
|
-
|
1121
|
-
|
1122
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type:
|
1123
|
-
type:
|
1124
|
-
args: [{
|
1125
|
-
|
1126
|
-
|
1127
|
-
|
1128
|
-
type: Input
|
1129
|
-
}], ignoreDisabledDependents: [{
|
1130
|
-
type: Input
|
1131
|
-
}], inputElement: [{
|
1132
|
-
type: ViewChild,
|
1133
|
-
args: ['checkboxInput', { static: true }]
|
1134
|
-
}] } });
|
1102
|
+
TooltipService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TooltipService, deps: [{ token: i1$1.Overlay }], target: i0.ɵɵFactoryTarget.Injectable });
|
1103
|
+
TooltipService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TooltipService, providedIn: 'root' });
|
1104
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TooltipService, decorators: [{
|
1105
|
+
type: Injectable,
|
1106
|
+
args: [{
|
1107
|
+
providedIn: 'root'
|
1108
|
+
}]
|
1109
|
+
}], ctorParameters: function () { return [{ type: i1$1.Overlay }]; } });
|
1135
1110
|
|
1136
|
-
class
|
1111
|
+
class TagsComponent {
|
1137
1112
|
constructor() {
|
1113
|
+
/**The ID of this set of tags */
|
1114
|
+
this.id = '';
|
1138
1115
|
/**
|
1139
|
-
*
|
1140
|
-
*
|
1116
|
+
* Determines whether the tags will wrap or not
|
1117
|
+
*
|
1118
|
+
* @type {boolean}
|
1119
|
+
* @memberof TagsComponent
|
1141
1120
|
*/
|
1142
|
-
this.
|
1121
|
+
this.wrap = true;
|
1143
1122
|
/**
|
1144
|
-
*
|
1123
|
+
* Displays the tags in condensed mode
|
1145
1124
|
*/
|
1146
|
-
this.
|
1125
|
+
this.isCondensed = false;
|
1126
|
+
/**
|
1127
|
+
* Emits the tag item when the tag's close button is clicked
|
1128
|
+
*/
|
1129
|
+
this.tagClosed = new EventEmitter();
|
1130
|
+
/**
|
1131
|
+
* Tags to be displayed
|
1132
|
+
*
|
1133
|
+
* @type {Tag[]}
|
1134
|
+
* @memberof TagsComponent
|
1135
|
+
*/
|
1136
|
+
this.tagsArray = [];
|
1147
1137
|
}
|
1148
1138
|
/**
|
1149
|
-
*
|
1139
|
+
* Angular onChanges lifecycle hook
|
1140
|
+
* @see {@link https://angular.io/guide/lifecycle-hooks | Life-cycle hooks}
|
1141
|
+
*
|
1142
|
+
* @param {SimpleChanges} changes
|
1143
|
+
* @memberof TagsComponent
|
1150
1144
|
*/
|
1151
|
-
|
1152
|
-
|
1153
|
-
|
1154
|
-
|
1155
|
-
|
1156
|
-
|
1157
|
-
|
1158
|
-
|
1159
|
-
|
1160
|
-
|
1161
|
-
|
1162
|
-
|
1163
|
-
|
1164
|
-
|
1165
|
-
}
|
1166
|
-
|
1145
|
+
ngOnChanges(changes) {
|
1146
|
+
if (changes.tags) {
|
1147
|
+
if (this.tags) {
|
1148
|
+
// If only given a single item, put it in an array so it works in the template
|
1149
|
+
if (Array.isArray(this.tags)) {
|
1150
|
+
this.tagsArray = this.tags;
|
1151
|
+
}
|
1152
|
+
else {
|
1153
|
+
this.tagsArray = [this.tags];
|
1154
|
+
}
|
1155
|
+
}
|
1156
|
+
else {
|
1157
|
+
// reset array if tags becomes undefined
|
1158
|
+
this.tagsArray = [];
|
1159
|
+
}
|
1160
|
+
}
|
1161
|
+
}
|
1162
|
+
closeTag(tag) {
|
1163
|
+
this.tagsArray = this.tagsArray.filter(t => t !== tag);
|
1164
|
+
this.tagClosed.emit(tag);
|
1165
|
+
}
|
1166
|
+
}
|
1167
|
+
TagsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TagsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
1168
|
+
TagsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: TagsComponent, selector: "ec-tags", inputs: { id: "id", tags: "tags", wrap: "wrap", isCondensed: "isCondensed" }, outputs: { tagClosed: "tagClosed" }, usesOnChanges: true, ngImport: i0, template: "<ul class=\"tags\"\r\n [class.is-wrapped]=\"wrap\">\r\n <li *ngFor=\"let tag of tagsArray; index as i\"\r\n id=\"{{id}}_tag_{{i}}\"\r\n class=\"tag is-{{tag.type}} {{tag.classList}} mr-1\"\r\n [ngClass]=\"{'text-caption-1': !isCondensed, 'text-caption-2': isCondensed, 'is-condensed': isCondensed, 'pr-0': tag.isDismissable, 'is-link': tag.url}\"\r\n title=\"{{tag.tooltip | translate}}\">\r\n <i *ngIf=\"tag.icon\"\r\n class=\"ec-icon {{tag.icon}} ec-icon-sm\"></i>\r\n <span *ngIf=\"!tag.url\">{{tag.label | translate}}</span>\r\n\r\n <a *ngIf=\"tag.url\"\r\n id=\"{{id}}_tag_{{i}}_link\"\r\n class=\"font-weight-bold\"\r\n href=\"{{tag.url}}\"\r\n target=\"{{tag.target}}\">{{tag.label | translate}}</a>\r\n\r\n <button id=\"{{id}}_tag_{{i}}_dismissButton\"\r\n *ngIf=\"tag.isDismissable\"\r\n (click)=\"closeTag(tag)\">\r\n <i class=\"ec-icon ec-icon-sm icon-cancel\"></i>\r\n </button>\r\n </li>\r\n</ul>", styles: ["@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}:host{display:block}.tags{padding:0;margin:0;list-style:none;display:flex}.tags.is-wrapped{flex-wrap:wrap;margin-top:.25rem}.tags.is-wrapped>.tag{margin-bottom:.25rem}.tag{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background-color:var(--ec-color-gray-1);border:2px solid var(--ec-color-gray-4);display:inline-flex;align-items:center;border-radius:calc(var(--ec-border-radius, .25rem) * 3);height:1.5rem;line-height:1.25rem;padding:0 .4375rem;vertical-align:top}.tag>.ec-icon:first-child{margin-right:.1875rem}.tag .ec-icon{display:flex;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;width:auto;height:auto;min-width:1em;justify-content:center}.tag.is-inverted{background-color:var(--ec-background-color);border-color:var(--ec-background-color)}.tag.is-info{background-color:var(--ec-color-cobalt-1);border-color:var(--ec-color-info)}.tag.is-info>.ec-icon:first-child{color:var(--ec-color-info)}.tag.is-success{background-color:var(--ec-color-green-1);border-color:var(--ec-color-success)}.tag.is-success>.ec-icon:first-child{color:var(--ec-color-success)}.tag.is-warning{background-color:var(--ec-color-yellow-1);border-color:var(--ec-color-caution)}.tag.is-warning>.ec-icon:first-child{color:var(--ec-color-caution)}.tag.is-danger{background-color:var(--ec-color-red-1);border-color:var(--ec-color-danger)}.tag.is-danger>.ec-icon:first-child{color:var(--ec-color-danger)}.tag.is-accent{background-color:var(--ec-color-purple-1);border-color:var(--ec-color-accent)}.tag.is-accent>.ec-icon:first-child{color:var(--ec-color-accent)}.tag.is-chargeback{background-color:var(--ec-color-orange-1);border-color:var(--ec-color-orange-7)}.tag.is-chargeback>.ec-icon:first-child{color:var(--ec-color-orange-7)}.tag.is-accrual{background-color:var(--ec-color-aqua-1);border-color:var(--ec-color-aqua-5)}.tag.is-accrual>.ec-icon:first-child{color:var(--ec-color-aqua-5)}.tag.is-system{background-color:var(--ec-color-gray-1);border-color:var(--ec-color-gray-4)}.tag.is-system>.ec-icon:first-child{color:var(--ec-color-gray-4)}button{background-color:transparent;border:0;display:flex;align-items:center;padding:0 .25rem;height:100%;cursor:pointer;position:relative}button:hover,button:focus{outline:none}button:hover:before,button:focus:before{display:block;content:\"\";position:absolute;inset:.0625rem .125rem;background-color:#1a1a231a;border-radius:.125rem}.is-condensed{border-radius:var(--ec-border-radius);border-width:1px;padding:0 .25rem;height:1.125rem;line-height:1.125rem;min-width:1.125rem;justify-content:center}.is-condensed>.ec-icon:first-child{margin-right:.125rem}.is-link a:after{opacity:1;margin-left:.1875rem}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] });
|
1169
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TagsComponent, decorators: [{
|
1170
|
+
type: Component,
|
1171
|
+
args: [{ selector: 'ec-tags', template: "<ul class=\"tags\"\r\n [class.is-wrapped]=\"wrap\">\r\n <li *ngFor=\"let tag of tagsArray; index as i\"\r\n id=\"{{id}}_tag_{{i}}\"\r\n class=\"tag is-{{tag.type}} {{tag.classList}} mr-1\"\r\n [ngClass]=\"{'text-caption-1': !isCondensed, 'text-caption-2': isCondensed, 'is-condensed': isCondensed, 'pr-0': tag.isDismissable, 'is-link': tag.url}\"\r\n title=\"{{tag.tooltip | translate}}\">\r\n <i *ngIf=\"tag.icon\"\r\n class=\"ec-icon {{tag.icon}} ec-icon-sm\"></i>\r\n <span *ngIf=\"!tag.url\">{{tag.label | translate}}</span>\r\n\r\n <a *ngIf=\"tag.url\"\r\n id=\"{{id}}_tag_{{i}}_link\"\r\n class=\"font-weight-bold\"\r\n href=\"{{tag.url}}\"\r\n target=\"{{tag.target}}\">{{tag.label | translate}}</a>\r\n\r\n <button id=\"{{id}}_tag_{{i}}_dismissButton\"\r\n *ngIf=\"tag.isDismissable\"\r\n (click)=\"closeTag(tag)\">\r\n <i class=\"ec-icon ec-icon-sm icon-cancel\"></i>\r\n </button>\r\n </li>\r\n</ul>", styles: ["@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}:host{display:block}.tags{padding:0;margin:0;list-style:none;display:flex}.tags.is-wrapped{flex-wrap:wrap;margin-top:.25rem}.tags.is-wrapped>.tag{margin-bottom:.25rem}.tag{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background-color:var(--ec-color-gray-1);border:2px solid var(--ec-color-gray-4);display:inline-flex;align-items:center;border-radius:calc(var(--ec-border-radius, .25rem) * 3);height:1.5rem;line-height:1.25rem;padding:0 .4375rem;vertical-align:top}.tag>.ec-icon:first-child{margin-right:.1875rem}.tag .ec-icon{display:flex;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;width:auto;height:auto;min-width:1em;justify-content:center}.tag.is-inverted{background-color:var(--ec-background-color);border-color:var(--ec-background-color)}.tag.is-info{background-color:var(--ec-color-cobalt-1);border-color:var(--ec-color-info)}.tag.is-info>.ec-icon:first-child{color:var(--ec-color-info)}.tag.is-success{background-color:var(--ec-color-green-1);border-color:var(--ec-color-success)}.tag.is-success>.ec-icon:first-child{color:var(--ec-color-success)}.tag.is-warning{background-color:var(--ec-color-yellow-1);border-color:var(--ec-color-caution)}.tag.is-warning>.ec-icon:first-child{color:var(--ec-color-caution)}.tag.is-danger{background-color:var(--ec-color-red-1);border-color:var(--ec-color-danger)}.tag.is-danger>.ec-icon:first-child{color:var(--ec-color-danger)}.tag.is-accent{background-color:var(--ec-color-purple-1);border-color:var(--ec-color-accent)}.tag.is-accent>.ec-icon:first-child{color:var(--ec-color-accent)}.tag.is-chargeback{background-color:var(--ec-color-orange-1);border-color:var(--ec-color-orange-7)}.tag.is-chargeback>.ec-icon:first-child{color:var(--ec-color-orange-7)}.tag.is-accrual{background-color:var(--ec-color-aqua-1);border-color:var(--ec-color-aqua-5)}.tag.is-accrual>.ec-icon:first-child{color:var(--ec-color-aqua-5)}.tag.is-system{background-color:var(--ec-color-gray-1);border-color:var(--ec-color-gray-4)}.tag.is-system>.ec-icon:first-child{color:var(--ec-color-gray-4)}button{background-color:transparent;border:0;display:flex;align-items:center;padding:0 .25rem;height:100%;cursor:pointer;position:relative}button:hover,button:focus{outline:none}button:hover:before,button:focus:before{display:block;content:\"\";position:absolute;inset:.0625rem .125rem;background-color:#1a1a231a;border-radius:.125rem}.is-condensed{border-radius:var(--ec-border-radius);border-width:1px;padding:0 .25rem;height:1.125rem;line-height:1.125rem;min-width:1.125rem;justify-content:center}.is-condensed>.ec-icon:first-child{margin-right:.125rem}.is-link a:after{opacity:1;margin-left:.1875rem}\n"] }]
|
1172
|
+
}], ctorParameters: function () { return []; }, propDecorators: { id: [{
|
1173
|
+
type: Input
|
1174
|
+
}], tags: [{
|
1175
|
+
type: Input
|
1176
|
+
}], wrap: [{
|
1177
|
+
type: Input
|
1178
|
+
}], isCondensed: [{
|
1179
|
+
type: Input
|
1180
|
+
}], tagClosed: [{
|
1181
|
+
type: Output
|
1182
|
+
}] } });
|
1183
|
+
|
1184
|
+
class PopoverComponent {
|
1185
|
+
constructor(overlay, viewContainerRef, elementRef, tooltipService) {
|
1186
|
+
this.overlay = overlay;
|
1187
|
+
this.viewContainerRef = viewContainerRef;
|
1188
|
+
this.elementRef = elementRef;
|
1189
|
+
this.tooltipService = tooltipService;
|
1190
|
+
/** An optional icon that, if provided, enables the popover to use it as the anchor element */
|
1191
|
+
this.icon = '';
|
1192
|
+
this.contentPosition = 'top-left';
|
1193
|
+
this.iconHoverClass = '';
|
1194
|
+
this.isVisible = false;
|
1195
|
+
this.mouseOver = new Subject();
|
1196
|
+
this.interrupt = new Subject();
|
1197
|
+
}
|
1198
|
+
/** When the popover initializes, if a new tagType is provided for the hover state of the popover,
|
1199
|
+
* we use it to update the type of our "hoverTag" (which controls background-color of tag)
|
1200
|
+
*/
|
1201
|
+
ngOnInit() {
|
1202
|
+
if (this.tag && this.tagHoverType) {
|
1203
|
+
this.hoverTag = { ...this.tag, type: this.tagHoverType };
|
1204
|
+
}
|
1205
|
+
this.mouseOver
|
1206
|
+
.pipe(switchMap(v => of(v).pipe(delay(300), takeUntil(this.interrupt))))
|
1207
|
+
.subscribe(() => this.show());
|
1208
|
+
}
|
1209
|
+
ngOnDestroy() {
|
1210
|
+
this.hide();
|
1211
|
+
}
|
1212
|
+
show() {
|
1213
|
+
if (!this.isVisible) {
|
1214
|
+
const overlayConfig = this.getOverlayConfig();
|
1215
|
+
this.overlayRef = this.overlay.create(overlayConfig);
|
1216
|
+
const contentPortal = new TemplatePortal(this.content, this.viewContainerRef);
|
1217
|
+
this.contentViewRef = this.overlayRef.attach(contentPortal);
|
1218
|
+
this.isVisible = true;
|
1219
|
+
}
|
1220
|
+
}
|
1221
|
+
onMouseOver() {
|
1222
|
+
this.mouseOver.next();
|
1223
|
+
}
|
1224
|
+
onLeave() {
|
1225
|
+
this.interrupt.next();
|
1226
|
+
}
|
1227
|
+
/**
|
1228
|
+
* Hides the popover if the mouse moves outside of the popover content
|
1229
|
+
*/
|
1230
|
+
onMouseMove(event) {
|
1231
|
+
let callCallback = false;
|
1232
|
+
if (!this.contentRect) {
|
1233
|
+
this.contentRect = this.contentViewRef?.rootNodes[0].getBoundingClientRect();
|
1234
|
+
}
|
1235
|
+
if (this.contentRect) {
|
1236
|
+
callCallback = this.tooltipService.onMove(event, this.contentRect);
|
1237
|
+
}
|
1238
|
+
if (callCallback) {
|
1239
|
+
this.hide();
|
1240
|
+
}
|
1241
|
+
}
|
1242
|
+
hide() {
|
1243
|
+
this.interrupt.next();
|
1244
|
+
this.overlayRef?.dispose();
|
1245
|
+
this.isVisible = false;
|
1246
|
+
this.contentRect = undefined;
|
1247
|
+
}
|
1248
|
+
getOverlayConfig() {
|
1249
|
+
const position = this.getPosition();
|
1250
|
+
const positionStrategy = this.overlay.position()
|
1251
|
+
.flexibleConnectedTo(this.elementRef)
|
1252
|
+
.withPositions([position]);
|
1253
|
+
const config = new OverlayConfig({
|
1254
|
+
positionStrategy: positionStrategy
|
1255
|
+
});
|
1256
|
+
return config;
|
1257
|
+
}
|
1258
|
+
getPosition() {
|
1259
|
+
const position = this.contentPosition.split('-');
|
1260
|
+
const overlayX = (position[1] == 'left' ? 'start' : 'end');
|
1261
|
+
const overlayY = position[0];
|
1262
|
+
return { originX: overlayX, originY: overlayY, overlayX: overlayX, overlayY: overlayY };
|
1263
|
+
}
|
1264
|
+
}
|
1265
|
+
PopoverComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PopoverComponent, deps: [{ token: i1$1.Overlay }, { token: i0.ViewContainerRef }, { token: i0.ElementRef }, { token: TooltipService }], target: i0.ɵɵFactoryTarget.Component });
|
1266
|
+
PopoverComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: PopoverComponent, selector: "ec-popover", inputs: { icon: "icon", tag: "tag", tagHoverType: "tagHoverType", contentPosition: "contentPosition", iconHoverClass: "iconHoverClass" }, host: { listeners: { "mouseover": "onMouseOver()", "mouseleave": "onLeave()" } }, viewQueries: [{ propertyName: "content", first: true, predicate: ["content"], descendants: true }], ngImport: i0, template: "<!-- Before hover state -->\r\n<div class=\"p-2\">\r\n <i *ngIf=\"!tag\" class=\"ec-icon {{icon}} ec-icon-sm\"></i>\r\n <ec-tags *ngIf=\"tag\"\r\n [isCondensed] = \"true\"\r\n [tags]=\"tag\">\r\n </ec-tags>\r\n</div>\r\n<!-- ./Before hover state -->\r\n\r\n<!-- Hover state -->\r\n<ng-template #content>\r\n <article class=\"popover-content\"\r\n (document:mousemove)=\"onMouseMove($event)\">\r\n <ng-content></ng-content>\r\n </article>\r\n <div class=\"p-2 {{contentPosition}}\">\r\n <i *ngIf=\"!tag\" class=\"ec-icon {{icon}} ec-icon-sm {{iconHoverClass}}\"></i>\r\n <ec-tags *ngIf=\"tag\"\r\n [isCondensed]=\"true\"\r\n [tags]=\"hoverTag\">\r\n </ec-tags>\r\n </div>\r\n</ng-template>\r\n<!-- ./Hover state -->\r\n", styles: [":host{line-height:.75rem;display:inline-block}.popover-content{border-radius:var(--ec-border-radius);box-shadow:0 3px 6px #1a1a231f;overflow:hidden;position:relative}.popover-content+div{position:absolute;line-height:.75rem}.popover-content+div.top-left{top:0;left:0}.popover-content+div.top-right{top:0;right:0}.popover-content+div.bottom-right{bottom:0;right:0}.popover-content+div.bottom-left{bottom:0;left:0}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: TagsComponent, selector: "ec-tags", inputs: ["id", "tags", "wrap", "isCondensed"], outputs: ["tagClosed"] }] });
|
1267
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PopoverComponent, decorators: [{
|
1268
|
+
type: Component,
|
1269
|
+
args: [{ selector: 'ec-popover', template: "<!-- Before hover state -->\r\n<div class=\"p-2\">\r\n <i *ngIf=\"!tag\" class=\"ec-icon {{icon}} ec-icon-sm\"></i>\r\n <ec-tags *ngIf=\"tag\"\r\n [isCondensed] = \"true\"\r\n [tags]=\"tag\">\r\n </ec-tags>\r\n</div>\r\n<!-- ./Before hover state -->\r\n\r\n<!-- Hover state -->\r\n<ng-template #content>\r\n <article class=\"popover-content\"\r\n (document:mousemove)=\"onMouseMove($event)\">\r\n <ng-content></ng-content>\r\n </article>\r\n <div class=\"p-2 {{contentPosition}}\">\r\n <i *ngIf=\"!tag\" class=\"ec-icon {{icon}} ec-icon-sm {{iconHoverClass}}\"></i>\r\n <ec-tags *ngIf=\"tag\"\r\n [isCondensed]=\"true\"\r\n [tags]=\"hoverTag\">\r\n </ec-tags>\r\n </div>\r\n</ng-template>\r\n<!-- ./Hover state -->\r\n", styles: [":host{line-height:.75rem;display:inline-block}.popover-content{border-radius:var(--ec-border-radius);box-shadow:0 3px 6px #1a1a231f;overflow:hidden;position:relative}.popover-content+div{position:absolute;line-height:.75rem}.popover-content+div.top-left{top:0;left:0}.popover-content+div.top-right{top:0;right:0}.popover-content+div.bottom-right{bottom:0;right:0}.popover-content+div.bottom-left{bottom:0;left:0}\n"] }]
|
1270
|
+
}], ctorParameters: function () { return [{ type: i1$1.Overlay }, { type: i0.ViewContainerRef }, { type: i0.ElementRef }, { type: TooltipService }]; }, propDecorators: { icon: [{
|
1271
|
+
type: Input
|
1272
|
+
}], tag: [{
|
1273
|
+
type: Input
|
1274
|
+
}], tagHoverType: [{
|
1275
|
+
type: Input
|
1276
|
+
}], contentPosition: [{
|
1277
|
+
type: Input
|
1278
|
+
}], iconHoverClass: [{
|
1279
|
+
type: Input
|
1280
|
+
}], content: [{
|
1281
|
+
type: ViewChild,
|
1282
|
+
args: ['content']
|
1283
|
+
}], onMouseOver: [{
|
1284
|
+
type: HostListener,
|
1285
|
+
args: ['mouseover']
|
1286
|
+
}], onLeave: [{
|
1287
|
+
type: HostListener,
|
1288
|
+
args: ['mouseleave']
|
1289
|
+
}] } });
|
1290
|
+
|
1291
|
+
class HelpPopoverComponent {
|
1292
|
+
constructor() {
|
1293
|
+
this.id = '';
|
1294
|
+
this.text = '';
|
1295
|
+
this.contentPosition = 'top-left';
|
1296
|
+
this.maxWidth = '15rem';
|
1297
|
+
}
|
1298
|
+
}
|
1299
|
+
HelpPopoverComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: HelpPopoverComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
1300
|
+
HelpPopoverComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: HelpPopoverComponent, selector: "ec-help-popover", inputs: { id: "id", text: "text", contentPosition: "contentPosition", maxWidth: "maxWidth" }, host: { properties: { "attr.id": "this.id" } }, ngImport: i0, template: "<ec-popover id=\"{{id}}_popover\"\r\n icon=\"icon-help-circle\"\r\n [contentPosition]=\"contentPosition\"\r\n iconHoverClass=\"font-color-primary-light\">\r\n <div id=\"{{id}}_popoverContent\"\r\n class=\"help-popover-content text-body-1\"\r\n [class.is-right]=\"contentPosition == 'top-right' || contentPosition == 'bottom-right'\"\r\n [style.max-width]=\"maxWidth\">\r\n <div *ngIf=\"text\"\r\n [innerHTML]=\"text | translate\"></div>\r\n <ng-content></ng-content>\r\n </div>\r\n</ec-popover>", styles: [".help-popover-content{--ec-color-link: var(--ec-color-link-light);background-color:#162f3b;color:var(--ec-color-primary-light);padding:.375rem .5rem .375rem 1.75rem}.help-popover-content.is-right{padding:.375rem 1.75rem .375rem .5rem}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: PopoverComponent, selector: "ec-popover", inputs: ["icon", "tag", "tagHoverType", "contentPosition", "iconHoverClass"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] });
|
1301
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: HelpPopoverComponent, decorators: [{
|
1302
|
+
type: Component,
|
1303
|
+
args: [{ selector: 'ec-help-popover', template: "<ec-popover id=\"{{id}}_popover\"\r\n icon=\"icon-help-circle\"\r\n [contentPosition]=\"contentPosition\"\r\n iconHoverClass=\"font-color-primary-light\">\r\n <div id=\"{{id}}_popoverContent\"\r\n class=\"help-popover-content text-body-1\"\r\n [class.is-right]=\"contentPosition == 'top-right' || contentPosition == 'bottom-right'\"\r\n [style.max-width]=\"maxWidth\">\r\n <div *ngIf=\"text\"\r\n [innerHTML]=\"text | translate\"></div>\r\n <ng-content></ng-content>\r\n </div>\r\n</ec-popover>", styles: [".help-popover-content{--ec-color-link: var(--ec-color-link-light);background-color:#162f3b;color:var(--ec-color-primary-light);padding:.375rem .5rem .375rem 1.75rem}.help-popover-content.is-right{padding:.375rem 1.75rem .375rem .5rem}\n"] }]
|
1304
|
+
}], ctorParameters: function () { return []; }, propDecorators: { id: [{
|
1305
|
+
type: Input
|
1306
|
+
}, {
|
1307
|
+
type: HostBinding,
|
1308
|
+
args: ['attr.id']
|
1309
|
+
}], text: [{
|
1310
|
+
type: Input
|
1311
|
+
}], contentPosition: [{
|
1312
|
+
type: Input
|
1313
|
+
}], maxWidth: [{
|
1314
|
+
type: Input
|
1315
|
+
}] } });
|
1316
|
+
|
1317
|
+
class CheckboxComponent extends FormControlBase {
|
1318
|
+
constructor(validationMessageService, formGroupHelper) {
|
1319
|
+
super(validationMessageService, formGroupHelper);
|
1320
|
+
this.validationMessageService = validationMessageService;
|
1321
|
+
this.formGroupHelper = formGroupHelper;
|
1322
|
+
/**
|
1323
|
+
* The name of the checkbox input element
|
1324
|
+
*/
|
1325
|
+
this.name = '';
|
1326
|
+
/**
|
1327
|
+
* Determines whether to ignore or include disabled dependent checkboxes in the check to determine the checkbox state.
|
1328
|
+
*/
|
1329
|
+
this.ignoreDisabledDependents = true;
|
1330
|
+
/**
|
1331
|
+
* If the checkbox is a master checkbox (i.e. it has a dependentCheckboxesGroup),
|
1332
|
+
* indeterminate is true if there are some checked dependents and some unchecked dependents.
|
1333
|
+
*/
|
1334
|
+
this.indeterminate = false;
|
1335
|
+
//Used to prevent valueChanges loops in the master checkbox and dependent checkboxes value changes.
|
1336
|
+
this.ignoreCall = false;
|
1337
|
+
/** Fired whenever the dependent checkboxes are changed to clear out subscriptions to the previous dependents */
|
1338
|
+
this.resetDependentSubscriptions = new Subject();
|
1339
|
+
}
|
1340
|
+
ngAfterViewInit() {
|
1341
|
+
if (this.autofocus) {
|
1342
|
+
this.inputElement.nativeElement.focus();
|
1343
|
+
}
|
1344
|
+
}
|
1345
|
+
ngOnChanges(changes) {
|
1346
|
+
if (changes.dependentCheckboxesGroup) {
|
1347
|
+
this.setupDependents();
|
1348
|
+
}
|
1349
|
+
}
|
1350
|
+
dispatchEvent(event) {
|
1351
|
+
if (event.type === 'click' && !this.formModel.disabled) {
|
1352
|
+
this.formModel.patchValue(!this.formModel.value);
|
1353
|
+
}
|
1354
|
+
}
|
1355
|
+
/**
|
1356
|
+
* Create watchers that allow the master and dependent checkbox states to stay in sync as the user interacts with them.
|
1357
|
+
* Dependents can update the master when their values change and the master updates dependents when the value changes.
|
1358
|
+
*/
|
1359
|
+
setupDependents() {
|
1360
|
+
if (!this.dependentCheckboxesGroup) {
|
1361
|
+
return;
|
1362
|
+
}
|
1363
|
+
// Remove any subscriptions to previous dependents
|
1364
|
+
this.resetDependentSubscriptions.next();
|
1365
|
+
//Extract the values (i.e. the checkboxes) from the FormGroup controls key-value map and return them.
|
1366
|
+
let dependentCheckboxes = Object.values(this.dependentCheckboxesGroup.controls);
|
1367
|
+
this.updateMasterState(dependentCheckboxes);
|
1368
|
+
//When the master value changes, we set all its dependents to that value.
|
1369
|
+
//We also set indeterminate to false since we know that all dependents will either be checked or unchecked.
|
1370
|
+
this.formModel.valueChanges.pipe(distinctUntilChanged(), takeUntil(merge(this.componentDestroyed, this.resetDependentSubscriptions))).subscribe((value) => {
|
1371
|
+
if (!this.ignoreCall) {
|
1372
|
+
this.ignoreCall = true; //Ignore any value changes calls on the dependents to prevent a loop.
|
1373
|
+
dependentCheckboxes.forEach(checkbox => {
|
1374
|
+
if (!checkbox.disabled || !this.ignoreDisabledDependents) {
|
1375
|
+
checkbox.setValue(value);
|
1376
|
+
}
|
1377
|
+
});
|
1378
|
+
this.indeterminate = false;
|
1379
|
+
this.ignoreCall = false;
|
1380
|
+
}
|
1381
|
+
});
|
1382
|
+
//When a dependent value changes, we need to reevaluate the master state.
|
1383
|
+
//We are subscribing to the form models directly instead of the entire group because we found that adding checkboxes to
|
1384
|
+
// more than one form group causes only the last group to emit valueChanges events.
|
1385
|
+
//That prevented combined row-master and table-master setups from working properly.
|
1386
|
+
dependentCheckboxes.forEach(checkbox => {
|
1387
|
+
checkbox.valueChanges.pipe(distinctUntilChanged(), takeUntil(merge(this.componentDestroyed, this.resetDependentSubscriptions))).subscribe((value) => {
|
1388
|
+
if (value !== true && value !== false) {
|
1389
|
+
console.error(`The value ${value} is not true or false, which are the only supported values for FormControls in the dependentCheckboxesGroup`);
|
1390
|
+
return;
|
1391
|
+
}
|
1392
|
+
if (!this.ignoreCall) {
|
1393
|
+
this.ignoreCall = true; //Ignore any value changes calls on the master to prevent a loop.
|
1394
|
+
this.updateMasterState(dependentCheckboxes);
|
1395
|
+
this.ignoreCall = false;
|
1396
|
+
}
|
1397
|
+
});
|
1398
|
+
});
|
1399
|
+
}
|
1400
|
+
/**
|
1401
|
+
* If all dependents are true, the master should be true and determinate.
|
1402
|
+
* If all dependents are false, the master should be false and determinate.
|
1403
|
+
* If some dependents are true and some dependents are false, the master should be false and indeterminate.
|
1404
|
+
*
|
1405
|
+
* If ignoreDisabledDependents is true, does not include the disabled dependents when checking values
|
1406
|
+
*/
|
1407
|
+
updateMasterState(dependentCheckboxes) {
|
1408
|
+
let dependentsToCheck = [];
|
1409
|
+
if (this.ignoreDisabledDependents) {
|
1410
|
+
dependentsToCheck = dependentCheckboxes.filter(checkbox => checkbox.enabled);
|
1411
|
+
}
|
1412
|
+
else {
|
1413
|
+
dependentsToCheck = dependentCheckboxes;
|
1414
|
+
}
|
1415
|
+
let isTrue = (checkbox) => { return checkbox.value === true; };
|
1416
|
+
if (dependentsToCheck.every(isTrue)) {
|
1417
|
+
this.formModel.setValue(true);
|
1418
|
+
this.indeterminate = false;
|
1419
|
+
}
|
1420
|
+
else if (dependentsToCheck.some(isTrue)) {
|
1421
|
+
this.formModel.setValue(false);
|
1422
|
+
this.indeterminate = true;
|
1423
|
+
}
|
1424
|
+
else {
|
1425
|
+
this.formModel.setValue(false);
|
1426
|
+
this.indeterminate = false;
|
1427
|
+
}
|
1428
|
+
}
|
1429
|
+
}
|
1430
|
+
CheckboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CheckboxComponent, deps: [{ token: ValidationMessageService }, { token: FormGroupHelper }], target: i0.ɵɵFactoryTarget.Component });
|
1431
|
+
CheckboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: CheckboxComponent, selector: "ec-checkbox", inputs: { name: "name", dependentCheckboxesGroup: "dependentCheckboxesGroup", ignoreDisabledDependents: "ignoreDisabledDependents" }, viewQueries: [{ propertyName: "inputElement", first: true, predicate: ["checkboxInput"], descendants: true, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"control\">\r\n <label class=\"checkbox\"\r\n [ngClass]=\"{'is-disabled': formModel.disabled, 'no-label': !label, 'is-readonly': readonly}\">\r\n <input id=\"{{id}}_input\"\r\n #checkboxInput\r\n class='input'\r\n [class.indeterminate]=\"indeterminate\"\r\n [attr.id]=\"inputId\"\r\n [attr.name]=\"name\"\r\n type=\"checkbox\"\r\n tabindex=\"{{tabindex}}\"\r\n [formControl]=\"formModel\"\r\n [attr.cdkFocusInitial]=\"autofocus || null\">\r\n <i class=\"ec-icon icon-check\"></i>\r\n\r\n <span id=\"{{id}}_label\"\r\n *ngIf=\"label\"\r\n class=\"label\">\r\n <span [innerHtml]=\"label | translate\"></span>\r\n <ec-help-popover id=\"{{id}}_helpPopover\"\r\n *ngIf=\"helpPopover\"\r\n class=\"d-inline-block my-n2 mx-n1\"\r\n text=\"{{helpPopover | translate}}\"\r\n contentPosition=\"{{helpPopoverPosition}}\">\r\n </ec-help-popover>\r\n </span>\r\n </label>\r\n</div>", styles: [":host{color:var(--ec-form-control-color);font-size:var(--ec-form-control-font-size);display:block;margin-bottom:1rem;width:100%}:host :host-context(.form-condensed){margin-bottom:.5rem}:host .control{width:100%;display:flex;flex-direction:column}:host .control.control-label-bottom{flex-direction:column-reverse}:host .control.control-label-left{flex-direction:row}:host .control.control-label-left label{margin-right:.25rem}:host .control.control-label-right{flex-direction:row-reverse}:host .control.control-label-right label{margin-left:.25rem}:host .control.control-label-left,:host .control.control-label-right{align-items:center}:host .control.control-label-left label,:host .control.control-label-right label{flex:1 1;margin-top:0;margin-bottom:0}:host .control.control-label-left .control-input,:host .control.control-label-right .control-input{flex:2 2}:host .control.is-readonly input,:host .control.is-readonly select,:host .control.is-readonly textarea{border-color:var(--ec-form-control-border-color-readonly);background-color:var(--ec-form-control-background-color-readonly);background-clip:border-box;background-image:none;color:var(--ec-form-control-color-readonly);opacity:1;-webkit-user-select:none;user-select:none;pointer-events:none;overflow:hidden;white-space:nowrap}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid:focus,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid:focus{border-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-invalid{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-required,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-required{display:none}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button{background-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button:not(:focus){border-color:var(--ec-form-control-border-color-invalid)}:host .textbox-group{display:flex;position:relative}:host textarea:focus,:host input:focus,:host select:focus{outline:none}:host(.w-auto){width:auto}.checkbox{cursor:pointer;display:inline-flex;margin-bottom:0;position:relative}.checkbox.is-disabled{cursor:default}.input{margin-top:.5rem;opacity:0;position:absolute;z-index:-1}.input:not(:checked)+.ec-icon{color:var(--ec-form-control-border-color)}.input:not(:checked)+.ec-icon:before{display:none}.input.indeterminate+.ec-icon,.input:indeterminate+.ec-icon{color:var(--ec-color-interactive)}.input.indeterminate+.ec-icon:before,.input:indeterminate+.ec-icon:before{content:\"\";background-color:currentColor;display:block;width:10px;height:3px}.input:focus+.ec-icon{color:var(--ec-color-interactive);box-shadow:var(--ec-form-control-box-shadow-focus);border-color:var(--ec-form-control-border-color-focus)}.input:disabled+.ec-icon{color:var(--ec-form-control-color-disabled);background-color:var(--ec-form-control-background-color-disabled);border-color:var(--ec-form-control-border-color-disabled);opacity:var(--ec-form-control-opacity-disabled)}.input:disabled~.label{color:var(--ec-form-control-color-disabled);opacity:var(--ec-form-control-opacity-disabled)}.ec-icon{background-color:var(--ec-form-control-background-color);background-clip:padding-box;border:1px solid currentColor;color:var(--ec-color-interactive);margin-top:.5rem;flex:none;pointer-events:none;display:inline-flex;align-items:center;justify-content:center;height:1em;width:1em;border-radius:.125rem}.ec-icon:before{font-size:.6875em}.label{line-height:1.25rem;padding:.375rem 0;margin-left:.5rem;min-height:2rem;height:auto}.checkbox.is-readonly{pointer-events:none}.checkbox.is-readonly .input{opacity:0}.checkbox.is-readonly .ec-icon{background-color:var(--ec-form-control-background-color-readonly);border-color:var(--ec-form-control-border-color-readonly)}.checkbox.is-readonly .label,.checkbox.is-readonly .ec-icon{opacity:1;color:var(--ec-form-control-color)}.no-label .input,.no-label .icon-check{margin-top:0}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: HelpPopoverComponent, selector: "ec-help-popover", inputs: ["id", "text", "contentPosition", "maxWidth"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] });
|
1432
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CheckboxComponent, decorators: [{
|
1433
|
+
type: Component,
|
1434
|
+
args: [{ selector: 'ec-checkbox', template: "<div class=\"control\">\r\n <label class=\"checkbox\"\r\n [ngClass]=\"{'is-disabled': formModel.disabled, 'no-label': !label, 'is-readonly': readonly}\">\r\n <input id=\"{{id}}_input\"\r\n #checkboxInput\r\n class='input'\r\n [class.indeterminate]=\"indeterminate\"\r\n [attr.id]=\"inputId\"\r\n [attr.name]=\"name\"\r\n type=\"checkbox\"\r\n tabindex=\"{{tabindex}}\"\r\n [formControl]=\"formModel\"\r\n [attr.cdkFocusInitial]=\"autofocus || null\">\r\n <i class=\"ec-icon icon-check\"></i>\r\n\r\n <span id=\"{{id}}_label\"\r\n *ngIf=\"label\"\r\n class=\"label\">\r\n <span [innerHtml]=\"label | translate\"></span>\r\n <ec-help-popover id=\"{{id}}_helpPopover\"\r\n *ngIf=\"helpPopover\"\r\n class=\"d-inline-block my-n2 mx-n1\"\r\n text=\"{{helpPopover | translate}}\"\r\n contentPosition=\"{{helpPopoverPosition}}\">\r\n </ec-help-popover>\r\n </span>\r\n </label>\r\n</div>", styles: [":host{color:var(--ec-form-control-color);font-size:var(--ec-form-control-font-size);display:block;margin-bottom:1rem;width:100%}:host :host-context(.form-condensed){margin-bottom:.5rem}:host .control{width:100%;display:flex;flex-direction:column}:host .control.control-label-bottom{flex-direction:column-reverse}:host .control.control-label-left{flex-direction:row}:host .control.control-label-left label{margin-right:.25rem}:host .control.control-label-right{flex-direction:row-reverse}:host .control.control-label-right label{margin-left:.25rem}:host .control.control-label-left,:host .control.control-label-right{align-items:center}:host .control.control-label-left label,:host .control.control-label-right label{flex:1 1;margin-top:0;margin-bottom:0}:host .control.control-label-left .control-input,:host .control.control-label-right .control-input{flex:2 2}:host .control.is-readonly input,:host .control.is-readonly select,:host .control.is-readonly textarea{border-color:var(--ec-form-control-border-color-readonly);background-color:var(--ec-form-control-background-color-readonly);background-clip:border-box;background-image:none;color:var(--ec-form-control-color-readonly);opacity:1;-webkit-user-select:none;user-select:none;pointer-events:none;overflow:hidden;white-space:nowrap}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid:focus,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid:focus{border-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-invalid{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-required,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-required{display:none}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button{background-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button:not(:focus){border-color:var(--ec-form-control-border-color-invalid)}:host .textbox-group{display:flex;position:relative}:host textarea:focus,:host input:focus,:host select:focus{outline:none}:host(.w-auto){width:auto}.checkbox{cursor:pointer;display:inline-flex;margin-bottom:0;position:relative}.checkbox.is-disabled{cursor:default}.input{margin-top:.5rem;opacity:0;position:absolute;z-index:-1}.input:not(:checked)+.ec-icon{color:var(--ec-form-control-border-color)}.input:not(:checked)+.ec-icon:before{display:none}.input.indeterminate+.ec-icon,.input:indeterminate+.ec-icon{color:var(--ec-color-interactive)}.input.indeterminate+.ec-icon:before,.input:indeterminate+.ec-icon:before{content:\"\";background-color:currentColor;display:block;width:10px;height:3px}.input:focus+.ec-icon{color:var(--ec-color-interactive);box-shadow:var(--ec-form-control-box-shadow-focus);border-color:var(--ec-form-control-border-color-focus)}.input:disabled+.ec-icon{color:var(--ec-form-control-color-disabled);background-color:var(--ec-form-control-background-color-disabled);border-color:var(--ec-form-control-border-color-disabled);opacity:var(--ec-form-control-opacity-disabled)}.input:disabled~.label{color:var(--ec-form-control-color-disabled);opacity:var(--ec-form-control-opacity-disabled)}.ec-icon{background-color:var(--ec-form-control-background-color);background-clip:padding-box;border:1px solid currentColor;color:var(--ec-color-interactive);margin-top:.5rem;flex:none;pointer-events:none;display:inline-flex;align-items:center;justify-content:center;height:1em;width:1em;border-radius:.125rem}.ec-icon:before{font-size:.6875em}.label{line-height:1.25rem;padding:.375rem 0;margin-left:.5rem;min-height:2rem;height:auto}.checkbox.is-readonly{pointer-events:none}.checkbox.is-readonly .input{opacity:0}.checkbox.is-readonly .ec-icon{background-color:var(--ec-form-control-background-color-readonly);border-color:var(--ec-form-control-border-color-readonly)}.checkbox.is-readonly .label,.checkbox.is-readonly .ec-icon{opacity:1;color:var(--ec-form-control-color)}.no-label .input,.no-label .icon-check{margin-top:0}\n"] }]
|
1435
|
+
}], ctorParameters: function () { return [{ type: ValidationMessageService }, { type: FormGroupHelper }]; }, propDecorators: { name: [{
|
1436
|
+
type: Input
|
1437
|
+
}], dependentCheckboxesGroup: [{
|
1438
|
+
type: Input
|
1439
|
+
}], ignoreDisabledDependents: [{
|
1440
|
+
type: Input
|
1441
|
+
}], inputElement: [{
|
1442
|
+
type: ViewChild,
|
1443
|
+
args: ['checkboxInput', { static: true }]
|
1444
|
+
}] } });
|
1445
|
+
|
1446
|
+
class CollapsibleToggleComponent {
|
1447
|
+
constructor() {
|
1448
|
+
/**
|
1449
|
+
* The expanded state.
|
1450
|
+
* The toggle icon is changed in the template based on the value of expanded.
|
1451
|
+
*/
|
1452
|
+
this.expanded = false;
|
1453
|
+
/**
|
1454
|
+
* Emits the value of expanded to the parent component for two-way binding
|
1455
|
+
*/
|
1456
|
+
this.expandedChange = new EventEmitter();
|
1457
|
+
}
|
1458
|
+
/**
|
1459
|
+
* On click, toggle the value of exanded and emit the current value
|
1460
|
+
*/
|
1461
|
+
onToggle() {
|
1462
|
+
this.expanded = !this.expanded;
|
1463
|
+
this.expandedChange.emit(this.expanded);
|
1464
|
+
}
|
1465
|
+
}
|
1466
|
+
CollapsibleToggleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CollapsibleToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
1467
|
+
CollapsibleToggleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: CollapsibleToggleComponent, selector: "ec-collapsible-toggle", inputs: { id: "id", expanded: "expanded", tabindex: "tabindex" }, outputs: { expandedChange: "expandedChange" }, ngImport: i0, template: `<ec-button id="{{id}}_button" type="icon" icon="icon-angle-down {{expanded ? '' : 'rotate-270'}}" tabindex="{{tabindex}}" (clicked)="onToggle()"></ec-button>`, isInline: true, styles: [":host{width:1.5rem;height:1.5rem;display:inline-flex;justify-content:center;align-items:center}ec-button::ng-deep .ec-button-icon{width:1.25rem;height:1.25rem}\n"], dependencies: [{ kind: "component", type: ButtonComponent, selector: "ec-button", inputs: ["id", "disabled", "icon", "label", "badge", "tabindex", "type", "pending", "pendingIcon", "customTemplate", "isSubmit", "autofocus"], outputs: ["clicked"] }] });
|
1468
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CollapsibleToggleComponent, decorators: [{
|
1469
|
+
type: Component,
|
1470
|
+
args: [{ selector: 'ec-collapsible-toggle', template: `<ec-button id="{{id}}_button" type="icon" icon="icon-angle-down {{expanded ? '' : 'rotate-270'}}" tabindex="{{tabindex}}" (clicked)="onToggle()"></ec-button>`, styles: [":host{width:1.5rem;height:1.5rem;display:inline-flex;justify-content:center;align-items:center}ec-button::ng-deep .ec-button-icon{width:1.25rem;height:1.25rem}\n"] }]
|
1471
|
+
}], propDecorators: { id: [{
|
1472
|
+
type: Input
|
1473
|
+
}], expanded: [{
|
1474
|
+
type: Input
|
1475
|
+
}], tabindex: [{
|
1476
|
+
type: Input
|
1167
1477
|
}], expandedChange: [{
|
1168
1478
|
type: Output
|
1169
1479
|
}] } });
|
1170
1480
|
|
1171
1481
|
/**
|
1172
|
-
*
|
1173
|
-
*
|
1174
|
-
* @export
|
1482
|
+
* Service to help with interfacing with the window object
|
1483
|
+
* and navigating around the application (going outside of the Angular 2+ router)
|
1175
1484
|
*/
|
1176
|
-
class
|
1485
|
+
class WindowService {
|
1177
1486
|
/**
|
1178
|
-
*
|
1179
|
-
*
|
1180
|
-
*
|
1181
|
-
*
|
1182
|
-
*
|
1487
|
+
* Tracks if there are any unsaved changes that the user could lose.
|
1488
|
+
*
|
1489
|
+
* It is set up as `get` only because it is set with `addNavigateAwayPrompt`.
|
1490
|
+
*
|
1491
|
+
* This also includes adding a prompt to the window itself (in addition to
|
1492
|
+
* working with the `CanDeactivateUnsavedChanges` guard) to cover page reloads
|
1493
|
+
* which do not trigger router events.
|
1183
1494
|
*/
|
1184
|
-
|
1185
|
-
this.
|
1186
|
-
|
1187
|
-
|
1188
|
-
|
1495
|
+
get hasUnsavedChanges() {
|
1496
|
+
return this._hasUnsavedChanges;
|
1497
|
+
}
|
1498
|
+
/**
|
1499
|
+
* Expose the innerWidth on the window global. Protects against errors when code
|
1500
|
+
* is running on a non-browser platform.
|
1501
|
+
*/
|
1502
|
+
get innerWidth() {
|
1503
|
+
return window ? window.innerWidth : undefined;
|
1504
|
+
}
|
1505
|
+
constructor(router, activatedRoute) {
|
1506
|
+
this.router = router;
|
1507
|
+
this.activatedRoute = activatedRoute;
|
1508
|
+
this._hasUnsavedChanges = false;
|
1189
1509
|
/**
|
1190
|
-
*
|
1510
|
+
* Function called when the window `beforeunload` event is fired.
|
1511
|
+
*
|
1512
|
+
* A reference to the function that was passed to `window.addEventListener`
|
1513
|
+
* must be retained for `window.removeEventListener` to function properly.
|
1514
|
+
*
|
1515
|
+
* Some browsers require the event's `returnValue` to be set to show the confirmation
|
1516
|
+
* dialog.
|
1517
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event
|
1191
1518
|
*/
|
1192
|
-
this.
|
1519
|
+
this.beforeUnloadFunction = (event) => {
|
1520
|
+
// Cancel the event as stated by the standard.
|
1521
|
+
event.preventDefault();
|
1522
|
+
// Chrome requires returnValue to be set.
|
1523
|
+
event.returnValue = '';
|
1524
|
+
};
|
1525
|
+
if (window) {
|
1526
|
+
this.resized = fromEvent(window, 'resize');
|
1527
|
+
}
|
1193
1528
|
}
|
1194
1529
|
/**
|
1195
|
-
*
|
1196
|
-
* @see https://angular.io/guide/lifecycle-hooks
|
1530
|
+
* Navigates to the previous page the user had visited
|
1197
1531
|
*/
|
1198
|
-
|
1199
|
-
|
1532
|
+
goBack() {
|
1533
|
+
window.history.back();
|
1200
1534
|
}
|
1201
|
-
/**
|
1202
|
-
*
|
1203
|
-
* @see https://angular.io/guide/lifecycle-hooks
|
1535
|
+
/**An abstraction around the browsers window history length.
|
1536
|
+
* Returns zero if unable to access or running outside a browser context
|
1204
1537
|
*/
|
1205
|
-
|
1206
|
-
|
1538
|
+
getHistoryLength() {
|
1539
|
+
return window?.history?.length || 0;
|
1207
1540
|
}
|
1208
1541
|
/**
|
1209
|
-
*
|
1542
|
+
* Navigate to any url you know the path to
|
1543
|
+
* @param url The URL to navigate to
|
1210
1544
|
*
|
1211
|
-
* @
|
1545
|
+
* @deprecated For legacy support only; use `router.navigateByUrl` instead
|
1212
1546
|
*/
|
1213
|
-
|
1214
|
-
|
1215
|
-
if (
|
1216
|
-
|
1217
|
-
|
1547
|
+
async navigateToUrl(url) {
|
1548
|
+
try {
|
1549
|
+
if (url.indexOf('/app/') === 0) {
|
1550
|
+
await this.router.navigateByUrl(url.substring(5));
|
1551
|
+
}
|
1552
|
+
else {
|
1553
|
+
await this.router.navigateByUrl(url);
|
1218
1554
|
}
|
1219
1555
|
}
|
1220
|
-
|
1221
|
-
|
1222
|
-
|
1223
|
-
|
1224
|
-
|
1225
|
-
if (!this.popperRef) {
|
1226
|
-
// Add the popper template as an embedded view since PopperJS
|
1227
|
-
// manipulates DOM elements.
|
1228
|
-
this.popupViewRef = this.viewContainer.createEmbeddedView(this.popup);
|
1229
|
-
// Since popper needs real DOM elements, grab the first non-comment
|
1230
|
-
// DOM element to use as our anchor.
|
1231
|
-
let anchorElement = this.popupViewRef.rootNodes.find(elem => { return elem.nodeName !== "#text"; });
|
1232
|
-
// Use the parents elements as our DOM elements to Popper
|
1233
|
-
this.popperRef = new Popper(this.templateViewRef.rootNodes[0], anchorElement, this.popperOptions);
|
1234
|
-
PopupContainerDirective.GlobalPopupRef = this;
|
1235
|
-
this.popperStatusChange.emit('visible');
|
1556
|
+
catch (e) {
|
1557
|
+
// If the router throws we will try to navigate to the fully qualified url as a last ditch effort.
|
1558
|
+
// This can happen if we missed a link that needs to be converted to ng5 or our ng1Href directive
|
1559
|
+
// didn't handle a link correctly
|
1560
|
+
window.location.href = url;
|
1236
1561
|
}
|
1237
1562
|
}
|
1238
1563
|
/**
|
1239
|
-
*
|
1564
|
+
* Adds a `beforeunload` function to the window to alert the user that there are about to leave
|
1565
|
+
* the current page and ask if they'd like to leave or stay
|
1566
|
+
*/
|
1567
|
+
addNavigateAwayPrompt() {
|
1568
|
+
this._hasUnsavedChanges = true;
|
1569
|
+
window.addEventListener("beforeunload", this.beforeUnloadFunction);
|
1570
|
+
}
|
1571
|
+
/**
|
1572
|
+
* Removes the `beforeunload` function added to the window
|
1573
|
+
*/
|
1574
|
+
removeNavigateAwayPrompt() {
|
1575
|
+
this._hasUnsavedChanges = false;
|
1576
|
+
window.removeEventListener("beforeunload", this.beforeUnloadFunction);
|
1577
|
+
}
|
1578
|
+
/**
|
1579
|
+
* Send data to another window.
|
1240
1580
|
*
|
1241
|
-
*
|
1581
|
+
* __SECURITY RISK__ - Always use a specific target origin. Failing to provide a specific target origin can allow
|
1582
|
+
* malicious sites to receive the message.
|
1583
|
+
*
|
1584
|
+
* @param targetWindow - Window to send the message to
|
1585
|
+
* @param message - Data to send
|
1586
|
+
* @param targetOrigin - What the URI of the target window must be for the message to be sent.
|
1587
|
+
* If sending data to another EnergyCAP window, this should always be `window.location.origin` to ensure
|
1588
|
+
* that only instances of EnergyCAP app receive the message.
|
1242
1589
|
*/
|
1243
|
-
|
1244
|
-
|
1245
|
-
this.globalCloseSubscription.unsubscribe();
|
1246
|
-
this.globalCloseSubscription = undefined;
|
1247
|
-
}
|
1248
|
-
if (this.popperRef && this.popupViewRef) {
|
1249
|
-
this.popupViewRef.destroy();
|
1250
|
-
this.popperRef.destroy();
|
1251
|
-
this.popperRef = undefined;
|
1252
|
-
this.popperStatusChange.emit('hidden');
|
1253
|
-
}
|
1590
|
+
postMessage(targetWindow, message, targetOrigin) {
|
1591
|
+
targetWindow.postMessage(message, targetOrigin);
|
1254
1592
|
}
|
1255
1593
|
/**
|
1256
|
-
*
|
1594
|
+
* Open a new window
|
1595
|
+
* @param url - The URL of the resource to be loaded
|
1257
1596
|
*/
|
1258
|
-
|
1259
|
-
|
1260
|
-
this.popperRef.update();
|
1261
|
-
}
|
1597
|
+
openNew(url) {
|
1598
|
+
window.open(url, '_blank');
|
1262
1599
|
}
|
1263
|
-
|
1264
|
-
|
1265
|
-
|
1266
|
-
|
1267
|
-
|
1268
|
-
|
1269
|
-
|
1270
|
-
|
1271
|
-
|
1272
|
-
|
1273
|
-
|
1274
|
-
|
1275
|
-
|
1276
|
-
|
1277
|
-
|
1278
|
-
|
1279
|
-
|
1280
|
-
|
1281
|
-
|
1282
|
-
|
1283
|
-
|
1284
|
-
|
1285
|
-
|
1286
|
-
|
1287
|
-
|
1288
|
-
|
1289
|
-
|
1290
|
-
|
1291
|
-
|
1292
|
-
|
1293
|
-
|
1294
|
-
|
1295
|
-
|
1296
|
-
this.renderer.setStyle(popupEl, 'transform', 'none');
|
1297
|
-
this.renderer.setStyle(popupEl, 'left', left + 'px');
|
1298
|
-
this.renderer.setStyle(popupEl, 'top', top + 'px');
|
1299
|
-
this.renderer.setStyle(popupEl, 'width', width + 'px');
|
1300
|
-
if (!minWidthNone) {
|
1301
|
-
this.renderer.setStyle(popupEl, 'min-width', coords.width + 'px');
|
1302
|
-
}
|
1600
|
+
/**
|
1601
|
+
* A wrapper around the router for changing the query params for the current url
|
1602
|
+
* without creating a new history entry or removing any existing query parameters.
|
1603
|
+
* The provided params are updated if they already exist or added to the url if they don't
|
1604
|
+
*
|
1605
|
+
* @returns a promise that resolves to true if the navigation succeeds, false if something (like a guard) blocks it.
|
1606
|
+
* In normal use, the navigation should succeed unless we use query params to block access to a route the user is already on
|
1607
|
+
*/
|
1608
|
+
async modifyHistoryQueryParamsSubset(queryParams) {
|
1609
|
+
return this.router.navigate([], {
|
1610
|
+
relativeTo: this.activatedRoute,
|
1611
|
+
replaceUrl: true,
|
1612
|
+
queryParams: queryParams,
|
1613
|
+
queryParamsHandling: 'merge',
|
1614
|
+
});
|
1615
|
+
}
|
1616
|
+
/**A wrapper around the default javascript confirm dialog to allow us to unit test dependent code.
|
1617
|
+
* Of course eventually we'd like to have pretty confirmations for everything, but in some cases it wasn't worth the extra time
|
1618
|
+
* so we're using this instead.
|
1619
|
+
*/
|
1620
|
+
confirm(prompt) {
|
1621
|
+
return Promise.resolve(confirm(prompt));
|
1622
|
+
}
|
1623
|
+
/**
|
1624
|
+
* Close the current window or a window instance if one is provided
|
1625
|
+
* @param windowInstance - Window to close (optional)
|
1626
|
+
*/
|
1627
|
+
closeWindow(windowInstance) {
|
1628
|
+
if (windowInstance) {
|
1629
|
+
windowInstance.close();
|
1630
|
+
}
|
1631
|
+
else {
|
1632
|
+
window.close();
|
1303
1633
|
}
|
1304
1634
|
}
|
1635
|
+
getLocation() {
|
1636
|
+
return window.location.pathname + window.location.hash;
|
1637
|
+
}
|
1638
|
+
/** Get the current value of the full url, including protocol, host and path */
|
1639
|
+
getFullUrl() {
|
1640
|
+
return window.location.href;
|
1641
|
+
}
|
1642
|
+
/** Get the current value of the base url, including protocol, domain and port (if explicitly specified) */
|
1643
|
+
getBaseUrl() {
|
1644
|
+
return window.location.origin;
|
1645
|
+
}
|
1646
|
+
/**
|
1647
|
+
* Reloads the browser window.
|
1648
|
+
* NOT RECOMMENDED. Seek other options for reloading content within Angular before resorting to this.
|
1649
|
+
*/
|
1650
|
+
reloadWindow() {
|
1651
|
+
window.location.reload();
|
1652
|
+
}
|
1305
1653
|
}
|
1306
|
-
|
1307
|
-
|
1308
|
-
|
1309
|
-
|
1310
|
-
|
1311
|
-
|
1312
|
-
|
1313
|
-
|
1314
|
-
PopupContainerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: PopupContainerDirective, selector: "[ecPopup]", inputs: { popup: ["ecPopup", "popup"], popperOptions: ["options", "popperOptions"] }, ngImport: i0 });
|
1315
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PopupContainerDirective, decorators: [{
|
1316
|
-
type: Directive,
|
1317
|
-
args: [{ selector: '[ecPopup]' }]
|
1318
|
-
}], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }, { type: undefined, decorators: [{
|
1319
|
-
type: Inject,
|
1320
|
-
args: [DOCUMENT]
|
1321
|
-
}] }, { type: i0.Renderer2 }]; }, propDecorators: { popup: [{
|
1322
|
-
type: Input,
|
1323
|
-
args: ['ecPopup']
|
1324
|
-
}], popperOptions: [{
|
1325
|
-
type: Input,
|
1326
|
-
args: ['options']
|
1327
|
-
}] } });
|
1654
|
+
WindowService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: WindowService, deps: [{ token: i1$2.Router }, { token: i1$2.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Injectable });
|
1655
|
+
WindowService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: WindowService, providedIn: 'root' });
|
1656
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: WindowService, decorators: [{
|
1657
|
+
type: Injectable,
|
1658
|
+
args: [{
|
1659
|
+
providedIn: 'root'
|
1660
|
+
}]
|
1661
|
+
}], ctorParameters: function () { return [{ type: i1$2.Router }, { type: i1$2.ActivatedRoute }]; } });
|
1328
1662
|
|
1329
1663
|
class ScrollService {
|
1330
1664
|
constructor() { }
|
@@ -1413,922 +1747,926 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
1413
1747
|
}]
|
1414
1748
|
}], ctorParameters: function () { return []; } });
|
1415
1749
|
|
1416
|
-
|
1417
|
-
const textboxValidation = (validatorParams) => {
|
1418
|
-
return (control) => {
|
1419
|
-
let validators = [];
|
1420
|
-
// Innocent until proven guilty
|
1421
|
-
validatorParams.valid = true;
|
1422
|
-
if (validatorParams.required) {
|
1423
|
-
validators.push(Validators.required);
|
1424
|
-
}
|
1425
|
-
if (validatorParams.minLength !== undefined) {
|
1426
|
-
validators.push(Validators.minLength(validatorParams.minLength));
|
1427
|
-
}
|
1428
|
-
if (validatorParams.maxLength !== undefined) {
|
1429
|
-
validators.push(Validators.maxLength(validatorParams.maxLength));
|
1430
|
-
}
|
1431
|
-
if (validatorParams.pattern !== undefined) {
|
1432
|
-
validators.push(Validators.pattern(validatorParams.pattern));
|
1433
|
-
}
|
1434
|
-
validators.forEach(validator => {
|
1435
|
-
let validationResult = validator(control);
|
1436
|
-
if (validationResult) {
|
1437
|
-
validatorParams.valid = false;
|
1438
|
-
}
|
1439
|
-
});
|
1440
|
-
if (validatorParams.valid) {
|
1441
|
-
return null;
|
1442
|
-
}
|
1443
|
-
else {
|
1444
|
-
return {
|
1445
|
-
textbox: validatorParams
|
1446
|
-
};
|
1447
|
-
}
|
1448
|
-
};
|
1449
|
-
};
|
1450
|
-
const phoneNumberValidationPattern = '^\\s*(?:\\+?(\\d{1,3}))?[-. (]*(\\d{3})[-. )]*(\\d{3})[-. ]*(\\d{4})(?: *x(\\d+))?\\s*$';
|
1451
|
-
const urlValidationPattern = '([A-Za-z])+(:\/\/)+[^\\s]*';
|
1452
|
-
class TextboxComponent extends FormControlBase {
|
1453
|
-
constructor(validationMessageService, formGroupHelper, translate) {
|
1454
|
-
super(validationMessageService, formGroupHelper);
|
1455
|
-
this.validationMessageService = validationMessageService;
|
1456
|
-
this.formGroupHelper = formGroupHelper;
|
1457
|
-
this.translate = translate;
|
1458
|
-
/**
|
1459
|
-
* Set the value of the input's autocomplete attribute
|
1460
|
-
*/
|
1461
|
-
this.autocomplete = 'off';
|
1462
|
-
/**
|
1463
|
-
* The textbox type
|
1464
|
-
*/
|
1465
|
-
this.type = "text";
|
1466
|
-
/**
|
1467
|
-
* The value of the rows attribute for a textarea. Only applies to multi-line type
|
1468
|
-
*/
|
1469
|
-
this.rows = 3;
|
1470
|
-
/**
|
1471
|
-
* If set to true, we will select all text within the input if
|
1472
|
-
* autofocus is also set to true
|
1473
|
-
*/
|
1474
|
-
this.selectOnAutofocus = false;
|
1475
|
-
/**
|
1476
|
-
* If set to true, we will upper case on focus out
|
1477
|
-
*/
|
1478
|
-
this.upperCase = false;
|
1479
|
-
/**
|
1480
|
-
* Validation pattern for the input. This is determined on the input type specified
|
1481
|
-
*/
|
1482
|
-
this.validationPattern = '';
|
1483
|
-
}
|
1484
|
-
ngOnChanges(changes) {
|
1485
|
-
super.ngOnChanges(changes);
|
1486
|
-
}
|
1750
|
+
class NavItemActiveDirective {
|
1487
1751
|
/**
|
1488
|
-
*
|
1752
|
+
* Determines whether the directive will try to make an exact match on the url or not
|
1753
|
+
* If false, the directive will add the active class if the first part of the url matches
|
1754
|
+
* the active route.
|
1755
|
+
* see: https://angular.io/api/router/Router#isactive
|
1489
1756
|
*/
|
1490
|
-
|
1491
|
-
|
1492
|
-
|
1493
|
-
if (this.type === 'tel') {
|
1494
|
-
this.validationPattern = phoneNumberValidationPattern;
|
1495
|
-
}
|
1496
|
-
else if (this.type === 'url') {
|
1497
|
-
this.validationPattern = urlValidationPattern;
|
1498
|
-
}
|
1499
|
-
if (this.placeholder) {
|
1500
|
-
this.translate.get(this.placeholder)
|
1501
|
-
.subscribe((translated) => {
|
1502
|
-
this.placeholder = translated;
|
1503
|
-
});
|
1757
|
+
set exact(value) {
|
1758
|
+
if (value === undefined) {
|
1759
|
+
this._exact = true;
|
1504
1760
|
}
|
1505
|
-
|
1506
|
-
|
1507
|
-
* The angular afterViewInit lifecycle hook
|
1508
|
-
*/
|
1509
|
-
ngAfterViewInit() {
|
1510
|
-
if (this.autofocus) {
|
1511
|
-
this.setFocus(this.selectOnAutofocus);
|
1761
|
+
else {
|
1762
|
+
this._exact = value;
|
1512
1763
|
}
|
1764
|
+
this.update();
|
1513
1765
|
}
|
1514
1766
|
/**
|
1515
|
-
*
|
1516
|
-
*
|
1517
|
-
*
|
1767
|
+
* The url of the NavItem to check for activeness. Convert the item url into a
|
1768
|
+
* UrlTree relative to the ActivatedRoute so router#isActive works even with relative urls.
|
1769
|
+
* See Angular's [routerLink](https://github.com/angular/angular/blob/8282e15c2becbe42a49befa07d6407247e8243d8/packages/router/src/directives/router_link.ts#L249)
|
1770
|
+
* and [routerLinkActive](https://github.com/angular/angular/blob/8282e15c2becbe42a49befa07d6407247e8243d8/packages/router/src/directives/router_link_active.ts#L139)
|
1771
|
+
* for a similiar implementation.
|
1518
1772
|
*/
|
1519
|
-
|
1520
|
-
|
1521
|
-
|
1522
|
-
this.
|
1523
|
-
}
|
1524
|
-
}
|
1525
|
-
/**
|
1526
|
-
* Focus out event handler
|
1527
|
-
* will upper case and trim value if upperCase is true (this is what we do on the apis)
|
1528
|
-
*/
|
1529
|
-
focusOutEvent() {
|
1530
|
-
if (this.upperCase && this.formModel.value) {
|
1531
|
-
this.formModel.setValue(this.formModel.value.toUpperCase().trim());
|
1773
|
+
set url(value) {
|
1774
|
+
if (value !== null && value !== undefined) {
|
1775
|
+
this._url = this.router.createUrlTree([value], { relativeTo: this.route, queryParams: this.queryParams });
|
1776
|
+
this.update();
|
1532
1777
|
}
|
1533
1778
|
}
|
1534
|
-
|
1535
|
-
|
1536
|
-
TextboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: TextboxComponent, selector: "ec-textbox", inputs: { autocomplete: "autocomplete", type: "type", placeholder: "placeholder", maxlength: "maxlength", minlength: "minlength", rows: "rows", selectOnAutofocus: "selectOnAutofocus", upperCase: "upperCase" }, viewQueries: [{ propertyName: "inputElement", first: true, predicate: ["textboxInput"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"control control-label-{{labelPosition}}\"\r\n [ngClass]=\"{'is-readonly': readonly}\">\r\n <label *ngIf=\"label\" ngPreserveWhitespaces>\r\n\r\n <span>{{label | translate}}</span>\r\n\r\n <span *ngIf=\"validationErrors.length > 0 && formModel.touched && formModel.invalid\">{{validationErrors | translate}}</span>\r\n </label>\r\n <div class=\"input-wrapper control-input\">\r\n <input *ngIf=\"type !== 'multi_line'\"\r\n #textboxInput\r\n email=\"{{type === 'email' ? true : false}}\"\r\n pattern=\"{{validationPattern}}\"\r\n type=\"{{type}}\"\r\n tabindex=\"{{tabindex}}\"\r\n title=\"{{tooltip}}\"\r\n [attr.id]=\"inputId\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.placeholder]=\"placeholder\"\r\n [attr.maxlength]=\"maxlength\"\r\n [attr.minlength]=\"minlength\"\r\n [attr.required]=\"required ? required : null\"\r\n [formControl]=\"formModel\"\r\n [ngClass]=\"{'is-empty': !formModel?.value, 'is-pending': pending, 'is-uppercase': upperCase}\"\r\n (focusout)=\"focusOutEvent()\"\r\n [attr.cdkFocusInitial]=\"autofocus || null\">\r\n\r\n <textarea *ngIf=\"type === 'multi_line'\"\r\n [attr.rows]=\"rows\"\r\n #textboxInput\r\n tabindex=\"{{tabindex}}\"\r\n [attr.id]=\"inputId\"\r\n [attr.placeholder]=\"placeholder\"\r\n [attr.maxlength]=\"maxlength\"\r\n [attr.minlength]=\"minlength\"\r\n [attr.required]=\"required ? required : null\"\r\n [formControl]=\"formModel\"\r\n [ngClass]=\"{'is-empty': formModel?.value === '', 'is-pending': pending}\"\r\n [attr.cdkFocusInitial]=\"autofocus || null\">\r\n </textarea>\r\n\r\n <i class=\"ec-icon icon-required\"></i>\r\n <i class=\"ec-icon icon-invalid\"></i>\r\n <i class=\"ec-icon icon-loading\"></i>\r\n </div>\r\n</div>", styles: [":host{color:var(--ec-form-control-color);font-size:var(--ec-form-control-font-size);display:block;margin-bottom:1rem;width:100%}:host :host-context(.form-condensed){margin-bottom:.5rem}:host .control{width:100%;display:flex;flex-direction:column}:host .control.control-label-bottom{flex-direction:column-reverse}:host .control.control-label-left{flex-direction:row}:host .control.control-label-left label{margin-right:.25rem}:host .control.control-label-right{flex-direction:row-reverse}:host .control.control-label-right label{margin-left:.25rem}:host .control.control-label-left,:host .control.control-label-right{align-items:center}:host .control.control-label-left label,:host .control.control-label-right label{flex:1 1;margin-top:0;margin-bottom:0}:host .control.control-label-left .control-input,:host .control.control-label-right .control-input{flex:2 2}:host .control.is-readonly input,:host .control.is-readonly select,:host .control.is-readonly textarea{border-color:var(--ec-form-control-border-color-readonly);background-color:var(--ec-form-control-background-color-readonly);background-clip:border-box;background-image:none;color:var(--ec-form-control-color-readonly);opacity:1;-webkit-user-select:none;user-select:none;pointer-events:none;overflow:hidden;white-space:nowrap}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid:focus,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid:focus{border-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-invalid{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-required,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-required{display:none}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button{background-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button:not(:focus){border-color:var(--ec-form-control-border-color-invalid)}:host .textbox-group{display:flex;position:relative}:host textarea:focus,:host input:focus,:host select:focus{outline:none}:host label{color:var(--ec-form-control-label-color, var(--ec-color-secondary-dark));display:block;font-size:var(--ec-font-size-label);line-height:1;margin:calc(var(--ec-font-size-label) / 2) 0}:host input{background-color:var(--ec-form-control-background-color);border:1px solid var(--ec-form-control-border-color);border-radius:var(--ec-border-radius);background-image:none;background-clip:padding-box;width:100%;line-height:1.25rem;padding:.3125rem .5rem;height:2rem}:host input::selection{background-color:var(--ec-form-control-background-color-selection);color:var(--ec-form-control-color-selection)}:host input::-webkit-input-placeholder{color:var(--ec-form-control-color-placeholder)}:host input::-moz-placeholder{color:var(--ec-form-control-color-placeholder);opacity:1}:host input:-ms-input-placeholder{color:var(--ec-form-control-color-placeholder)}:host input:-moz-placeholder{color:var(--ec-form-control-color-placeholder);opacity:1}:host input~.icon-required,:host input~.icon-invalid{color:var(--ec-form-control-border-color-invalid)}:host input:required.is-empty{background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host input:required.is-empty~.icon-required{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host input.ng-invalid.ng-touched{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host input.ng-invalid.ng-touched:focus{border-color:var(--ec-form-control-background-color-invalid)}:host input.ng-invalid.ng-touched~.icon-invalid{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host input.ng-invalid.ng-touched~.icon-required{display:none}:host input.is-pending.ng-valid,:host input.is-pending.ng-invalid,:host input.is-pending.ng-pending{background-image:\"\";background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem}:host input.is-pending.ng-valid~.icon-loading,:host input.is-pending.ng-invalid~.icon-loading,:host input.is-pending.ng-pending~.icon-loading{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host input.is-pending.ng-valid~.icon-required,:host input.is-pending.ng-valid~.icon-invalid,:host input.is-pending.ng-invalid~.icon-required,:host input.is-pending.ng-invalid~.icon-invalid,:host input.is-pending.ng-pending~.icon-required,:host input.is-pending.ng-pending~.icon-invalid{display:none}:host input:focus,:host input:focus.is-empty{border-color:var(--ec-form-control-border-color-focus);box-shadow:var(--ec-form-control-box-shadow-focus);position:relative;z-index:1}:host input:disabled{background-color:var(--ec-form-control-background-color-disabled);border-color:var(--ec-form-control-border-color-disabled);color:var(--ec-form-control-color-disabled);opacity:var(--ec-form-control-opacity-disabled)}:host input:disabled:required,:host input:disabled:required.is-empty{background-image:none;padding-left:.5rem;background-color:var(--ec-form-control-background-color-disabled);border-color:var(--ec-form-control-border-color-disabled)}:host input:disabled:required+.icon-required,:host input:disabled:required.is-empty+.icon-required{display:none}:host input.is-uppercase:not(.is-empty){text-transform:uppercase}:host textarea{background-color:var(--ec-form-control-background-color);border:1px solid var(--ec-form-control-border-color);border-radius:var(--ec-border-radius);background-image:none;background-clip:padding-box;width:100%;line-height:1.25rem;padding:.3125rem .5rem;height:auto;resize:none;display:block}:host textarea::selection{background-color:var(--ec-form-control-background-color-selection);color:var(--ec-form-control-color-selection)}:host textarea::-webkit-input-placeholder{color:var(--ec-form-control-color-placeholder)}:host textarea::-moz-placeholder{color:var(--ec-form-control-color-placeholder);opacity:1}:host textarea:-ms-input-placeholder{color:var(--ec-form-control-color-placeholder)}:host textarea:-moz-placeholder{color:var(--ec-form-control-color-placeholder);opacity:1}:host textarea~.icon-required,:host textarea~.icon-invalid{color:var(--ec-form-control-border-color-invalid)}:host textarea:required.is-empty{background-repeat:no-repeat;background-position:.5rem .5rem;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host textarea:required.is-empty~.icon-required{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host textarea.ng-invalid.ng-touched{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-repeat:no-repeat;background-position:.5rem .5rem;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host textarea.ng-invalid.ng-touched:focus{border-color:var(--ec-form-control-background-color-invalid)}:host textarea.ng-invalid.ng-touched~.icon-invalid{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host textarea.ng-invalid.ng-touched~.icon-required{display:none}:host textarea.is-pending.ng-valid,:host textarea.is-pending.ng-invalid,:host textarea.is-pending.ng-pending{background-image:\"\";background-repeat:no-repeat;background-position:.5rem .5rem;background-size:1rem,1rem;padding-left:1.75rem}:host textarea.is-pending.ng-valid~.icon-loading,:host textarea.is-pending.ng-invalid~.icon-loading,:host textarea.is-pending.ng-pending~.icon-loading{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host textarea.is-pending.ng-valid~.icon-required,:host textarea.is-pending.ng-valid~.icon-invalid,:host textarea.is-pending.ng-invalid~.icon-required,:host textarea.is-pending.ng-invalid~.icon-invalid,:host textarea.is-pending.ng-pending~.icon-required,:host textarea.is-pending.ng-pending~.icon-invalid{display:none}:host textarea:focus,:host textarea:focus.is-empty{border-color:var(--ec-form-control-border-color-focus);box-shadow:var(--ec-form-control-box-shadow-focus);position:relative;z-index:1}:host textarea:disabled{background-color:var(--ec-form-control-background-color-disabled);border-color:var(--ec-form-control-border-color-disabled);color:var(--ec-form-control-color-disabled);opacity:var(--ec-form-control-opacity-disabled)}:host textarea:disabled:required,:host textarea:disabled:required.is-empty{background-image:none;padding-left:.5rem;background-color:var(--ec-form-control-background-color-disabled);border-color:var(--ec-form-control-border-color-disabled)}:host textarea:disabled:required+.icon-required,:host textarea:disabled:required.is-empty+.icon-required{display:none}:host textarea.is-uppercase:not(.is-empty){text-transform:uppercase}.input-wrapper{position:relative}.input-wrapper>.ec-icon{display:none}:host(.textbox-group-input:not(:last-child)){flex:1 1 0%;width:1px}:host(.textbox-group-input:not(:last-child)) .control{margin-bottom:0}:host(.textbox-group-input:not(:last-child)) .control.is-readonly input{border-right-width:1px}:host(.textbox-group-input:not(:last-child)) input{border-top-right-radius:0;border-bottom-right-radius:0;border-right-width:0}:host(.textbox-group-input:not(:last-child)) input:focus{position:relative;z-index:1;border-right-width:1px}:host(.text-truncate) input{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host(.is-monospace) input,:host(.is-monospace) textarea,:host-context(.is-monospace) input,:host-context(.is-monospace) textarea{font-family:var(--ec-font-family-monospace)}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i4.MinLengthValidator, selector: "[minlength][formControlName],[minlength][formControl],[minlength][ngModel]", inputs: ["minlength"] }, { kind: "directive", type: i4.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i4.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i4.EmailValidator, selector: "[email][formControlName],[email][formControl],[email][ngModel]", inputs: ["email"] }, { kind: "directive", type: i4.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] });
|
1537
|
-
|
1538
|
-
|
1539
|
-
args: [{ selector: 'ec-textbox', template: "<div class=\"control control-label-{{labelPosition}}\"\r\n [ngClass]=\"{'is-readonly': readonly}\">\r\n <label *ngIf=\"label\" ngPreserveWhitespaces>\r\n\r\n <span>{{label | translate}}</span>\r\n\r\n <span *ngIf=\"validationErrors.length > 0 && formModel.touched && formModel.invalid\">{{validationErrors | translate}}</span>\r\n </label>\r\n <div class=\"input-wrapper control-input\">\r\n <input *ngIf=\"type !== 'multi_line'\"\r\n #textboxInput\r\n email=\"{{type === 'email' ? true : false}}\"\r\n pattern=\"{{validationPattern}}\"\r\n type=\"{{type}}\"\r\n tabindex=\"{{tabindex}}\"\r\n title=\"{{tooltip}}\"\r\n [attr.id]=\"inputId\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.placeholder]=\"placeholder\"\r\n [attr.maxlength]=\"maxlength\"\r\n [attr.minlength]=\"minlength\"\r\n [attr.required]=\"required ? required : null\"\r\n [formControl]=\"formModel\"\r\n [ngClass]=\"{'is-empty': !formModel?.value, 'is-pending': pending, 'is-uppercase': upperCase}\"\r\n (focusout)=\"focusOutEvent()\"\r\n [attr.cdkFocusInitial]=\"autofocus || null\">\r\n\r\n <textarea *ngIf=\"type === 'multi_line'\"\r\n [attr.rows]=\"rows\"\r\n #textboxInput\r\n tabindex=\"{{tabindex}}\"\r\n [attr.id]=\"inputId\"\r\n [attr.placeholder]=\"placeholder\"\r\n [attr.maxlength]=\"maxlength\"\r\n [attr.minlength]=\"minlength\"\r\n [attr.required]=\"required ? required : null\"\r\n [formControl]=\"formModel\"\r\n [ngClass]=\"{'is-empty': formModel?.value === '', 'is-pending': pending}\"\r\n [attr.cdkFocusInitial]=\"autofocus || null\">\r\n </textarea>\r\n\r\n <i class=\"ec-icon icon-required\"></i>\r\n <i class=\"ec-icon icon-invalid\"></i>\r\n <i class=\"ec-icon icon-loading\"></i>\r\n </div>\r\n</div>", styles: [":host{color:var(--ec-form-control-color);font-size:var(--ec-form-control-font-size);display:block;margin-bottom:1rem;width:100%}:host :host-context(.form-condensed){margin-bottom:.5rem}:host .control{width:100%;display:flex;flex-direction:column}:host .control.control-label-bottom{flex-direction:column-reverse}:host .control.control-label-left{flex-direction:row}:host .control.control-label-left label{margin-right:.25rem}:host .control.control-label-right{flex-direction:row-reverse}:host .control.control-label-right label{margin-left:.25rem}:host .control.control-label-left,:host .control.control-label-right{align-items:center}:host .control.control-label-left label,:host .control.control-label-right label{flex:1 1;margin-top:0;margin-bottom:0}:host .control.control-label-left .control-input,:host .control.control-label-right .control-input{flex:2 2}:host .control.is-readonly input,:host .control.is-readonly select,:host .control.is-readonly textarea{border-color:var(--ec-form-control-border-color-readonly);background-color:var(--ec-form-control-background-color-readonly);background-clip:border-box;background-image:none;color:var(--ec-form-control-color-readonly);opacity:1;-webkit-user-select:none;user-select:none;pointer-events:none;overflow:hidden;white-space:nowrap}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid:focus,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid:focus{border-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-invalid{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-required,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-required{display:none}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button{background-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button:not(:focus){border-color:var(--ec-form-control-border-color-invalid)}:host .textbox-group{display:flex;position:relative}:host textarea:focus,:host input:focus,:host select:focus{outline:none}:host label{color:var(--ec-form-control-label-color, var(--ec-color-secondary-dark));display:block;font-size:var(--ec-font-size-label);line-height:1;margin:calc(var(--ec-font-size-label) / 2) 0}:host input{background-color:var(--ec-form-control-background-color);border:1px solid var(--ec-form-control-border-color);border-radius:var(--ec-border-radius);background-image:none;background-clip:padding-box;width:100%;line-height:1.25rem;padding:.3125rem .5rem;height:2rem}:host input::selection{background-color:var(--ec-form-control-background-color-selection);color:var(--ec-form-control-color-selection)}:host input::-webkit-input-placeholder{color:var(--ec-form-control-color-placeholder)}:host input::-moz-placeholder{color:var(--ec-form-control-color-placeholder);opacity:1}:host input:-ms-input-placeholder{color:var(--ec-form-control-color-placeholder)}:host input:-moz-placeholder{color:var(--ec-form-control-color-placeholder);opacity:1}:host input~.icon-required,:host input~.icon-invalid{color:var(--ec-form-control-border-color-invalid)}:host input:required.is-empty{background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host input:required.is-empty~.icon-required{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host input.ng-invalid.ng-touched{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host input.ng-invalid.ng-touched:focus{border-color:var(--ec-form-control-background-color-invalid)}:host input.ng-invalid.ng-touched~.icon-invalid{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host input.ng-invalid.ng-touched~.icon-required{display:none}:host input.is-pending.ng-valid,:host input.is-pending.ng-invalid,:host input.is-pending.ng-pending{background-image:\"\";background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem}:host input.is-pending.ng-valid~.icon-loading,:host input.is-pending.ng-invalid~.icon-loading,:host input.is-pending.ng-pending~.icon-loading{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host input.is-pending.ng-valid~.icon-required,:host input.is-pending.ng-valid~.icon-invalid,:host input.is-pending.ng-invalid~.icon-required,:host input.is-pending.ng-invalid~.icon-invalid,:host input.is-pending.ng-pending~.icon-required,:host input.is-pending.ng-pending~.icon-invalid{display:none}:host input:focus,:host input:focus.is-empty{border-color:var(--ec-form-control-border-color-focus);box-shadow:var(--ec-form-control-box-shadow-focus);position:relative;z-index:1}:host input:disabled{background-color:var(--ec-form-control-background-color-disabled);border-color:var(--ec-form-control-border-color-disabled);color:var(--ec-form-control-color-disabled);opacity:var(--ec-form-control-opacity-disabled)}:host input:disabled:required,:host input:disabled:required.is-empty{background-image:none;padding-left:.5rem;background-color:var(--ec-form-control-background-color-disabled);border-color:var(--ec-form-control-border-color-disabled)}:host input:disabled:required+.icon-required,:host input:disabled:required.is-empty+.icon-required{display:none}:host input.is-uppercase:not(.is-empty){text-transform:uppercase}:host textarea{background-color:var(--ec-form-control-background-color);border:1px solid var(--ec-form-control-border-color);border-radius:var(--ec-border-radius);background-image:none;background-clip:padding-box;width:100%;line-height:1.25rem;padding:.3125rem .5rem;height:auto;resize:none;display:block}:host textarea::selection{background-color:var(--ec-form-control-background-color-selection);color:var(--ec-form-control-color-selection)}:host textarea::-webkit-input-placeholder{color:var(--ec-form-control-color-placeholder)}:host textarea::-moz-placeholder{color:var(--ec-form-control-color-placeholder);opacity:1}:host textarea:-ms-input-placeholder{color:var(--ec-form-control-color-placeholder)}:host textarea:-moz-placeholder{color:var(--ec-form-control-color-placeholder);opacity:1}:host textarea~.icon-required,:host textarea~.icon-invalid{color:var(--ec-form-control-border-color-invalid)}:host textarea:required.is-empty{background-repeat:no-repeat;background-position:.5rem .5rem;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host textarea:required.is-empty~.icon-required{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host textarea.ng-invalid.ng-touched{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-repeat:no-repeat;background-position:.5rem .5rem;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host textarea.ng-invalid.ng-touched:focus{border-color:var(--ec-form-control-background-color-invalid)}:host textarea.ng-invalid.ng-touched~.icon-invalid{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host textarea.ng-invalid.ng-touched~.icon-required{display:none}:host textarea.is-pending.ng-valid,:host textarea.is-pending.ng-invalid,:host textarea.is-pending.ng-pending{background-image:\"\";background-repeat:no-repeat;background-position:.5rem .5rem;background-size:1rem,1rem;padding-left:1.75rem}:host textarea.is-pending.ng-valid~.icon-loading,:host textarea.is-pending.ng-invalid~.icon-loading,:host textarea.is-pending.ng-pending~.icon-loading{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host textarea.is-pending.ng-valid~.icon-required,:host textarea.is-pending.ng-valid~.icon-invalid,:host textarea.is-pending.ng-invalid~.icon-required,:host textarea.is-pending.ng-invalid~.icon-invalid,:host textarea.is-pending.ng-pending~.icon-required,:host textarea.is-pending.ng-pending~.icon-invalid{display:none}:host textarea:focus,:host textarea:focus.is-empty{border-color:var(--ec-form-control-border-color-focus);box-shadow:var(--ec-form-control-box-shadow-focus);position:relative;z-index:1}:host textarea:disabled{background-color:var(--ec-form-control-background-color-disabled);border-color:var(--ec-form-control-border-color-disabled);color:var(--ec-form-control-color-disabled);opacity:var(--ec-form-control-opacity-disabled)}:host textarea:disabled:required,:host textarea:disabled:required.is-empty{background-image:none;padding-left:.5rem;background-color:var(--ec-form-control-background-color-disabled);border-color:var(--ec-form-control-border-color-disabled)}:host textarea:disabled:required+.icon-required,:host textarea:disabled:required.is-empty+.icon-required{display:none}:host textarea.is-uppercase:not(.is-empty){text-transform:uppercase}.input-wrapper{position:relative}.input-wrapper>.ec-icon{display:none}:host(.textbox-group-input:not(:last-child)){flex:1 1 0%;width:1px}:host(.textbox-group-input:not(:last-child)) .control{margin-bottom:0}:host(.textbox-group-input:not(:last-child)) .control.is-readonly input{border-right-width:1px}:host(.textbox-group-input:not(:last-child)) input{border-top-right-radius:0;border-bottom-right-radius:0;border-right-width:0}:host(.textbox-group-input:not(:last-child)) input:focus{position:relative;z-index:1;border-right-width:1px}:host(.text-truncate) input{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host(.is-monospace) input,:host(.is-monospace) textarea,:host-context(.is-monospace) input,:host-context(.is-monospace) textarea{font-family:var(--ec-font-family-monospace)}\n"] }]
|
1540
|
-
|
1541
|
-
|
1542
|
-
|
1543
|
-
|
1544
|
-
}], placeholder: [{
|
1545
|
-
type: Input
|
1546
|
-
}], maxlength: [{
|
1547
|
-
type: Input
|
1548
|
-
}], minlength: [{
|
1549
|
-
type: Input
|
1550
|
-
}], rows: [{
|
1551
|
-
type: Input
|
1552
|
-
}], selectOnAutofocus: [{
|
1553
|
-
type: Input
|
1554
|
-
}], upperCase: [{
|
1555
|
-
type: Input
|
1556
|
-
}], inputElement: [{
|
1557
|
-
type: ViewChild,
|
1558
|
-
args: ['textboxInput']
|
1559
|
-
}] } });
|
1560
|
-
|
1561
|
-
/** Exposes the markup and styles that represent the spinner. No inputs or outputs defined because it is just a visual component*/
|
1562
|
-
class SpinnerComponent {
|
1563
|
-
}
|
1564
|
-
SpinnerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SpinnerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
1565
|
-
SpinnerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: SpinnerComponent, selector: "ec-spinner", ngImport: i0, template: "<div class=\"spinner\">\r\n <span class=\"spinner-dot\"></span>\r\n <span class=\"spinner-dot\"></span>\r\n <span class=\"spinner-dot\"></span>\r\n <span class=\"spinner-dot\"></span>\r\n</div>", styles: ["@keyframes sk-bouncedelay{0%,80%,to{opacity:0}40%{opacity:1}}.spinner{display:flex}.spinner-dot{width:.75rem;height:.75rem;background-color:var(--ec-color-interactive);animation:sk-bouncedelay 1.7s infinite ease-in-out both;margin-right:.25rem}.spinner-dot:nth-child(1){animation-delay:-.6s}.spinner-dot:nth-child(2){animation-delay:-.4s}.spinner-dot:nth-child(3){animation-delay:-.2s}:host(.spinner-small) .spinner-dot{width:.5rem;height:.5rem;background-color:var(--ec-color-interactive);animation:sk-bouncedelay 1.7s infinite ease-in-out both;margin-right:.1666666667rem}:host(.spinner-small) .spinner-dot:nth-child(1){animation-delay:-.6s}:host(.spinner-small) .spinner-dot:nth-child(2){animation-delay:-.4s}:host(.spinner-small) .spinner-dot:nth-child(3){animation-delay:-.2s}\n"] });
|
1566
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SpinnerComponent, decorators: [{
|
1567
|
-
type: Component,
|
1568
|
-
args: [{ selector: 'ec-spinner', template: "<div class=\"spinner\">\r\n <span class=\"spinner-dot\"></span>\r\n <span class=\"spinner-dot\"></span>\r\n <span class=\"spinner-dot\"></span>\r\n <span class=\"spinner-dot\"></span>\r\n</div>", styles: ["@keyframes sk-bouncedelay{0%,80%,to{opacity:0}40%{opacity:1}}.spinner{display:flex}.spinner-dot{width:.75rem;height:.75rem;background-color:var(--ec-color-interactive);animation:sk-bouncedelay 1.7s infinite ease-in-out both;margin-right:.25rem}.spinner-dot:nth-child(1){animation-delay:-.6s}.spinner-dot:nth-child(2){animation-delay:-.4s}.spinner-dot:nth-child(3){animation-delay:-.2s}:host(.spinner-small) .spinner-dot{width:.5rem;height:.5rem;background-color:var(--ec-color-interactive);animation:sk-bouncedelay 1.7s infinite ease-in-out both;margin-right:.1666666667rem}:host(.spinner-small) .spinner-dot:nth-child(1){animation-delay:-.6s}:host(.spinner-small) .spinner-dot:nth-child(2){animation-delay:-.4s}:host(.spinner-small) .spinner-dot:nth-child(3){animation-delay:-.2s}\n"] }]
|
1569
|
-
}] });
|
1570
|
-
|
1571
|
-
class Overlay {
|
1572
|
-
constructor(status, message) {
|
1573
|
-
this.status = 'hasData';
|
1574
|
-
this.message = '';
|
1575
|
-
this.setStatus(status, message);
|
1576
|
-
}
|
1577
|
-
setStatus(status, message, action, noDataTemplate, overlayClassList) {
|
1578
|
-
this.status = status;
|
1579
|
-
this.message = message || '';
|
1580
|
-
this.action = action || undefined;
|
1581
|
-
this.noDataTemplate = noDataTemplate || undefined;
|
1582
|
-
this.overlayClassList = overlayClassList || '';
|
1779
|
+
constructor(router, el, renderer, route) {
|
1780
|
+
this.router = router;
|
1781
|
+
this.el = el;
|
1782
|
+
this.renderer = renderer;
|
1783
|
+
this.route = route;
|
1784
|
+
this._exact = true;
|
1785
|
+
/** Emits when the url becomes active */
|
1786
|
+
this.routerLinkActivated = new EventEmitter();
|
1787
|
+
/** Subject that emits when component is destroyed to unsubscribe from any subscriptions */
|
1788
|
+
this.destroyed = new Subject();
|
1583
1789
|
}
|
1584
|
-
|
1585
|
-
|
1586
|
-
|
1587
|
-
|
1588
|
-
|
1589
|
-
constructor() {
|
1590
|
-
this.status = 'hasData';
|
1790
|
+
/** Check if url is active on NavigationEnd events */
|
1791
|
+
ngOnInit() {
|
1792
|
+
this.router.events.pipe(takeUntil(this.destroyed), filter(e => e instanceof NavigationEnd)).subscribe(() => {
|
1793
|
+
this.update();
|
1794
|
+
});
|
1591
1795
|
}
|
1592
|
-
|
1593
|
-
this.
|
1594
|
-
this.
|
1595
|
-
this.action = action || undefined;
|
1596
|
-
this.noDataTemplate = noDataTemplate || undefined;
|
1796
|
+
ngOnDestroy() {
|
1797
|
+
this.destroyed.next();
|
1798
|
+
this.destroyed.unsubscribe();
|
1597
1799
|
}
|
1598
|
-
|
1599
|
-
|
1600
|
-
|
1800
|
+
/** If url is active apply the defined class to the element, otherwise remove it */
|
1801
|
+
update() {
|
1802
|
+
if (this._url && this.classValue) {
|
1803
|
+
if (this.router.isActive(this._url, { matrixParams: 'ignored', queryParams: this._exact ? 'exact' : 'subset', paths: this._exact ? 'exact' : 'subset', fragment: 'ignored' })) {
|
1804
|
+
this.renderer.addClass(this.el.nativeElement, this.classValue);
|
1805
|
+
this.routerLinkActivated.emit(new Event('routerLinkActivated'));
|
1806
|
+
}
|
1807
|
+
else {
|
1808
|
+
this.renderer.removeClass(this.el.nativeElement, this.classValue);
|
1809
|
+
}
|
1601
1810
|
}
|
1602
1811
|
}
|
1603
1812
|
}
|
1604
|
-
|
1605
|
-
|
1606
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type:
|
1607
|
-
type:
|
1608
|
-
args: [{
|
1609
|
-
|
1610
|
-
|
1611
|
-
|
1612
|
-
type: Input
|
1613
|
-
|
1614
|
-
|
1615
|
-
|
1616
|
-
|
1617
|
-
}],
|
1618
|
-
type: Input
|
1619
|
-
|
1620
|
-
|
1813
|
+
NavItemActiveDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NavItemActiveDirective, deps: [{ token: i1$2.Router }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i1$2.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Directive });
|
1814
|
+
NavItemActiveDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: NavItemActiveDirective, selector: "[ecNavItemActive]", inputs: { classValue: ["ecNavItemActive", "classValue"], exact: ["ecNavItemActiveExactMatch", "exact"], queryParams: ["ecNavItemActiveQueryParams", "queryParams"], url: ["ecNavItemActiveUrl", "url"] }, outputs: { routerLinkActivated: "routerLinkActivated" }, ngImport: i0 });
|
1815
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NavItemActiveDirective, decorators: [{
|
1816
|
+
type: Directive,
|
1817
|
+
args: [{
|
1818
|
+
selector: '[ecNavItemActive]'
|
1819
|
+
}]
|
1820
|
+
}], ctorParameters: function () { return [{ type: i1$2.Router }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i1$2.ActivatedRoute }]; }, propDecorators: { classValue: [{
|
1821
|
+
type: Input,
|
1822
|
+
args: ['ecNavItemActive']
|
1823
|
+
}], exact: [{
|
1824
|
+
type: Input,
|
1825
|
+
args: ['ecNavItemActiveExactMatch']
|
1826
|
+
}], queryParams: [{
|
1827
|
+
type: Input,
|
1828
|
+
args: ['ecNavItemActiveQueryParams']
|
1829
|
+
}], url: [{
|
1830
|
+
type: Input,
|
1831
|
+
args: ['ecNavItemActiveUrl']
|
1832
|
+
}], routerLinkActivated: [{
|
1833
|
+
type: Output
|
1621
1834
|
}] } });
|
1622
1835
|
|
1836
|
+
;
|
1837
|
+
const menuAnimationSpeed = 350;
|
1623
1838
|
/**
|
1624
|
-
*
|
1625
|
-
*
|
1839
|
+
* Primitive Menu component that encapsulates known templates
|
1840
|
+
*
|
1841
|
+
* @export
|
1626
1842
|
*/
|
1627
|
-
class
|
1843
|
+
class MenuComponent {
|
1628
1844
|
/**
|
1629
|
-
*
|
1630
|
-
*
|
1631
|
-
* It is set up as `get` only because it is set with `addNavigateAwayPrompt`.
|
1632
|
-
*
|
1633
|
-
* This also includes adding a prompt to the window itself (in addition to
|
1634
|
-
* working with the `CanDeactivateUnsavedChanges` guard) to cover page reloads
|
1635
|
-
* which do not trigger router events.
|
1845
|
+
* Helper function to return a flat list of all selectable items in the provided menu items. Filters out headings and divided-sections.
|
1846
|
+
* This makes it much easier to keep track of currently highlighted items for keyboard navigation.
|
1636
1847
|
*/
|
1637
|
-
|
1638
|
-
return
|
1848
|
+
static getSelectableItems(items) {
|
1849
|
+
return items.reduce((selectableItems, item) => {
|
1850
|
+
if (item.display !== 'heading' && item.display !== 'divided-section') {
|
1851
|
+
selectableItems.push(item);
|
1852
|
+
}
|
1853
|
+
else if (item.items) {
|
1854
|
+
selectableItems.push(...item.items.filter(childItem => childItem.display !== 'heading' && childItem.display !== 'divided-section'));
|
1855
|
+
}
|
1856
|
+
return selectableItems;
|
1857
|
+
}, []);
|
1639
1858
|
}
|
1640
1859
|
/**
|
1641
|
-
*
|
1642
|
-
* is
|
1860
|
+
* Returns an ID for the provided item based on its index in the provided items array. This mimics the behavior of the MenuComponent's
|
1861
|
+
* generated IDs for items that don't have provided IDs. This is used in MenuComponent and ComboboxComponent to scroll to specific items.
|
1862
|
+
* NOTE: If the items array does not match what is displayed in the menu, this function will not return the correct ID.
|
1863
|
+
*
|
1864
|
+
* Returns null if the not found
|
1865
|
+
* @param items The MenuItems array to search through.
|
1866
|
+
* @param item The item to generate the ID for.
|
1867
|
+
* @param menuComponentId Used to prefix the generated ID. This should be the ID of the menu component the item is present in.
|
1868
|
+
* @memberof MenuComponent
|
1643
1869
|
*/
|
1644
|
-
|
1645
|
-
|
1870
|
+
static getIndexedItemId(items, item, menuComponentId) {
|
1871
|
+
if (item) {
|
1872
|
+
for (let i = 0; i < items.length; i++) {
|
1873
|
+
const itemInList = items[i];
|
1874
|
+
if (itemInList.label === item.label) {
|
1875
|
+
return `${menuComponentId}_item${i}`;
|
1876
|
+
}
|
1877
|
+
// If the item is a heading or divided section, check its children
|
1878
|
+
if (itemInList.items && (itemInList.display === 'heading' || itemInList.display === 'divided-section')) {
|
1879
|
+
for (let j = 0; j < itemInList.items.length; j++) {
|
1880
|
+
const childItem = itemInList.items[j];
|
1881
|
+
// Fall back to checking only the label if the item doesn't have an id
|
1882
|
+
if (childItem.label === item.label) {
|
1883
|
+
return `${menuComponentId}_item${i}-${j}`;
|
1884
|
+
}
|
1885
|
+
}
|
1886
|
+
}
|
1887
|
+
}
|
1888
|
+
}
|
1889
|
+
return null;
|
1646
1890
|
}
|
1647
|
-
constructor(
|
1648
|
-
this.
|
1649
|
-
this.
|
1650
|
-
this.
|
1891
|
+
constructor(el, renderer, windowService, scrollService) {
|
1892
|
+
this.el = el;
|
1893
|
+
this.renderer = renderer;
|
1894
|
+
this.windowService = windowService;
|
1895
|
+
this.scrollService = scrollService;
|
1651
1896
|
/**
|
1652
|
-
*
|
1897
|
+
* Array of items to display
|
1653
1898
|
*
|
1654
|
-
*
|
1655
|
-
|
1899
|
+
* @memberof MenuComponent
|
1900
|
+
*/
|
1901
|
+
this.items = [];
|
1902
|
+
/**
|
1903
|
+
* Selected item; annotates the item
|
1904
|
+
* when displayed with 'selected' class
|
1656
1905
|
*
|
1657
|
-
*
|
1658
|
-
* dialog.
|
1659
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event
|
1906
|
+
* @memberof MenuComponent
|
1660
1907
|
*/
|
1661
|
-
this.
|
1662
|
-
|
1663
|
-
|
1664
|
-
|
1665
|
-
|
1666
|
-
|
1667
|
-
|
1668
|
-
|
1908
|
+
this.selected = null;
|
1909
|
+
/**
|
1910
|
+
* Display template
|
1911
|
+
*
|
1912
|
+
* @memberof MenuComponent
|
1913
|
+
*/
|
1914
|
+
this.templateType = 'label';
|
1915
|
+
/**
|
1916
|
+
* Show message when there are no items
|
1917
|
+
*/
|
1918
|
+
this.showNoItems = false;
|
1919
|
+
/**
|
1920
|
+
* Text to show when menu is empty and showNoItems is true
|
1921
|
+
*/
|
1922
|
+
this.noDataText = 'NoItems_TC';
|
1923
|
+
/**
|
1924
|
+
* Controls whether keyboard navigation is enabled
|
1925
|
+
*/
|
1926
|
+
this.enableKeyNav = false;
|
1927
|
+
/**
|
1928
|
+
* Item currently highlighted by keyboard navigation
|
1929
|
+
*/
|
1930
|
+
this.highlightedItem = null;
|
1931
|
+
/**
|
1932
|
+
* Tells the menu to maintain the selected/lastSelected item. Turning this off is useful for
|
1933
|
+
* action type menus that are displayed on the screen at all times and you do not
|
1934
|
+
* want the item to be selected when clicked.
|
1935
|
+
*/
|
1936
|
+
this.maintainSelectedItem = true;
|
1937
|
+
/**
|
1938
|
+
* Will prevent text-wrapping of menu items and truncate instead. Also turns on a tooltip for the menu item. Default: false;
|
1939
|
+
*/
|
1940
|
+
this.truncateItems = false;
|
1941
|
+
/**
|
1942
|
+
* When true, the space for the icon is preserved for menu items that do not have icons.
|
1943
|
+
* Only applicable for iconAndLabel menus.
|
1944
|
+
*/
|
1945
|
+
this.preserveIconSpace = false;
|
1946
|
+
/**
|
1947
|
+
* Emitted when `selected` is changed. Emits the referenced object.
|
1948
|
+
*
|
1949
|
+
* @memberof MenuComponent
|
1950
|
+
*/
|
1951
|
+
this.selectedChanged = new EventEmitter();
|
1952
|
+
/**
|
1953
|
+
* Emitted when the menu has a parent and back is clicked
|
1954
|
+
* @memberof MenuComponent
|
1955
|
+
*/
|
1956
|
+
this.menuClosed = new EventEmitter();
|
1957
|
+
/**
|
1958
|
+
* Index of the item currently highlighted using keyboard nav
|
1959
|
+
*/
|
1960
|
+
this.highlightedItemIndex = -1;
|
1961
|
+
/**
|
1962
|
+
* Last item this.selected was set to via selectItem().
|
1963
|
+
* This isn't necessarily the same as this.selected, because this.selected is an input property
|
1964
|
+
* and could have been changed by a consumer through some means other than selectItem().
|
1965
|
+
* This allows us to prevent double-calls to selectItem() with the same input.
|
1966
|
+
*/
|
1967
|
+
this.lastSelected = null;
|
1968
|
+
/**
|
1969
|
+
* Flattened array of all selectable items in the menu. Makes it easier to keep track of the currently highlighted item for keyboard navigation.
|
1970
|
+
*/
|
1971
|
+
this.selectableItems = [];
|
1972
|
+
}
|
1973
|
+
ngOnChanges(changes) {
|
1974
|
+
if (changes.items && this.items) {
|
1975
|
+
this.selectableItems = MenuComponent.getSelectableItems(this.items);
|
1669
1976
|
}
|
1670
1977
|
}
|
1671
1978
|
/**
|
1672
|
-
*
|
1979
|
+
* Sets & displays the interalized template based on
|
1980
|
+
* the set template.
|
1981
|
+
* @see { @link https://angular.io/guide/lifecycle-hooks|Angular Lifecycle Hooks}
|
1982
|
+
*
|
1983
|
+
* @memberof MenuComponent
|
1673
1984
|
*/
|
1674
|
-
|
1675
|
-
|
1985
|
+
ngAfterContentInit() {
|
1986
|
+
switch (this.templateType) {
|
1987
|
+
case ("label"):
|
1988
|
+
this.internalizedTemplate = this.iconAndLabelTemplate;
|
1989
|
+
break;
|
1990
|
+
case ("iconAndLabel"):
|
1991
|
+
this.internalizedTemplate = this.iconAndLabelTemplate;
|
1992
|
+
break;
|
1993
|
+
case ("checkAndLabel"):
|
1994
|
+
this.internalizedTemplate = this.checkAndLabelTemplate;
|
1995
|
+
break;
|
1996
|
+
case ("iconLabelCaption"):
|
1997
|
+
this.internalizedTemplate = this.iconLabelCaptionTemplate;
|
1998
|
+
break;
|
1999
|
+
default:
|
2000
|
+
throw new Error(`Invalid templateType for MenuComponent. Please use either: 'label', 'iconAndLabel' or 'checkAndLabel'`);
|
2001
|
+
}
|
2002
|
+
//if the consumer provided a menuItemTemplate, override the internalizedTemplate with that.
|
2003
|
+
if (this.customMenuTemplate) {
|
2004
|
+
this.internalizedTemplate = this.customMenuTemplate;
|
2005
|
+
}
|
2006
|
+
if (this.id) {
|
2007
|
+
this.attrId = this.id;
|
2008
|
+
}
|
2009
|
+
this.setItemIds();
|
2010
|
+
if (this.highlightedItem && this.selectableItems.length) {
|
2011
|
+
this.highlightedItemIndex = this.selectableItems.findIndex(item => { return this.highlightedItem === item; });
|
2012
|
+
}
|
2013
|
+
this.addKeydownListener();
|
1676
2014
|
}
|
1677
|
-
|
1678
|
-
|
1679
|
-
|
1680
|
-
|
1681
|
-
|
2015
|
+
ngOnDestroy() {
|
2016
|
+
// Remove the listener when the component is destroyed
|
2017
|
+
if (this.removeKeydownListener) {
|
2018
|
+
this.removeKeydownListener();
|
2019
|
+
}
|
1682
2020
|
}
|
1683
2021
|
/**
|
1684
|
-
*
|
1685
|
-
*
|
2022
|
+
* When a menu item is selected, open a child menu if the item has items, call
|
2023
|
+
* the item's click method if defined, or emit the selected item.
|
1686
2024
|
*
|
1687
|
-
* @
|
2025
|
+
* @param item The selected item
|
2026
|
+
* @memberof MenuComponent
|
1688
2027
|
*/
|
1689
|
-
|
1690
|
-
|
1691
|
-
|
1692
|
-
|
2028
|
+
selectItem(event, item, isKeyEvent) {
|
2029
|
+
event.stopPropagation();
|
2030
|
+
//In the case that the user clicks an item, selectItem() will be called from the click handler
|
2031
|
+
//and through onRouterLinkActivated. Only one of these will make it through this if statement
|
2032
|
+
//because the first one will set this.lastSelected = item.
|
2033
|
+
if (!item.disabled && !item.readonly && this.lastSelected !== item) {
|
2034
|
+
if (!item.url) {
|
2035
|
+
if (item.onClick) {
|
2036
|
+
item.onClick(item, false);
|
2037
|
+
}
|
2038
|
+
if (item.items && item.display !== 'heading' && item.display !== 'divided-section') {
|
2039
|
+
this.toggleChildMenu(true);
|
2040
|
+
}
|
2041
|
+
else {
|
2042
|
+
this.onSelection(item);
|
2043
|
+
}
|
2044
|
+
// We need to manually handle the url navigation if the keyboard was used
|
2045
|
+
}
|
2046
|
+
else if (isKeyEvent || event.target?.tagName === 'LI') {
|
2047
|
+
if (item.target) {
|
2048
|
+
window.open(item.url, item.target);
|
2049
|
+
}
|
2050
|
+
else {
|
2051
|
+
this.windowService.navigateToUrl(item.url);
|
2052
|
+
}
|
2053
|
+
// Emit so upstream components know an item was selected
|
2054
|
+
this.onSelection(item);
|
1693
2055
|
}
|
1694
2056
|
else {
|
1695
|
-
|
2057
|
+
this.onSelection(item);
|
2058
|
+
}
|
2059
|
+
if (this.maintainSelectedItem) {
|
2060
|
+
this.selected = item;
|
2061
|
+
this.lastSelected = item;
|
2062
|
+
}
|
2063
|
+
else {
|
2064
|
+
this.selected = null;
|
2065
|
+
this.lastSelected = null;
|
1696
2066
|
}
|
1697
2067
|
}
|
1698
|
-
catch (e) {
|
1699
|
-
// If the router throws we will try to navigate to the fully qualified url as a last ditch effort.
|
1700
|
-
// This can happen if we missed a link that needs to be converted to ng5 or our ng1Href directive
|
1701
|
-
// didn't handle a link correctly
|
1702
|
-
window.location.href = url;
|
1703
|
-
}
|
1704
|
-
}
|
1705
|
-
/**
|
1706
|
-
* Adds a `beforeunload` function to the window to alert the user that there are about to leave
|
1707
|
-
* the current page and ask if they'd like to leave or stay
|
1708
|
-
*/
|
1709
|
-
addNavigateAwayPrompt() {
|
1710
|
-
this._hasUnsavedChanges = true;
|
1711
|
-
window.addEventListener("beforeunload", this.beforeUnloadFunction);
|
1712
|
-
}
|
1713
|
-
/**
|
1714
|
-
* Removes the `beforeunload` function added to the window
|
1715
|
-
*/
|
1716
|
-
removeNavigateAwayPrompt() {
|
1717
|
-
this._hasUnsavedChanges = false;
|
1718
|
-
window.removeEventListener("beforeunload", this.beforeUnloadFunction);
|
1719
2068
|
}
|
1720
2069
|
/**
|
1721
|
-
*
|
1722
|
-
*
|
1723
|
-
* __SECURITY RISK__ - Always use a specific target origin. Failing to provide a specific target origin can allow
|
1724
|
-
* malicious sites to receive the message.
|
1725
|
-
*
|
1726
|
-
* @param targetWindow - Window to send the message to
|
1727
|
-
* @param message - Data to send
|
1728
|
-
* @param targetOrigin - What the URI of the target window must be for the message to be sent.
|
1729
|
-
* If sending data to another EnergyCAP window, this should always be `window.location.origin` to ensure
|
1730
|
-
* that only instances of EnergyCAP app receive the message.
|
1731
|
-
*/
|
1732
|
-
postMessage(targetWindow, message, targetOrigin) {
|
1733
|
-
targetWindow.postMessage(message, targetOrigin);
|
1734
|
-
}
|
1735
|
-
/**
|
1736
|
-
* Open a new window
|
1737
|
-
* @param url - The URL of the resource to be loaded
|
2070
|
+
* Close the current menu and open the parent menu
|
2071
|
+
* @memberof MenuComponent
|
1738
2072
|
*/
|
1739
|
-
|
1740
|
-
|
2073
|
+
back(event) {
|
2074
|
+
event.stopPropagation();
|
2075
|
+
if (this.parent && this.parent.onClick) {
|
2076
|
+
this.parent.onClick(null, true);
|
2077
|
+
}
|
2078
|
+
this.menuClosed.emit();
|
1741
2079
|
}
|
1742
2080
|
/**
|
1743
|
-
*
|
1744
|
-
*
|
1745
|
-
* The provided params are updated if they already exist or added to the url if they don't
|
1746
|
-
*
|
1747
|
-
* @returns a promise that resolves to true if the navigation succeeds, false if something (like a guard) blocks it.
|
1748
|
-
* In normal use, the navigation should succeed unless we use query params to block access to a route the user is already on
|
1749
|
-
*/
|
1750
|
-
async modifyHistoryQueryParamsSubset(queryParams) {
|
1751
|
-
return this.router.navigate([], {
|
1752
|
-
relativeTo: this.activatedRoute,
|
1753
|
-
replaceUrl: true,
|
1754
|
-
queryParams: queryParams,
|
1755
|
-
queryParamsHandling: 'merge',
|
1756
|
-
});
|
1757
|
-
}
|
1758
|
-
/**A wrapper around the default javascript confirm dialog to allow us to unit test dependent code.
|
1759
|
-
* Of course eventually we'd like to have pretty confirmations for everything, but in some cases it wasn't worth the extra time
|
1760
|
-
* so we're using this instead.
|
2081
|
+
* Emit the selected item
|
2082
|
+
* @param item The selected item
|
1761
2083
|
*/
|
1762
|
-
|
1763
|
-
|
2084
|
+
onSelection(item) {
|
2085
|
+
if (item.display !== 'heading') {
|
2086
|
+
this.selectedChanged.emit(item);
|
2087
|
+
}
|
1764
2088
|
}
|
1765
2089
|
/**
|
1766
|
-
*
|
1767
|
-
*
|
2090
|
+
* Open or close the child menu. When the child menu closes, the selected
|
2091
|
+
* item is reset.
|
2092
|
+
* @memberof MenuComponent
|
1768
2093
|
*/
|
1769
|
-
|
1770
|
-
|
1771
|
-
|
2094
|
+
toggleChildMenu(open) {
|
2095
|
+
let navEl = this.el.nativeElement.querySelector('nav');
|
2096
|
+
if (open) {
|
2097
|
+
// Remove the listener on the parent menu when a child menu is opened
|
2098
|
+
// This is to avoid interference between the parent and child menus
|
2099
|
+
if (this.removeKeydownListener) {
|
2100
|
+
this.removeKeydownListener();
|
2101
|
+
}
|
2102
|
+
let height = navEl.offsetHeight;
|
2103
|
+
let width = navEl.offsetWidth;
|
2104
|
+
// In order to animate the child menu, we need to set height on the nav element
|
2105
|
+
// so we can absolutely position the two menus and maintain the current menu's height
|
2106
|
+
this.renderer.setStyle(navEl, 'height', `${height}px`);
|
2107
|
+
this.renderer.setStyle(navEl, 'width', `${width}px`);
|
2108
|
+
this.renderer.addClass(this.el.nativeElement, 'open');
|
2109
|
+
setTimeout(() => {
|
2110
|
+
this.renderer.addClass(this.el.nativeElement, 'open-active');
|
2111
|
+
});
|
1772
2112
|
}
|
1773
2113
|
else {
|
1774
|
-
|
2114
|
+
// Re-add the listener once the child menu closes
|
2115
|
+
this.addKeydownListener();
|
2116
|
+
this.renderer.removeClass(this.el.nativeElement, 'open-active');
|
2117
|
+
setTimeout(() => {
|
2118
|
+
this.renderer.removeClass(this.el.nativeElement, 'open');
|
2119
|
+
// Reset the nav element's height to auto
|
2120
|
+
this.renderer.setStyle(navEl, 'height', '100%');
|
2121
|
+
this.selected = null;
|
2122
|
+
}, menuAnimationSpeed);
|
1775
2123
|
}
|
1776
2124
|
}
|
1777
|
-
getLocation() {
|
1778
|
-
return window.location.pathname + window.location.hash;
|
1779
|
-
}
|
1780
|
-
/** Get the current value of the full url, including protocol, host and path */
|
1781
|
-
getFullUrl() {
|
1782
|
-
return window.location.href;
|
1783
|
-
}
|
1784
|
-
/** Get the current value of the base url, including protocol, domain and port (if explicitly specified) */
|
1785
|
-
getBaseUrl() {
|
1786
|
-
return window.location.origin;
|
1787
|
-
}
|
1788
2125
|
/**
|
1789
|
-
*
|
1790
|
-
* NOT RECOMMENDED. Seek other options for reloading content within Angular before resorting to this.
|
2126
|
+
* Handle key presses to navigate the menu
|
1791
2127
|
*/
|
1792
|
-
|
1793
|
-
|
2128
|
+
keyNavigate(event) {
|
2129
|
+
if (this.enableKeyNav && event.target === this.dropdownToggleButton?.nativeElement) {
|
2130
|
+
switch (event.key) {
|
2131
|
+
case 'ArrowUp':
|
2132
|
+
case 'Up':
|
2133
|
+
case 'ArrowDown':
|
2134
|
+
case 'Down':
|
2135
|
+
event.stopPropagation();
|
2136
|
+
event.preventDefault();
|
2137
|
+
this.moveHighlightedUpOrDown(event);
|
2138
|
+
break;
|
2139
|
+
case 'ArrowRight':
|
2140
|
+
case 'Right':
|
2141
|
+
event.stopPropagation();
|
2142
|
+
event.preventDefault();
|
2143
|
+
// Select the item if it has child items
|
2144
|
+
if (this.highlightedItem && this.highlightedItem.items) {
|
2145
|
+
this.selectItem(event, this.highlightedItem, true);
|
2146
|
+
}
|
2147
|
+
break;
|
2148
|
+
case 'ArrowLeft':
|
2149
|
+
case 'Left':
|
2150
|
+
event.stopPropagation();
|
2151
|
+
event.preventDefault();
|
2152
|
+
// Close the menu if it is a child menu
|
2153
|
+
if (this.parent) {
|
2154
|
+
this.back(event);
|
2155
|
+
}
|
2156
|
+
break;
|
2157
|
+
case ' ':
|
2158
|
+
case 'Spacebar':
|
2159
|
+
case 'Enter':
|
2160
|
+
// Prevent 'enter' from doing whatever it does on the currently focused element
|
2161
|
+
event.preventDefault();
|
2162
|
+
if (this.highlightedItemIndex > -1 && this.highlightedItem) {
|
2163
|
+
this.selectItem(event, this.highlightedItem, true);
|
2164
|
+
// If the header is highlighted
|
2165
|
+
}
|
2166
|
+
else if (this.highlightedItemIndex === -1) {
|
2167
|
+
// Close the menu if it's a child
|
2168
|
+
if (this.parent) {
|
2169
|
+
this.back(event);
|
2170
|
+
}
|
2171
|
+
}
|
2172
|
+
break;
|
2173
|
+
default:
|
2174
|
+
return;
|
2175
|
+
}
|
2176
|
+
}
|
1794
2177
|
}
|
1795
|
-
}
|
1796
|
-
WindowService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: WindowService, deps: [{ token: i1$1.Router }, { token: i1$1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Injectable });
|
1797
|
-
WindowService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: WindowService, providedIn: 'root' });
|
1798
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: WindowService, decorators: [{
|
1799
|
-
type: Injectable,
|
1800
|
-
args: [{
|
1801
|
-
providedIn: 'root'
|
1802
|
-
}]
|
1803
|
-
}], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i1$1.ActivatedRoute }]; } });
|
1804
|
-
|
1805
|
-
class NavItemActiveDirective {
|
1806
2178
|
/**
|
1807
|
-
*
|
1808
|
-
*
|
1809
|
-
* the
|
1810
|
-
* see: https://angular.io/api/router/Router#isactive
|
2179
|
+
* Scroll to the item currently marked as 'is-selected'. Wait a tick for the
|
2180
|
+
* NgClassDirecitve or NavItemActiveDirective to respond to the model changes
|
2181
|
+
* and update the view.
|
1811
2182
|
*/
|
1812
|
-
|
1813
|
-
|
1814
|
-
|
2183
|
+
scrollToSelectedItem() {
|
2184
|
+
window.setTimeout(() => {
|
2185
|
+
const linkSelector = `li.is-selected`;
|
2186
|
+
this.scrollService.scrollToItem(`#${this.id}_list`, linkSelector);
|
2187
|
+
});
|
2188
|
+
}
|
2189
|
+
moveHighlightedUpOrDown(event) {
|
2190
|
+
switch (event.key) {
|
2191
|
+
case 'ArrowUp':
|
2192
|
+
case 'Up':
|
2193
|
+
if (this.highlightedItemIndex > -1) {
|
2194
|
+
this.highlightedItemIndex--;
|
2195
|
+
}
|
2196
|
+
break;
|
2197
|
+
case 'ArrowDown':
|
2198
|
+
case 'Down':
|
2199
|
+
if (this.highlightedItemIndex < this.selectableItems.length - 1) {
|
2200
|
+
this.highlightedItemIndex++;
|
2201
|
+
}
|
2202
|
+
break;
|
2203
|
+
default:
|
2204
|
+
return;
|
1815
2205
|
}
|
1816
|
-
|
1817
|
-
|
2206
|
+
if (this.highlightedItemIndex > -1) {
|
2207
|
+
// Store the item at the current highlight index
|
2208
|
+
this.highlightedItem = this.selectableItems[this.highlightedItemIndex];
|
1818
2209
|
}
|
1819
|
-
|
1820
|
-
|
1821
|
-
/**
|
1822
|
-
* The url of the NavItem to check for activeness. Convert the item url into a
|
1823
|
-
* UrlTree relative to the ActivatedRoute so router#isActive works even with relative urls.
|
1824
|
-
* See Angular's [routerLink](https://github.com/angular/angular/blob/8282e15c2becbe42a49befa07d6407247e8243d8/packages/router/src/directives/router_link.ts#L249)
|
1825
|
-
* and [routerLinkActive](https://github.com/angular/angular/blob/8282e15c2becbe42a49befa07d6407247e8243d8/packages/router/src/directives/router_link_active.ts#L139)
|
1826
|
-
* for a similiar implementation.
|
1827
|
-
*/
|
1828
|
-
set url(value) {
|
1829
|
-
if (value !== null && value !== undefined) {
|
1830
|
-
this._url = this.router.createUrlTree([value], { relativeTo: this.route, queryParams: this.queryParams });
|
1831
|
-
this.update();
|
2210
|
+
else {
|
2211
|
+
this.highlightedItem = null;
|
1832
2212
|
}
|
2213
|
+
this.scrollToHighlightedItem();
|
1833
2214
|
}
|
1834
|
-
|
1835
|
-
|
1836
|
-
|
1837
|
-
|
1838
|
-
|
1839
|
-
|
1840
|
-
|
1841
|
-
|
1842
|
-
|
1843
|
-
|
2215
|
+
/**
|
2216
|
+
* Scroll to the specified menu item.
|
2217
|
+
* If no item is provided, it will scroll to the first item.
|
2218
|
+
*
|
2219
|
+
* @param item The menu item to scroll to.
|
2220
|
+
* @memberof MenuComponent
|
2221
|
+
*/
|
2222
|
+
scrollMenu(item) {
|
2223
|
+
if (this.items.length > 0 && this.id) {
|
2224
|
+
item = item ? item : this.items[0];
|
2225
|
+
let itemId = item.id ? item.id : MenuComponent.getIndexedItemId(this.items, item, this.id);
|
2226
|
+
this.scrollService.scrollItemCentered(`#${this.id}_list`, `#${itemId}`);
|
2227
|
+
}
|
1844
2228
|
}
|
1845
|
-
|
1846
|
-
|
1847
|
-
this.router.events.pipe(takeUntil(this.destroyed), filter(e => e instanceof NavigationEnd)).subscribe(() => {
|
1848
|
-
this.update();
|
1849
|
-
});
|
2229
|
+
scrollToHighlightedItem() {
|
2230
|
+
this.scrollMenu(this.highlightedItem);
|
1850
2231
|
}
|
1851
|
-
|
1852
|
-
|
1853
|
-
this.
|
2232
|
+
addKeydownListener() {
|
2233
|
+
// Only attempt to add the listener if keyboard nav is enabled
|
2234
|
+
if (this.enableKeyNav) {
|
2235
|
+
// renderer.listen adds the listener and returns a function to remove it from the renderer.
|
2236
|
+
// The listener remains active until this function is called.
|
2237
|
+
this.removeKeydownListener = this.renderer.listen('document', 'keydown', (event) => this.keyNavigate(event));
|
2238
|
+
}
|
1854
2239
|
}
|
1855
|
-
/**
|
1856
|
-
|
1857
|
-
|
1858
|
-
|
1859
|
-
|
1860
|
-
|
1861
|
-
|
1862
|
-
|
1863
|
-
this.renderer.removeClass(this.el.nativeElement, this.classValue);
|
1864
|
-
}
|
2240
|
+
/**
|
2241
|
+
* Sets the menu item ids using its index if item doesn't already have one
|
2242
|
+
*/
|
2243
|
+
setItemIds() {
|
2244
|
+
if (this.items) {
|
2245
|
+
this.items.forEach((item, index) => {
|
2246
|
+
item.id = item.id ? item.id : this.id + '_item' + index;
|
2247
|
+
});
|
1865
2248
|
}
|
1866
2249
|
}
|
1867
2250
|
}
|
1868
|
-
|
1869
|
-
NavItemActiveDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: NavItemActiveDirective, selector: "[ecNavItemActive]", inputs: { classValue: ["ecNavItemActive", "classValue"], exact: ["ecNavItemActiveExactMatch", "exact"], queryParams: ["ecNavItemActiveQueryParams", "queryParams"], url: ["ecNavItemActiveUrl", "url"] }, outputs: { routerLinkActivated: "routerLinkActivated" }, ngImport: i0 });
|
1870
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type:
|
1871
|
-
type:
|
1872
|
-
args: [{
|
1873
|
-
|
1874
|
-
|
1875
|
-
|
1876
|
-
type:
|
1877
|
-
args: ['
|
1878
|
-
}],
|
1879
|
-
type: Input
|
1880
|
-
|
1881
|
-
|
1882
|
-
|
1883
|
-
|
1884
|
-
}],
|
1885
|
-
type: Input
|
1886
|
-
|
1887
|
-
|
2251
|
+
MenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MenuComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: WindowService }, { token: ScrollService }], target: i0.ɵɵFactoryTarget.Component });
|
2252
|
+
MenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: MenuComponent, selector: "ec-menu", inputs: { id: "id", items: "items", selected: "selected", parent: "parent", templateType: "templateType", customMenuTemplate: "customMenuTemplate", title: "title", showNoItems: "showNoItems", noDataText: "noDataText", enableKeyNav: "enableKeyNav", highlightedItem: "highlightedItem", maintainSelectedItem: "maintainSelectedItem", truncateItems: "truncateItems", preserveIconSpace: "preserveIconSpace", dropdownToggleButton: "dropdownToggleButton" }, outputs: { selectedChanged: "selectedChanged", menuClosed: "menuClosed" }, host: { properties: { "attr.id": "this.attrId" } }, viewQueries: [{ propertyName: "labelTemplate", first: true, predicate: ["label"], descendants: true, static: true }, { propertyName: "iconAndLabelTemplate", first: true, predicate: ["iconAndLabel"], descendants: true, static: true }, { propertyName: "checkAndLabelTemplate", first: true, predicate: ["checkAndLabel"], descendants: true, static: true }, { propertyName: "iconLabelCaptionTemplate", first: true, predicate: ["iconLabelCaption"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<nav>\r\n <div class=\"parent\"\r\n [class.no-data]=\"showNoItems && (!items || items.length === 0)\">\r\n <header id=\"{{id}}_header\"\r\n class=\"text-heading-3 p-1\"\r\n [class.is-selected]=\"highlightedItemIndex === -1\"\r\n *ngIf=\"parent\"\r\n (click)=\"back($event)\">\r\n <div class=\"item-wrapper\">\r\n <i class=\"ec-icon icon-angle-down rotate-90 flex-shrink\"></i>\r\n <span class=\"label text-truncate flex-grow\">{{parent?.label}}</span>\r\n </div>\r\n </header>\r\n\r\n <ul id=\"{{id}}_list\"\r\n class=\"py-1\">\r\n <ng-container *ngFor=\"let item of items; index as i\">\r\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: {$implicit: item, index: i}\"></ng-container>\r\n\r\n <!-- Show child items under parent item if the item is a heading or divided-section -->\r\n <ng-container *ngIf=\"item.items?.length && (item.display === 'heading' || item.display === 'divided-section')\">\r\n <ng-container *ngFor=\"let childItem of item.items; index as j; first as isFirst; last as isLast\"\r\n [ngTemplateOutlet]=\"itemTemplate\"\r\n [ngTemplateOutletContext]=\"{$implicit: childItem, index: i + '-' + j, isDividedSectionChild: item.display === 'divided-section', isFirst: isFirst, isLast: isLast}\">\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n </ul>\r\n\r\n <p class=\"no-data-message\">{{noDataText | translate}}</p>\r\n </div>\r\n\r\n <!-- Child menu (Rendered to the right) -->\r\n <ec-menu *ngIf=\"selected?.items && selected?.display !== 'heading' && selected?.display !== 'divided-section'\"\r\n id=\"{{id}}_child\"\r\n class=\"child\"\r\n [parent]=\"selected\"\r\n [items]=\"selected?.items\"\r\n [showNoItems]=\"true\"\r\n [templateType]=\"templateType\"\r\n [enableKeyNav]=\"true\"\r\n [truncateItems]=\"truncateItems\"\r\n (selectedChanged)=\"onSelection($event)\"\r\n (menuClosed)=\"toggleChildMenu(false)\">\r\n </ec-menu>\r\n</nav>\r\n\r\n<ng-template #itemTemplate\r\n let-item\r\n let-i=\"index\"\r\n let-isDividedSectionChild=\"isDividedSectionChild\"\r\n let-isFirst=\"isFirst\"\r\n let-isLast=\"isLast\">\r\n <li *ngIf=\"!(item.hideIfNoItems && !item.items?.length) && item.display !== 'divided-section'\"\r\n id=\"{{item.id || id + '_item' + i}}\"\r\n class=\"{{item.display || 'item'}} {{item.classList}}\"\r\n [class.divider-top]=\"item.display === 'divider-top' || (isDividedSectionChild && isFirst)\"\r\n [class.divider]=\"item.display === 'divider' || (isDividedSectionChild && isLast)\"\r\n [attr.disabled]=\"item.disabled\"\r\n [hidden]=\"item.hidden\"\r\n ecNavItemActive=\"is-selected\"\r\n [ecNavItemActiveQueryParams]=\"item.queryParams\"\r\n [ecNavItemActiveUrl]=\"item.url\"\r\n [ecNavItemActiveExactMatch]='item.isActiveExactMatch'\r\n (routerLinkActivated)=\"selectItem($event, item)\"\r\n [ngClass]=\"{'is-highlighted':(selected === item && item?.display !== 'heading') || highlightedItem === item, 'is-link': item.url, 'is-disabled': item.disabled, 'is-readonly': item.readonly, 'is-checked': item.checked, 'text-heading-3': item?.display === 'heading'}\"\r\n (click)=\"selectItem($event, item)\">\r\n\r\n <a *ngIf=\"item.url && !item.externalLink\"\r\n id=\"{{item.id}}_link\"\r\n title=\"{{truncateItems ? item.label : ''}}\"\r\n class=\"item-wrapper\"\r\n [routerLink]=\"item.url\"\r\n [queryParams]=\"item.queryParams || null\"\r\n target=\"{{item.target || '_self'}}\">\r\n <ng-container *ngTemplateOutlet=\"internalizedTemplate; context: {$implicit: item}\"></ng-container>\r\n </a>\r\n\r\n <a *ngIf=\"item.url && item.externalLink\"\r\n id=\"{{item.id}}_link\"\r\n title=\"{{truncateItems ? item.label : ''}}\"\r\n class=\"item-wrapper\"\r\n href=\"{{item.url}}\"\r\n target=\"{{item.target || '_self'}}\">\r\n <ng-container *ngTemplateOutlet=\"internalizedTemplate; context: {$implicit: item}\"></ng-container>\r\n </a>\r\n\r\n <div *ngIf=\"!item.url\"\r\n title=\"{{truncateItems ? item.label : ''}}\"\r\n class=\"item-wrapper\">\r\n <ng-container *ngTemplateOutlet=\"internalizedTemplate; context: {$implicit: item}\"></ng-container>\r\n </div>\r\n </li>\r\n</ng-template>\r\n\r\n<!-- 'label' Item Template -->\r\n<ng-template #label\r\n let-item>\r\n <span id=\"{{item.id}}_label\"\r\n class=\"label\"\r\n [class.text-truncate]=\"truncateItems\">{{item.label}}</span>\r\n\r\n <i class=\"ec-icon icon-angle-down rotate-270\"\r\n *ngIf=\"item?.items && item.display !== 'heading' && item.display !== 'divided-section'\"></i>\r\n</ng-template>\r\n\r\n<!-- 'checkAndLabel' Item Template -->\r\n<ng-template #checkAndLabel\r\n let-item>\r\n\r\n <i class=\"ec-icon icon-check ec-icon-sm\"\r\n *ngIf=\"item.display !== 'heading'\"></i>\r\n\r\n <i class=\"ec-icon {{item.icon}} ml-2\"\r\n *ngIf=\"item.icon\"></i>\r\n\r\n <span id=\"{{item.id}}_label\"\r\n class=\"label\"\r\n [class.text-truncate]=\"truncateItems\">{{item.label}}</span>\r\n\r\n <i class=\"ec-icon icon-angle-down rotate-270\"\r\n *ngIf=\"item?.items && item.display !== 'heading' && item.display !== 'divided-section'\"></i>\r\n</ng-template>\r\n\r\n<!-- 'iconAndLabel' Item Template -->\r\n<ng-template #iconAndLabel\r\n let-item>\r\n <!-- If menuItem.icon exists and is not blank, show the icon in the menu -->\r\n <i class=\"ec-icon {{item.icon}}\"\r\n *ngIf=\"(item.icon && item.icon !== '') || preserveIconSpace\"></i>\r\n\r\n <span id=\"{{item.id}}_label\"\r\n class=\"label\"\r\n [class.text-truncate]=\"truncateItems\">{{item.label}}</span>\r\n\r\n <i class=\"ec-icon icon-angle-down rotate-270\"\r\n *ngIf=\"item?.items && item.display !== 'heading' && item.display !== 'divided-section'\"></i>\r\n</ng-template>\r\n\r\n<ng-template #iconLabelCaption\r\n let-item>\r\n <i class=\"ec-icon {{item.icon}}\"\r\n *ngIf=\"(item.icon && item.icon !== '') || preserveIconSpace\"></i>\r\n <div *ngIf=\"item.display !== 'heading'\"\r\n class=\"label flex-grow\">\r\n <div id=\"{{item.id}}_label\"\r\n class=\"text-body-1\"\r\n [class.text-truncate]=\"truncateItems\">{{item.label}}</div>\r\n <div id=\"{{item.id}}_caption\"\r\n *ngIf=\"item.caption\"\r\n class=\"text-caption-1\"\r\n [class.text-truncate]=\"truncateItems\">{{item.caption}}</div>\r\n </div>\r\n <h3 *ngIf=\"item.display === 'heading'\"\r\n class=\"flex-grow text-heading-3 align-self-center\"\r\n [class.text-truncate]=\"truncateItems\">{{item.label}}</h3>\r\n <i class=\"ec-icon icon-angle-down rotate-270 align-self-center\"\r\n *ngIf=\"item?.items && item.display !== 'heading' && item.display !== 'divided-section'\"></i>\r\n</ng-template>", styles: ["@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}:host{display:block;font-size:var(--ec-menu-font-size, var(--ec-font-size-action));font-weight:400;background-color:var(--ec-menu-background-color, var(--ec-background-color))}:host.open>nav>.parent,:host.open>nav>.child{position:absolute;left:0;top:0;right:0;height:100%;transition:transform .25s ease}:host.open>nav>.parent{transform:translate(0)}:host.open>nav>.child{transform:translate(100%)}:host.open-active>nav>.parent{transform:translate(-100%)}:host.open-active>nav>.child{transform:translate(0)}:host(.bg-transparent){background-color:transparent}:host-context(.is-always-open){height:100%}:host-context(.is-always-open) .item-wrapper{padding-left:1rem;padding-right:1rem}nav{display:flex;position:relative;height:100%;overflow:hidden}.parent{display:flex;flex-direction:column;flex:auto;position:relative;max-width:100%}.parent>header{cursor:pointer}.parent>header.is-selected .item-wrapper,.parent>header.is-highlighted .item-wrapper{background-color:var(--ec-background-color-selected)}.parent>header:hover .item-wrapper{background-color:var(--ec-background-color-hover)}.parent.no-data ul{display:none}.parent.no-data .no-data-message{display:block}ul{padding:0;margin:0;list-style:none;flex:auto;height:100%;overflow-y:auto}ul li{cursor:pointer;padding:0 .25rem}ul li a{color:inherit;border-bottom:0;text-decoration:none}ul li.is-selected .item-wrapper,ul li.is-highlighted .item-wrapper{background-color:var(--ec-background-color-selected)}ul li:hover .item-wrapper{background-color:var(--ec-background-color-hover)}ul li:focus .item-wrapper{outline:none;background-color:var(--ec-color-disabled-dark);position:relative;z-index:1}ul li.is-disabled .item-wrapper{color:var(--ec-color-disabled-dark);opacity:var(--ec-form-control-opacity-disabled)}ul li.is-disabled,ul li.is-readonly{cursor:default}ul li.is-disabled .item-wrapper,ul li.is-readonly .item-wrapper{background-color:transparent;color:inherit}ul li.is-checked .icon-check{opacity:1}ul li.heading{cursor:default}ul li.heading .item-wrapper{background-color:transparent}ul li.heading:not(:first-child){margin-top:.5rem}ul li.divider:not(:last-child){border-bottom:1px solid var(--ec-border-color);padding-bottom:.25rem;margin-bottom:.25rem}ul li.divider-top:not(:first-child):not(.divider + .divider-top){border-top:1px solid var(--ec-border-color);padding-top:.25rem;margin-top:.25rem}ul li.indent-1 .item-wrapper{padding-left:1.5rem}ul li.indent-2 .item-wrapper{padding-left:2.5rem}ul li.indent-3 .item-wrapper{padding-left:3.5rem}.item-wrapper{cursor:inherit;line-height:1.25rem;min-height:1.75rem;padding:.25rem .5rem;border-radius:var(--ec-border-radius);display:flex;color:inherit}.item-wrapper .label{margin-right:auto}.item-wrapper .label+.ec-icon{margin-left:.5rem}.item-wrapper .ec-icon{margin-top:calc((1.25rem - var(--ec-font-size-icon)) / 2);flex:none}.item-wrapper .ec-icon+.label{margin-left:.5rem}.item-wrapper .ec-icon-sm{margin-top:calc((1.25rem - calc(var(--ec-font-size-icon) * .75)) / 2)}.item-wrapper .icon-check{opacity:0}.no-data-message{display:none;text-align:center;padding:1rem;color:var(--ec-color-hint-dark);margin-bottom:0;font-size:var(--ec-font-size-body)}:host-context(ec-tree) ul{overflow-x:hidden}:host-context(ec-tree) li.is-selected,:host-context(ec-tree) li.is-highlighted{font-weight:700;color:var(--ec-menu-color-highlighted, inherit)}:host-context(ec-tree) li.is-selected:not(:hover),:host-context(ec-tree) li.is-highlighted:not(:hover){background-color:transparent}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: NavItemActiveDirective, selector: "[ecNavItemActive]", inputs: ["ecNavItemActive", "ecNavItemActiveExactMatch", "ecNavItemActiveQueryParams", "ecNavItemActiveUrl"], outputs: ["routerLinkActivated"] }, { kind: "component", type: MenuComponent, selector: "ec-menu", inputs: ["id", "items", "selected", "parent", "templateType", "customMenuTemplate", "title", "showNoItems", "noDataText", "enableKeyNav", "highlightedItem", "maintainSelectedItem", "truncateItems", "preserveIconSpace", "dropdownToggleButton"], outputs: ["selectedChanged", "menuClosed"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] });
|
2253
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MenuComponent, decorators: [{
|
2254
|
+
type: Component,
|
2255
|
+
args: [{ selector: 'ec-menu', template: "<nav>\r\n <div class=\"parent\"\r\n [class.no-data]=\"showNoItems && (!items || items.length === 0)\">\r\n <header id=\"{{id}}_header\"\r\n class=\"text-heading-3 p-1\"\r\n [class.is-selected]=\"highlightedItemIndex === -1\"\r\n *ngIf=\"parent\"\r\n (click)=\"back($event)\">\r\n <div class=\"item-wrapper\">\r\n <i class=\"ec-icon icon-angle-down rotate-90 flex-shrink\"></i>\r\n <span class=\"label text-truncate flex-grow\">{{parent?.label}}</span>\r\n </div>\r\n </header>\r\n\r\n <ul id=\"{{id}}_list\"\r\n class=\"py-1\">\r\n <ng-container *ngFor=\"let item of items; index as i\">\r\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: {$implicit: item, index: i}\"></ng-container>\r\n\r\n <!-- Show child items under parent item if the item is a heading or divided-section -->\r\n <ng-container *ngIf=\"item.items?.length && (item.display === 'heading' || item.display === 'divided-section')\">\r\n <ng-container *ngFor=\"let childItem of item.items; index as j; first as isFirst; last as isLast\"\r\n [ngTemplateOutlet]=\"itemTemplate\"\r\n [ngTemplateOutletContext]=\"{$implicit: childItem, index: i + '-' + j, isDividedSectionChild: item.display === 'divided-section', isFirst: isFirst, isLast: isLast}\">\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n </ul>\r\n\r\n <p class=\"no-data-message\">{{noDataText | translate}}</p>\r\n </div>\r\n\r\n <!-- Child menu (Rendered to the right) -->\r\n <ec-menu *ngIf=\"selected?.items && selected?.display !== 'heading' && selected?.display !== 'divided-section'\"\r\n id=\"{{id}}_child\"\r\n class=\"child\"\r\n [parent]=\"selected\"\r\n [items]=\"selected?.items\"\r\n [showNoItems]=\"true\"\r\n [templateType]=\"templateType\"\r\n [enableKeyNav]=\"true\"\r\n [truncateItems]=\"truncateItems\"\r\n (selectedChanged)=\"onSelection($event)\"\r\n (menuClosed)=\"toggleChildMenu(false)\">\r\n </ec-menu>\r\n</nav>\r\n\r\n<ng-template #itemTemplate\r\n let-item\r\n let-i=\"index\"\r\n let-isDividedSectionChild=\"isDividedSectionChild\"\r\n let-isFirst=\"isFirst\"\r\n let-isLast=\"isLast\">\r\n <li *ngIf=\"!(item.hideIfNoItems && !item.items?.length) && item.display !== 'divided-section'\"\r\n id=\"{{item.id || id + '_item' + i}}\"\r\n class=\"{{item.display || 'item'}} {{item.classList}}\"\r\n [class.divider-top]=\"item.display === 'divider-top' || (isDividedSectionChild && isFirst)\"\r\n [class.divider]=\"item.display === 'divider' || (isDividedSectionChild && isLast)\"\r\n [attr.disabled]=\"item.disabled\"\r\n [hidden]=\"item.hidden\"\r\n ecNavItemActive=\"is-selected\"\r\n [ecNavItemActiveQueryParams]=\"item.queryParams\"\r\n [ecNavItemActiveUrl]=\"item.url\"\r\n [ecNavItemActiveExactMatch]='item.isActiveExactMatch'\r\n (routerLinkActivated)=\"selectItem($event, item)\"\r\n [ngClass]=\"{'is-highlighted':(selected === item && item?.display !== 'heading') || highlightedItem === item, 'is-link': item.url, 'is-disabled': item.disabled, 'is-readonly': item.readonly, 'is-checked': item.checked, 'text-heading-3': item?.display === 'heading'}\"\r\n (click)=\"selectItem($event, item)\">\r\n\r\n <a *ngIf=\"item.url && !item.externalLink\"\r\n id=\"{{item.id}}_link\"\r\n title=\"{{truncateItems ? item.label : ''}}\"\r\n class=\"item-wrapper\"\r\n [routerLink]=\"item.url\"\r\n [queryParams]=\"item.queryParams || null\"\r\n target=\"{{item.target || '_self'}}\">\r\n <ng-container *ngTemplateOutlet=\"internalizedTemplate; context: {$implicit: item}\"></ng-container>\r\n </a>\r\n\r\n <a *ngIf=\"item.url && item.externalLink\"\r\n id=\"{{item.id}}_link\"\r\n title=\"{{truncateItems ? item.label : ''}}\"\r\n class=\"item-wrapper\"\r\n href=\"{{item.url}}\"\r\n target=\"{{item.target || '_self'}}\">\r\n <ng-container *ngTemplateOutlet=\"internalizedTemplate; context: {$implicit: item}\"></ng-container>\r\n </a>\r\n\r\n <div *ngIf=\"!item.url\"\r\n title=\"{{truncateItems ? item.label : ''}}\"\r\n class=\"item-wrapper\">\r\n <ng-container *ngTemplateOutlet=\"internalizedTemplate; context: {$implicit: item}\"></ng-container>\r\n </div>\r\n </li>\r\n</ng-template>\r\n\r\n<!-- 'label' Item Template -->\r\n<ng-template #label\r\n let-item>\r\n <span id=\"{{item.id}}_label\"\r\n class=\"label\"\r\n [class.text-truncate]=\"truncateItems\">{{item.label}}</span>\r\n\r\n <i class=\"ec-icon icon-angle-down rotate-270\"\r\n *ngIf=\"item?.items && item.display !== 'heading' && item.display !== 'divided-section'\"></i>\r\n</ng-template>\r\n\r\n<!-- 'checkAndLabel' Item Template -->\r\n<ng-template #checkAndLabel\r\n let-item>\r\n\r\n <i class=\"ec-icon icon-check ec-icon-sm\"\r\n *ngIf=\"item.display !== 'heading'\"></i>\r\n\r\n <i class=\"ec-icon {{item.icon}} ml-2\"\r\n *ngIf=\"item.icon\"></i>\r\n\r\n <span id=\"{{item.id}}_label\"\r\n class=\"label\"\r\n [class.text-truncate]=\"truncateItems\">{{item.label}}</span>\r\n\r\n <i class=\"ec-icon icon-angle-down rotate-270\"\r\n *ngIf=\"item?.items && item.display !== 'heading' && item.display !== 'divided-section'\"></i>\r\n</ng-template>\r\n\r\n<!-- 'iconAndLabel' Item Template -->\r\n<ng-template #iconAndLabel\r\n let-item>\r\n <!-- If menuItem.icon exists and is not blank, show the icon in the menu -->\r\n <i class=\"ec-icon {{item.icon}}\"\r\n *ngIf=\"(item.icon && item.icon !== '') || preserveIconSpace\"></i>\r\n\r\n <span id=\"{{item.id}}_label\"\r\n class=\"label\"\r\n [class.text-truncate]=\"truncateItems\">{{item.label}}</span>\r\n\r\n <i class=\"ec-icon icon-angle-down rotate-270\"\r\n *ngIf=\"item?.items && item.display !== 'heading' && item.display !== 'divided-section'\"></i>\r\n</ng-template>\r\n\r\n<ng-template #iconLabelCaption\r\n let-item>\r\n <i class=\"ec-icon {{item.icon}}\"\r\n *ngIf=\"(item.icon && item.icon !== '') || preserveIconSpace\"></i>\r\n <div *ngIf=\"item.display !== 'heading'\"\r\n class=\"label flex-grow\">\r\n <div id=\"{{item.id}}_label\"\r\n class=\"text-body-1\"\r\n [class.text-truncate]=\"truncateItems\">{{item.label}}</div>\r\n <div id=\"{{item.id}}_caption\"\r\n *ngIf=\"item.caption\"\r\n class=\"text-caption-1\"\r\n [class.text-truncate]=\"truncateItems\">{{item.caption}}</div>\r\n </div>\r\n <h3 *ngIf=\"item.display === 'heading'\"\r\n class=\"flex-grow text-heading-3 align-self-center\"\r\n [class.text-truncate]=\"truncateItems\">{{item.label}}</h3>\r\n <i class=\"ec-icon icon-angle-down rotate-270 align-self-center\"\r\n *ngIf=\"item?.items && item.display !== 'heading' && item.display !== 'divided-section'\"></i>\r\n</ng-template>", styles: ["@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}:host{display:block;font-size:var(--ec-menu-font-size, var(--ec-font-size-action));font-weight:400;background-color:var(--ec-menu-background-color, var(--ec-background-color))}:host.open>nav>.parent,:host.open>nav>.child{position:absolute;left:0;top:0;right:0;height:100%;transition:transform .25s ease}:host.open>nav>.parent{transform:translate(0)}:host.open>nav>.child{transform:translate(100%)}:host.open-active>nav>.parent{transform:translate(-100%)}:host.open-active>nav>.child{transform:translate(0)}:host(.bg-transparent){background-color:transparent}:host-context(.is-always-open){height:100%}:host-context(.is-always-open) .item-wrapper{padding-left:1rem;padding-right:1rem}nav{display:flex;position:relative;height:100%;overflow:hidden}.parent{display:flex;flex-direction:column;flex:auto;position:relative;max-width:100%}.parent>header{cursor:pointer}.parent>header.is-selected .item-wrapper,.parent>header.is-highlighted .item-wrapper{background-color:var(--ec-background-color-selected)}.parent>header:hover .item-wrapper{background-color:var(--ec-background-color-hover)}.parent.no-data ul{display:none}.parent.no-data .no-data-message{display:block}ul{padding:0;margin:0;list-style:none;flex:auto;height:100%;overflow-y:auto}ul li{cursor:pointer;padding:0 .25rem}ul li a{color:inherit;border-bottom:0;text-decoration:none}ul li.is-selected .item-wrapper,ul li.is-highlighted .item-wrapper{background-color:var(--ec-background-color-selected)}ul li:hover .item-wrapper{background-color:var(--ec-background-color-hover)}ul li:focus .item-wrapper{outline:none;background-color:var(--ec-color-disabled-dark);position:relative;z-index:1}ul li.is-disabled .item-wrapper{color:var(--ec-color-disabled-dark);opacity:var(--ec-form-control-opacity-disabled)}ul li.is-disabled,ul li.is-readonly{cursor:default}ul li.is-disabled .item-wrapper,ul li.is-readonly .item-wrapper{background-color:transparent;color:inherit}ul li.is-checked .icon-check{opacity:1}ul li.heading{cursor:default}ul li.heading .item-wrapper{background-color:transparent}ul li.heading:not(:first-child){margin-top:.5rem}ul li.divider:not(:last-child){border-bottom:1px solid var(--ec-border-color);padding-bottom:.25rem;margin-bottom:.25rem}ul li.divider-top:not(:first-child):not(.divider + .divider-top){border-top:1px solid var(--ec-border-color);padding-top:.25rem;margin-top:.25rem}ul li.indent-1 .item-wrapper{padding-left:1.5rem}ul li.indent-2 .item-wrapper{padding-left:2.5rem}ul li.indent-3 .item-wrapper{padding-left:3.5rem}.item-wrapper{cursor:inherit;line-height:1.25rem;min-height:1.75rem;padding:.25rem .5rem;border-radius:var(--ec-border-radius);display:flex;color:inherit}.item-wrapper .label{margin-right:auto}.item-wrapper .label+.ec-icon{margin-left:.5rem}.item-wrapper .ec-icon{margin-top:calc((1.25rem - var(--ec-font-size-icon)) / 2);flex:none}.item-wrapper .ec-icon+.label{margin-left:.5rem}.item-wrapper .ec-icon-sm{margin-top:calc((1.25rem - calc(var(--ec-font-size-icon) * .75)) / 2)}.item-wrapper .icon-check{opacity:0}.no-data-message{display:none;text-align:center;padding:1rem;color:var(--ec-color-hint-dark);margin-bottom:0;font-size:var(--ec-font-size-body)}:host-context(ec-tree) ul{overflow-x:hidden}:host-context(ec-tree) li.is-selected,:host-context(ec-tree) li.is-highlighted{font-weight:700;color:var(--ec-menu-color-highlighted, inherit)}:host-context(ec-tree) li.is-selected:not(:hover),:host-context(ec-tree) li.is-highlighted:not(:hover){background-color:transparent}\n"] }]
|
2256
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: WindowService }, { type: ScrollService }]; }, propDecorators: { id: [{
|
2257
|
+
type: Input
|
2258
|
+
}], attrId: [{
|
2259
|
+
type: HostBinding,
|
2260
|
+
args: ['attr.id']
|
2261
|
+
}], items: [{
|
2262
|
+
type: Input
|
2263
|
+
}], selected: [{
|
2264
|
+
type: Input
|
2265
|
+
}], parent: [{
|
2266
|
+
type: Input
|
2267
|
+
}], templateType: [{
|
2268
|
+
type: Input
|
2269
|
+
}], customMenuTemplate: [{
|
2270
|
+
type: Input
|
2271
|
+
}], title: [{
|
2272
|
+
type: Input
|
2273
|
+
}], showNoItems: [{
|
2274
|
+
type: Input
|
2275
|
+
}], noDataText: [{
|
2276
|
+
type: Input
|
2277
|
+
}], enableKeyNav: [{
|
2278
|
+
type: Input
|
2279
|
+
}], highlightedItem: [{
|
2280
|
+
type: Input
|
2281
|
+
}], maintainSelectedItem: [{
|
2282
|
+
type: Input
|
2283
|
+
}], truncateItems: [{
|
2284
|
+
type: Input
|
2285
|
+
}], preserveIconSpace: [{
|
2286
|
+
type: Input
|
2287
|
+
}], dropdownToggleButton: [{
|
2288
|
+
type: Input
|
2289
|
+
}], selectedChanged: [{
|
1888
2290
|
type: Output
|
2291
|
+
}], menuClosed: [{
|
2292
|
+
type: Output
|
2293
|
+
}], labelTemplate: [{
|
2294
|
+
type: ViewChild,
|
2295
|
+
args: ['label', { static: true }]
|
2296
|
+
}], iconAndLabelTemplate: [{
|
2297
|
+
type: ViewChild,
|
2298
|
+
args: ['iconAndLabel', { static: true }]
|
2299
|
+
}], checkAndLabelTemplate: [{
|
2300
|
+
type: ViewChild,
|
2301
|
+
args: ['checkAndLabel', { static: true }]
|
2302
|
+
}], iconLabelCaptionTemplate: [{
|
2303
|
+
type: ViewChild,
|
2304
|
+
args: ['iconLabelCaption', { static: true }]
|
1889
2305
|
}] } });
|
1890
2306
|
|
1891
|
-
;
|
1892
|
-
const menuAnimationSpeed = 350;
|
1893
2307
|
/**
|
1894
|
-
* Primitive
|
2308
|
+
* Primitive directive that popups a container using PopperJS
|
1895
2309
|
*
|
1896
2310
|
* @export
|
1897
2311
|
*/
|
1898
|
-
class
|
1899
|
-
|
1900
|
-
|
2312
|
+
class PopupContainerDirective {
|
2313
|
+
/**
|
2314
|
+
* Creates an instance of PopupContainerDirective.
|
2315
|
+
* @param templateRef Reference to the popup template
|
2316
|
+
* @param viewContainer Reference to the view container
|
2317
|
+
* @param document Reference to Document
|
2318
|
+
* @memberof PopupContainerDirective
|
2319
|
+
*/
|
2320
|
+
constructor(templateRef, viewContainer, document, renderer) {
|
2321
|
+
this.templateRef = templateRef;
|
2322
|
+
this.viewContainer = viewContainer;
|
2323
|
+
this.document = document;
|
1901
2324
|
this.renderer = renderer;
|
1902
|
-
this.windowService = windowService;
|
1903
|
-
this.scrollService = scrollService;
|
1904
|
-
/**
|
1905
|
-
* Array of items to display
|
1906
|
-
*
|
1907
|
-
* @memberof MenuComponent
|
1908
|
-
*/
|
1909
|
-
this.items = [];
|
1910
|
-
/**
|
1911
|
-
* Selected item; annotates the item
|
1912
|
-
* when displayed with 'selected' class
|
1913
|
-
*
|
1914
|
-
* @memberof MenuComponent
|
1915
|
-
*/
|
1916
|
-
this.selected = null;
|
1917
|
-
/**
|
1918
|
-
* Display template
|
1919
|
-
*
|
1920
|
-
* @memberof MenuComponent
|
1921
|
-
*/
|
1922
|
-
this.templateType = 'label';
|
1923
|
-
/**
|
1924
|
-
* Show message when there are no items
|
1925
|
-
*/
|
1926
|
-
this.showNoItems = false;
|
1927
|
-
/**
|
1928
|
-
* Text to show when menu is empty and showNoItems is true
|
1929
|
-
*/
|
1930
|
-
this.noDataText = 'NoItems_TC';
|
1931
|
-
/**
|
1932
|
-
* Controls whether keyboard navigation is enabled
|
1933
|
-
*/
|
1934
|
-
this.enableKeyNav = false;
|
1935
|
-
/**
|
1936
|
-
* Item currently highlighted by keyboard navigation
|
1937
|
-
*/
|
1938
|
-
this.highlightedItem = null;
|
1939
|
-
/**
|
1940
|
-
* Tells the menu to maintain the selected/lastSelected item. Turning this off is useful for
|
1941
|
-
* action type menus that are displayed on the screen at all times and you do not
|
1942
|
-
* want the item to be selected when clicked.
|
1943
|
-
*/
|
1944
|
-
this.maintainSelectedItem = true;
|
1945
|
-
/**
|
1946
|
-
* Will prevent text-wrapping of menu items and truncate instead. Also turns on a tooltip for the menu item. Default: false;
|
1947
|
-
*/
|
1948
|
-
this.truncateItems = false;
|
1949
|
-
/**
|
1950
|
-
* When true, the space for the icon is preserved for menu items that do not have icons.
|
1951
|
-
* Only applicable for iconAndLabel menus.
|
1952
|
-
*/
|
1953
|
-
this.preserveIconSpace = false;
|
1954
|
-
/**
|
1955
|
-
* Emitted when `selected` is changed. Emits the referenced object.
|
1956
|
-
*
|
1957
|
-
* @memberof MenuComponent
|
1958
|
-
*/
|
1959
|
-
this.selectedChanged = new EventEmitter();
|
1960
|
-
/**
|
1961
|
-
* Emitted when the menu has a parent and back is clicked
|
1962
|
-
* @memberof MenuComponent
|
1963
|
-
*/
|
1964
|
-
this.menuClosed = new EventEmitter();
|
1965
|
-
/**
|
1966
|
-
* Index of the item currently highlighted using keyboard nav
|
1967
|
-
*/
|
1968
|
-
this.highlightedItemIndex = -1;
|
1969
2325
|
/**
|
1970
|
-
*
|
1971
|
-
* This isn't necessarily the same as this.selected, because this.selected is an input property
|
1972
|
-
* and could have been changed by a consumer through some means other than selectItem().
|
1973
|
-
* This allows us to prevent double-calls to selectItem() with the same input.
|
2326
|
+
* Emit the {@link PopupStatus} when it changes
|
1974
2327
|
*/
|
1975
|
-
this.
|
2328
|
+
this.popperStatusChange = new EventEmitter();
|
1976
2329
|
}
|
1977
2330
|
/**
|
1978
|
-
*
|
1979
|
-
*
|
1980
|
-
|
2331
|
+
* Angular onInit lifecycle hook
|
2332
|
+
* @see https://angular.io/guide/lifecycle-hooks
|
2333
|
+
*/
|
2334
|
+
ngOnInit() {
|
2335
|
+
this.templateViewRef = this.viewContainer.createEmbeddedView(this.templateRef);
|
2336
|
+
}
|
2337
|
+
/**
|
2338
|
+
* Angular onDestroy lifecycle hook. Close and delete references. Unsubscribe observables
|
2339
|
+
* @see https://angular.io/guide/lifecycle-hooks
|
2340
|
+
*/
|
2341
|
+
ngOnDestroy() {
|
2342
|
+
this.hide();
|
2343
|
+
}
|
2344
|
+
/**
|
2345
|
+
* Displays the templateRef as a popup
|
1981
2346
|
*
|
1982
|
-
* @memberof
|
2347
|
+
* @memberof PopupContainerDirective
|
1983
2348
|
*/
|
1984
|
-
|
1985
|
-
|
1986
|
-
|
1987
|
-
|
1988
|
-
|
1989
|
-
|
1990
|
-
this.internalizedTemplate = this.iconAndLabelTemplate;
|
1991
|
-
break;
|
1992
|
-
case ("checkAndLabel"):
|
1993
|
-
this.internalizedTemplate = this.checkAndLabelTemplate;
|
1994
|
-
break;
|
1995
|
-
case ("iconLabelCaption"):
|
1996
|
-
this.internalizedTemplate = this.iconLabelCaptionTemplate;
|
1997
|
-
break;
|
1998
|
-
default:
|
1999
|
-
throw new Error(`Invalid templateType for MenuComponent. Please use either: 'label', 'iconAndLabel' or 'checkAndLabel'`);
|
2000
|
-
}
|
2001
|
-
//if the consumer provided a menuItemTemplate, override the internalizedTemplate with that.
|
2002
|
-
if (this.customMenuTemplate) {
|
2003
|
-
this.internalizedTemplate = this.customMenuTemplate;
|
2349
|
+
show() {
|
2350
|
+
if (PopupContainerDirective.GlobalPopupRef) {
|
2351
|
+
if (PopupContainerDirective.GlobalPopupRef != this) {
|
2352
|
+
PopupContainerDirective.GlobalPopupRef.hide();
|
2353
|
+
PopupContainerDirective.GlobalPopupRef = undefined;
|
2354
|
+
}
|
2004
2355
|
}
|
2005
|
-
if (this.
|
2006
|
-
this.
|
2356
|
+
if (!this.globalCloseSubscription) {
|
2357
|
+
this.globalCloseSubscription = fromEvent(this.document.body, "click").subscribe((event) => {
|
2358
|
+
this.hide();
|
2359
|
+
});
|
2007
2360
|
}
|
2008
|
-
this.
|
2009
|
-
|
2010
|
-
|
2361
|
+
if (!this.popperRef) {
|
2362
|
+
// Add the popper template as an embedded view since PopperJS
|
2363
|
+
// manipulates DOM elements.
|
2364
|
+
this.popupViewRef = this.viewContainer.createEmbeddedView(this.popup);
|
2365
|
+
// Since popper needs real DOM elements, grab the first non-comment
|
2366
|
+
// DOM element to use as our anchor.
|
2367
|
+
let anchorElement = this.popupViewRef.rootNodes.find(elem => { return elem.nodeName !== "#text"; });
|
2368
|
+
// Use the parents elements as our DOM elements to Popper
|
2369
|
+
this.popperRef = new Popper(this.templateViewRef.rootNodes[0], anchorElement, this.popperOptions);
|
2370
|
+
PopupContainerDirective.GlobalPopupRef = this;
|
2371
|
+
this.popperStatusChange.emit('visible');
|
2011
2372
|
}
|
2012
|
-
this.addKeydownListener();
|
2013
2373
|
}
|
2014
|
-
|
2015
|
-
|
2016
|
-
|
2017
|
-
|
2374
|
+
/**
|
2375
|
+
* Hides the templateRef
|
2376
|
+
*
|
2377
|
+
* @memberof PopupContainerDirective
|
2378
|
+
*/
|
2379
|
+
hide() {
|
2380
|
+
if (this.globalCloseSubscription) {
|
2381
|
+
this.globalCloseSubscription.unsubscribe();
|
2382
|
+
this.globalCloseSubscription = undefined;
|
2383
|
+
}
|
2384
|
+
if (this.popperRef && this.popupViewRef) {
|
2385
|
+
this.popupViewRef.destroy();
|
2386
|
+
this.popperRef.destroy();
|
2387
|
+
this.popperRef = undefined;
|
2388
|
+
this.popperStatusChange.emit('hidden');
|
2018
2389
|
}
|
2019
2390
|
}
|
2020
2391
|
/**
|
2021
|
-
*
|
2022
|
-
* the item's click method if defined, or emit the selected item.
|
2023
|
-
*
|
2024
|
-
* @param item The selected item
|
2025
|
-
* @memberof MenuComponent
|
2392
|
+
* Updates the popup container position
|
2026
2393
|
*/
|
2027
|
-
|
2028
|
-
|
2029
|
-
|
2030
|
-
|
2031
|
-
|
2032
|
-
|
2033
|
-
|
2034
|
-
|
2035
|
-
|
2036
|
-
|
2037
|
-
|
2038
|
-
|
2039
|
-
|
2040
|
-
|
2041
|
-
|
2394
|
+
update() {
|
2395
|
+
if (this.popperRef) {
|
2396
|
+
this.popperRef.update();
|
2397
|
+
}
|
2398
|
+
}
|
2399
|
+
fixPosition(minWidthNone, appendToBody = false) {
|
2400
|
+
if (this.popperRef && this.popperRef['reference'] && this.popperRef['popper']) {
|
2401
|
+
let popupEl = this.popperRef['popper'];
|
2402
|
+
// Reset width style previously assigned because the content may have
|
2403
|
+
// changed and the auto width would be different
|
2404
|
+
this.renderer.removeStyle(popupEl, 'width');
|
2405
|
+
this.renderer.setStyle(popupEl, 'position', 'fixed');
|
2406
|
+
if (appendToBody) {
|
2407
|
+
const bodyEl = this.document.querySelector('body');
|
2408
|
+
const popupParent = this.renderer.parentNode(popupEl);
|
2409
|
+
if (popupParent !== bodyEl) {
|
2410
|
+
this.renderer.appendChild(bodyEl, popupEl);
|
2042
2411
|
}
|
2043
|
-
// We need to manually handle the url navigation if the keyboard was used
|
2044
2412
|
}
|
2045
|
-
|
2046
|
-
|
2047
|
-
|
2413
|
+
let toggleEl = this.popperRef['reference'];
|
2414
|
+
let width = popupEl.offsetWidth;
|
2415
|
+
let boundaries = popupEl.getBoundingClientRect();
|
2416
|
+
let left = boundaries.left;
|
2417
|
+
let coords = toggleEl.getBoundingClientRect();
|
2418
|
+
// Set the top of our menu to the bottom of the toggle element
|
2419
|
+
let top = coords.bottom;
|
2420
|
+
if (this.popperOptions && this.popperOptions.placement) {
|
2421
|
+
if (this.popperOptions.placement === 'bottom-start' || this.popperOptions.placement === 'top-start') {
|
2422
|
+
left = coords.left;
|
2048
2423
|
}
|
2049
2424
|
else {
|
2050
|
-
|
2425
|
+
left = coords.right - ((minWidthNone || width > coords.width) ? width : coords.width);
|
2051
2426
|
}
|
2052
|
-
// Emit so upstream components know an item was selected
|
2053
|
-
this.onSelection(item);
|
2054
|
-
}
|
2055
|
-
else {
|
2056
|
-
this.onSelection(item);
|
2057
2427
|
}
|
2058
|
-
if (
|
2059
|
-
|
2060
|
-
|
2428
|
+
// if it won't fit (with 10px space before hitting the window edge), flip it
|
2429
|
+
if (boundaries.height + top + 10 > window.innerHeight) {
|
2430
|
+
top = coords.top - boundaries.height;
|
2061
2431
|
}
|
2062
|
-
|
2063
|
-
|
2064
|
-
|
2432
|
+
this.renderer.setStyle(popupEl, 'transform', 'none');
|
2433
|
+
this.renderer.setStyle(popupEl, 'left', left + 'px');
|
2434
|
+
this.renderer.setStyle(popupEl, 'top', top + 'px');
|
2435
|
+
this.renderer.setStyle(popupEl, 'width', width + 'px');
|
2436
|
+
if (!minWidthNone) {
|
2437
|
+
this.renderer.setStyle(popupEl, 'min-width', coords.width + 'px');
|
2065
2438
|
}
|
2066
2439
|
}
|
2067
2440
|
}
|
2068
|
-
|
2069
|
-
|
2070
|
-
|
2071
|
-
|
2072
|
-
|
2073
|
-
|
2074
|
-
|
2075
|
-
|
2441
|
+
}
|
2442
|
+
/**
|
2443
|
+
* Global reference to the currently displayed popup; only
|
2444
|
+
* one popup directive can be in `show` state at a given time.
|
2445
|
+
*
|
2446
|
+
* @memberof PopupContainerDirective
|
2447
|
+
*/
|
2448
|
+
PopupContainerDirective.GlobalPopupRef = undefined;
|
2449
|
+
PopupContainerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PopupContainerDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: DOCUMENT }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
|
2450
|
+
PopupContainerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: PopupContainerDirective, selector: "[ecPopup]", inputs: { popup: ["ecPopup", "popup"], popperOptions: ["options", "popperOptions"] }, ngImport: i0 });
|
2451
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PopupContainerDirective, decorators: [{
|
2452
|
+
type: Directive,
|
2453
|
+
args: [{ selector: '[ecPopup]' }]
|
2454
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }, { type: undefined, decorators: [{
|
2455
|
+
type: Inject,
|
2456
|
+
args: [DOCUMENT]
|
2457
|
+
}] }, { type: i0.Renderer2 }]; }, propDecorators: { popup: [{
|
2458
|
+
type: Input,
|
2459
|
+
args: ['ecPopup']
|
2460
|
+
}], popperOptions: [{
|
2461
|
+
type: Input,
|
2462
|
+
args: ['options']
|
2463
|
+
}] } });
|
2464
|
+
|
2465
|
+
/** Advanced validation for textbox form controls */
|
2466
|
+
const textboxValidation = (validatorParams) => {
|
2467
|
+
return (control) => {
|
2468
|
+
let validators = [];
|
2469
|
+
// Innocent until proven guilty
|
2470
|
+
validatorParams.valid = true;
|
2471
|
+
if (validatorParams.required) {
|
2472
|
+
validators.push(Validators.required);
|
2076
2473
|
}
|
2077
|
-
|
2078
|
-
|
2079
|
-
/**
|
2080
|
-
* Emit the selected item
|
2081
|
-
* @param item The selected item
|
2082
|
-
*/
|
2083
|
-
onSelection(item) {
|
2084
|
-
if (item.display !== 'heading') {
|
2085
|
-
this.selectedChanged.emit(item);
|
2474
|
+
if (validatorParams.minLength !== undefined) {
|
2475
|
+
validators.push(Validators.minLength(validatorParams.minLength));
|
2086
2476
|
}
|
2087
|
-
|
2088
|
-
|
2089
|
-
* Open or close the child menu. When the child menu closes, the selected
|
2090
|
-
* item is reset.
|
2091
|
-
* @memberof MenuComponent
|
2092
|
-
*/
|
2093
|
-
toggleChildMenu(open) {
|
2094
|
-
let navEl = this.el.nativeElement.querySelector('nav');
|
2095
|
-
if (open) {
|
2096
|
-
// Remove the listener on the parent menu when a child menu is opened
|
2097
|
-
// This is to avoid interference between the parent and child menus
|
2098
|
-
if (this.removeKeydownListener) {
|
2099
|
-
this.removeKeydownListener();
|
2100
|
-
}
|
2101
|
-
let height = navEl.offsetHeight;
|
2102
|
-
let width = navEl.offsetWidth;
|
2103
|
-
// In order to animate the child menu, we need to set height on the nav element
|
2104
|
-
// so we can absolutely position the two menus and maintain the current menu's height
|
2105
|
-
this.renderer.setStyle(navEl, 'height', `${height}px`);
|
2106
|
-
this.renderer.setStyle(navEl, 'width', `${width}px`);
|
2107
|
-
this.renderer.addClass(this.el.nativeElement, 'open');
|
2108
|
-
setTimeout(() => {
|
2109
|
-
this.renderer.addClass(this.el.nativeElement, 'open-active');
|
2110
|
-
});
|
2477
|
+
if (validatorParams.maxLength !== undefined) {
|
2478
|
+
validators.push(Validators.maxLength(validatorParams.maxLength));
|
2111
2479
|
}
|
2112
|
-
|
2113
|
-
|
2114
|
-
this.addKeydownListener();
|
2115
|
-
this.renderer.removeClass(this.el.nativeElement, 'open-active');
|
2116
|
-
setTimeout(() => {
|
2117
|
-
this.renderer.removeClass(this.el.nativeElement, 'open');
|
2118
|
-
// Reset the nav element's height to auto
|
2119
|
-
this.renderer.setStyle(navEl, 'height', '100%');
|
2120
|
-
this.selected = null;
|
2121
|
-
}, menuAnimationSpeed);
|
2480
|
+
if (validatorParams.pattern !== undefined) {
|
2481
|
+
validators.push(Validators.pattern(validatorParams.pattern));
|
2122
2482
|
}
|
2123
|
-
|
2124
|
-
|
2125
|
-
|
2126
|
-
|
2127
|
-
keyNavigate(event) {
|
2128
|
-
if (this.enableKeyNav && event.target === this.dropdownToggleButton?.nativeElement) {
|
2129
|
-
switch (event.key) {
|
2130
|
-
case 'ArrowUp':
|
2131
|
-
case 'Up':
|
2132
|
-
case 'ArrowDown':
|
2133
|
-
case 'Down':
|
2134
|
-
event.stopPropagation();
|
2135
|
-
event.preventDefault();
|
2136
|
-
this.moveHighlightedUpOrDown(event);
|
2137
|
-
break;
|
2138
|
-
case 'ArrowRight':
|
2139
|
-
case 'Right':
|
2140
|
-
event.stopPropagation();
|
2141
|
-
event.preventDefault();
|
2142
|
-
// Select the item if it has child items
|
2143
|
-
if (this.highlightedItem && this.highlightedItem.items) {
|
2144
|
-
this.selectItem(event, this.highlightedItem, true);
|
2145
|
-
}
|
2146
|
-
break;
|
2147
|
-
case 'ArrowLeft':
|
2148
|
-
case 'Left':
|
2149
|
-
event.stopPropagation();
|
2150
|
-
event.preventDefault();
|
2151
|
-
// Close the menu if it is a child menu
|
2152
|
-
if (this.parent) {
|
2153
|
-
this.back(event);
|
2154
|
-
}
|
2155
|
-
break;
|
2156
|
-
case ' ':
|
2157
|
-
case 'Spacebar':
|
2158
|
-
case 'Enter':
|
2159
|
-
// Prevent 'enter' from doing whatever it does on the currently focused element
|
2160
|
-
event.preventDefault();
|
2161
|
-
if (this.highlightedItemIndex > -1 && this.highlightedItem) {
|
2162
|
-
this.selectItem(event, this.highlightedItem, true);
|
2163
|
-
// If the header is highlighted
|
2164
|
-
}
|
2165
|
-
else if (this.highlightedItemIndex === -1) {
|
2166
|
-
// Close the menu if it's a child
|
2167
|
-
if (this.parent) {
|
2168
|
-
this.back(event);
|
2169
|
-
}
|
2170
|
-
}
|
2171
|
-
break;
|
2172
|
-
default:
|
2173
|
-
return;
|
2483
|
+
validators.forEach(validator => {
|
2484
|
+
let validationResult = validator(control);
|
2485
|
+
if (validationResult) {
|
2486
|
+
validatorParams.valid = false;
|
2174
2487
|
}
|
2488
|
+
});
|
2489
|
+
if (validatorParams.valid) {
|
2490
|
+
return null;
|
2491
|
+
}
|
2492
|
+
else {
|
2493
|
+
return {
|
2494
|
+
textbox: validatorParams
|
2495
|
+
};
|
2175
2496
|
}
|
2497
|
+
};
|
2498
|
+
};
|
2499
|
+
const phoneNumberValidationPattern = '^\\s*(?:\\+?(\\d{1,3}))?[-. (]*(\\d{3})[-. )]*(\\d{3})[-. ]*(\\d{4})(?: *x(\\d+))?\\s*$';
|
2500
|
+
const urlValidationPattern = '([A-Za-z])+(:\/\/)+[^\\s]*';
|
2501
|
+
class TextboxComponent extends FormControlBase {
|
2502
|
+
constructor(validationMessageService, formGroupHelper, translate) {
|
2503
|
+
super(validationMessageService, formGroupHelper);
|
2504
|
+
this.validationMessageService = validationMessageService;
|
2505
|
+
this.formGroupHelper = formGroupHelper;
|
2506
|
+
this.translate = translate;
|
2507
|
+
/**
|
2508
|
+
* Set the value of the input's autocomplete attribute
|
2509
|
+
*/
|
2510
|
+
this.autocomplete = 'off';
|
2511
|
+
/**
|
2512
|
+
* The textbox type
|
2513
|
+
*/
|
2514
|
+
this.type = "text";
|
2515
|
+
/**
|
2516
|
+
* The value of the rows attribute for a textarea. Only applies to multi-line type
|
2517
|
+
*/
|
2518
|
+
this.rows = 3;
|
2519
|
+
/**
|
2520
|
+
* If set to true, we will select all text within the input if
|
2521
|
+
* autofocus is also set to true
|
2522
|
+
*/
|
2523
|
+
this.selectOnAutofocus = false;
|
2524
|
+
/**
|
2525
|
+
* If set to true, we will upper case on focus out
|
2526
|
+
*/
|
2527
|
+
this.upperCase = false;
|
2528
|
+
/**
|
2529
|
+
* Validation pattern for the input. This is determined on the input type specified
|
2530
|
+
*/
|
2531
|
+
this.validationPattern = '';
|
2532
|
+
}
|
2533
|
+
ngOnChanges(changes) {
|
2534
|
+
super.ngOnChanges(changes);
|
2176
2535
|
}
|
2177
2536
|
/**
|
2178
|
-
*
|
2179
|
-
* NgClassDirecitve or NavItemActiveDirective to respond to the model changes
|
2180
|
-
* and update the view.
|
2537
|
+
* The angular onInit lifecycle hook
|
2181
2538
|
*/
|
2182
|
-
|
2183
|
-
|
2184
|
-
|
2185
|
-
|
2186
|
-
|
2187
|
-
}
|
2188
|
-
moveHighlightedUpOrDown(event) {
|
2189
|
-
switch (event.key) {
|
2190
|
-
case 'ArrowUp':
|
2191
|
-
case 'Up':
|
2192
|
-
if (this.highlightedItemIndex > -1) {
|
2193
|
-
this.highlightedItemIndex--;
|
2194
|
-
// Skip any in-menu heading items
|
2195
|
-
if (this.highlightedItemIndex > -1 && this.items[this.highlightedItemIndex].display === 'heading') {
|
2196
|
-
this.highlightedItemIndex--;
|
2197
|
-
}
|
2198
|
-
}
|
2199
|
-
break;
|
2200
|
-
case 'ArrowDown':
|
2201
|
-
case 'Down':
|
2202
|
-
if (this.highlightedItemIndex < this.items.length - 1) {
|
2203
|
-
this.highlightedItemIndex++;
|
2204
|
-
// Skip any in-menu heading items
|
2205
|
-
if (this.highlightedItemIndex < this.items.length - 1 && this.items[this.highlightedItemIndex].display === 'heading') {
|
2206
|
-
this.highlightedItemIndex++;
|
2207
|
-
}
|
2208
|
-
}
|
2209
|
-
break;
|
2210
|
-
default:
|
2211
|
-
return;
|
2539
|
+
ngOnInit() {
|
2540
|
+
super.ngOnInit();
|
2541
|
+
this.validationPattern = '';
|
2542
|
+
if (this.type === 'tel') {
|
2543
|
+
this.validationPattern = phoneNumberValidationPattern;
|
2212
2544
|
}
|
2213
|
-
if (this.
|
2214
|
-
|
2215
|
-
this.highlightedItem = this.items[this.highlightedItemIndex];
|
2545
|
+
else if (this.type === 'url') {
|
2546
|
+
this.validationPattern = urlValidationPattern;
|
2216
2547
|
}
|
2217
|
-
|
2218
|
-
this.
|
2548
|
+
if (this.placeholder) {
|
2549
|
+
this.translate.get(this.placeholder)
|
2550
|
+
.subscribe((translated) => {
|
2551
|
+
this.placeholder = translated;
|
2552
|
+
});
|
2219
2553
|
}
|
2220
|
-
this.scrollToHighlightedItem();
|
2221
2554
|
}
|
2222
2555
|
/**
|
2223
|
-
*
|
2224
|
-
* If no item is provided, it will scroll to the first item.
|
2225
|
-
*
|
2226
|
-
* @param item The menu item to scroll to.
|
2227
|
-
* @memberof MenuComponent
|
2556
|
+
* The angular afterViewInit lifecycle hook
|
2228
2557
|
*/
|
2229
|
-
|
2230
|
-
if (this.
|
2231
|
-
|
2232
|
-
let itemIndex = this.findItemIndex(item);
|
2233
|
-
if (this.id) {
|
2234
|
-
let itemSelector = item.id ? `#${item.id}` : `#${this.id}_item${itemIndex}`;
|
2235
|
-
this.scrollService.scrollItemCentered(`#${this.id}_list`, itemSelector);
|
2236
|
-
}
|
2558
|
+
ngAfterViewInit() {
|
2559
|
+
if (this.autofocus) {
|
2560
|
+
this.setFocus(this.selectOnAutofocus);
|
2237
2561
|
}
|
2238
2562
|
}
|
2239
|
-
scrollToHighlightedItem() {
|
2240
|
-
this.scrollMenu(this.highlightedItem);
|
2241
|
-
}
|
2242
2563
|
/**
|
2243
|
-
*
|
2244
|
-
*
|
2245
|
-
*
|
2246
|
-
* @param itemToFind The matching item to find in the items array.
|
2247
|
-
* @memberof MenuComponent
|
2564
|
+
* Function to set focus on an input programmatically after the page
|
2565
|
+
* had been rendered. The highlight text flag will select the text
|
2566
|
+
* within the input if passed in and true
|
2248
2567
|
*/
|
2249
|
-
|
2250
|
-
|
2251
|
-
|
2252
|
-
|
2253
|
-
});
|
2254
|
-
}
|
2255
|
-
else {
|
2256
|
-
return -1;
|
2257
|
-
}
|
2258
|
-
}
|
2259
|
-
addKeydownListener() {
|
2260
|
-
// Only attempt to add the listener if keyboard nav is enabled
|
2261
|
-
if (this.enableKeyNav) {
|
2262
|
-
// renderer.listen adds the listener and returns a function to remove it from the renderer.
|
2263
|
-
// The listener remains active until this function is called.
|
2264
|
-
this.removeKeydownListener = this.renderer.listen('document', 'keydown', (event) => this.keyNavigate(event));
|
2568
|
+
setFocus(highlightText) {
|
2569
|
+
this.inputElement.nativeElement.focus();
|
2570
|
+
if (highlightText) {
|
2571
|
+
this.inputElement.nativeElement.select();
|
2265
2572
|
}
|
2266
2573
|
}
|
2267
2574
|
/**
|
2268
|
-
|
2269
|
-
|
2270
|
-
|
2271
|
-
|
2272
|
-
|
2273
|
-
|
2274
|
-
});
|
2575
|
+
* Focus out event handler
|
2576
|
+
* will upper case and trim value if upperCase is true (this is what we do on the apis)
|
2577
|
+
*/
|
2578
|
+
focusOutEvent() {
|
2579
|
+
if (this.upperCase && this.formModel.value) {
|
2580
|
+
this.formModel.setValue(this.formModel.value.toUpperCase().trim());
|
2275
2581
|
}
|
2276
2582
|
}
|
2277
2583
|
}
|
2278
|
-
|
2279
|
-
MenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: MenuComponent, selector: "ec-menu", inputs: { id: "id", items: "items", selected: "selected", parent: "parent", templateType: "templateType", customMenuTemplate: "customMenuTemplate", title: "title", showNoItems: "showNoItems", noDataText: "noDataText", enableKeyNav: "enableKeyNav", highlightedItem: "highlightedItem", maintainSelectedItem: "maintainSelectedItem", truncateItems: "truncateItems", preserveIconSpace: "preserveIconSpace", dropdownToggleButton: "dropdownToggleButton" }, outputs: { selectedChanged: "selectedChanged", menuClosed: "menuClosed" }, host: { properties: { "attr.id": "this.attrId" } }, viewQueries: [{ propertyName: "labelTemplate", first: true, predicate: ["label"], descendants: true, static: true }, { propertyName: "iconAndLabelTemplate", first: true, predicate: ["iconAndLabel"], descendants: true, static: true }, { propertyName: "checkAndLabelTemplate", first: true, predicate: ["checkAndLabel"], descendants: true, static: true }, { propertyName: "iconLabelCaptionTemplate", first: true, predicate: ["iconLabelCaption"], descendants: true, static: true }], ngImport: i0, template: "<nav>\r\n <div class=\"parent\"\r\n [class.no-data]=\"showNoItems && (!items || items.length === 0)\">\r\n <header id=\"{{id}}_header\"\r\n class=\"text-heading-3 p-1\"\r\n [class.is-selected]=\"highlightedItemIndex === -1\"\r\n *ngIf=\"parent\"\r\n (click)=\"back($event)\">\r\n <div class=\"item-wrapper\">\r\n <i class=\"ec-icon icon-angle-down rotate-90 flex-shrink\"></i>\r\n <span class=\"label text-truncate flex-grow\">{{parent?.label}}</span>\r\n </div>\r\n </header>\r\n\r\n <ul id=\"{{id}}_list\"\r\n class=\"py-1\">\r\n <ng-container *ngFor=\"let item of items; index as i\"\r\n [ngTemplateOutlet]=\"itemTemplate\"\r\n [ngTemplateOutletContext]=\"{$implicit: item, index: i}\">\r\n </ng-container>\r\n </ul>\r\n\r\n <p class=\"no-data-message\">{{noDataText | translate}}</p>\r\n </div>\r\n\r\n <!-- Child menu (Rendered to the right) -->\r\n <ec-menu *ngIf=\"selected?.items && selected?.display !== 'heading'\"\r\n id=\"{{id}}_child\"\r\n class=\"child\"\r\n [parent]=\"selected\"\r\n [items]=\"selected?.items\"\r\n [showNoItems]=\"true\"\r\n [templateType]=\"templateType\"\r\n [enableKeyNav]=\"true\"\r\n [truncateItems]=\"truncateItems\"\r\n (selectedChanged)=\"onSelection($event)\"\r\n (menuClosed)=\"toggleChildMenu(false)\">\r\n </ec-menu>\r\n</nav>\r\n\r\n<ng-template #itemTemplate\r\n let-item\r\n let-i=\"index\">\r\n <li *ngIf=\"!item.hideIfNoItems || (item.items?.length > 0)\"\r\n id=\"{{item.id || id + '_item' + i}}\"\r\n class=\"{{item.display || 'item'}} {{item.classList}}\"\r\n [attr.disabled]=\"item.disabled\"\r\n [hidden]=\"item.hidden\"\r\n ecNavItemActive=\"is-selected\"\r\n [ecNavItemActiveQueryParams]=\"item.queryParams\"\r\n [ecNavItemActiveUrl]=\"item.url\"\r\n [ecNavItemActiveExactMatch]='item.isActiveExactMatch'\r\n (routerLinkActivated)=\"selectItem($event, item)\"\r\n [ngClass]=\"{'is-highlighted':(selected === item && item?.display !== 'heading') || highlightedItem === item, 'is-link': item.url, 'is-disabled': item.disabled, 'is-readonly': item.readonly, 'is-checked': item.checked, 'text-heading-3': item?.display === 'heading'}\"\r\n (click)=\"selectItem($event, item)\">\r\n\r\n <a *ngIf=\"item.url && !item.externalLink\"\r\n id=\"{{item.id}}_link\"\r\n title=\"{{truncateItems ? item.label : ''}}\"\r\n class=\"item-wrapper\"\r\n [routerLink]=\"item.url\"\r\n [queryParams]=\"item.queryParams || null\"\r\n target=\"{{item.target || '_self'}}\">\r\n <ng-container *ngTemplateOutlet=\"internalizedTemplate; context: {$implicit: item}\"></ng-container>\r\n </a>\r\n\r\n <a *ngIf=\"item.url && item.externalLink\"\r\n id=\"{{item.id}}_link\"\r\n title=\"{{truncateItems ? item.label : ''}}\"\r\n class=\"item-wrapper\"\r\n href=\"{{item.url}}\"\r\n target=\"{{item.target || '_self'}}\">\r\n <ng-container *ngTemplateOutlet=\"internalizedTemplate; context: {$implicit: item}\"></ng-container>\r\n </a>\r\n\r\n <div *ngIf=\"!item.url\"\r\n title=\"{{truncateItems ? item.label : ''}}\"\r\n class=\"item-wrapper\">\r\n <ng-container *ngTemplateOutlet=\"internalizedTemplate; context: {$implicit: item}\"></ng-container>\r\n </div>\r\n </li>\r\n\r\n <ng-container *ngIf=\"item.items?.length && item.display === 'heading'\">\r\n <ng-container *ngFor=\"let subItem of item.items; index as j\"\r\n [ngTemplateOutlet]=\"itemTemplate\"\r\n [ngTemplateOutletContext]=\"{$implicit: subItem, index: i + '-' + j}\">\r\n </ng-container>\r\n </ng-container>\r\n</ng-template>\r\n\r\n<!-- 'label' Item Template -->\r\n<ng-template #label\r\n let-item>\r\n <span id=\"{{item.id}}_label\"\r\n class=\"label\"\r\n [class.text-truncate]=\"truncateItems\">{{item.label}}</span>\r\n\r\n <i class=\"ec-icon icon-angle-down rotate-270\"\r\n *ngIf=\"item?.items && item.display !== 'heading'\"></i>\r\n</ng-template>\r\n\r\n<!-- 'checkAndLabel' Item Template -->\r\n<ng-template #checkAndLabel\r\n let-item>\r\n\r\n <i class=\"ec-icon icon-check ec-icon-sm\"\r\n *ngIf=\"item.display !== 'heading'\"></i>\r\n\r\n <i class=\"ec-icon {{item.icon}} ml-2\"\r\n *ngIf=\"item.icon\"></i>\r\n\r\n <span id=\"{{item.id}}_label\"\r\n class=\"label\"\r\n [class.text-truncate]=\"truncateItems\">{{item.label}}</span>\r\n\r\n <i class=\"ec-icon icon-angle-down rotate-270\"\r\n *ngIf=\"item?.items && item.display !== 'heading'\"></i>\r\n</ng-template>\r\n\r\n<!-- 'iconAndLabel' Item Template -->\r\n<ng-template #iconAndLabel\r\n let-item>\r\n <!-- If menuItem.icon exists and is not blank, show the icon in the menu -->\r\n <i class=\"ec-icon {{item.icon}}\"\r\n *ngIf=\"(item.icon && item.icon !== '') || preserveIconSpace\"></i>\r\n\r\n <span id=\"{{item.id}}_label\"\r\n class=\"label\"\r\n [class.text-truncate]=\"truncateItems\">{{item.label}}</span>\r\n\r\n <i class=\"ec-icon icon-angle-down rotate-270\"\r\n *ngIf=\"item?.items && item.display !== 'heading'\"></i>\r\n</ng-template>\r\n\r\n<ng-template #iconLabelCaption\r\n let-item>\r\n <i class=\"ec-icon {{item.icon}}\"\r\n *ngIf=\"(item.icon && item.icon !== '') || preserveIconSpace\"></i>\r\n <div *ngIf=\"item.display !== 'heading'\"\r\n class=\"label flex-grow\">\r\n <div id=\"{{item.id}}_label\"\r\n class=\"text-body-1\"\r\n [class.text-truncate]=\"truncateItems\">{{item.label}}</div>\r\n <div id=\"{{item.id}}_caption\"\r\n *ngIf=\"item.caption\"\r\n class=\"text-caption-1\"\r\n [class.text-truncate]=\"truncateItems\">{{item.caption}}</div>\r\n </div>\r\n <h3 *ngIf=\"item.display === 'heading'\"\r\n class=\"flex-grow text-heading-3 align-self-center\"\r\n [class.text-truncate]=\"truncateItems\">{{item.label}}</h3>\r\n <i class=\"ec-icon icon-angle-down rotate-270 align-self-center\"\r\n *ngIf=\"item?.items && item.display !== 'heading'\"></i>\r\n</ng-template>", styles: ["@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}:host{display:block;font-size:var(--ec-menu-font-size, var(--ec-font-size-action));font-weight:400;background-color:var(--ec-menu-background-color, var(--ec-background-color))}:host.open>nav>.parent,:host.open>nav>.child{position:absolute;left:0;top:0;right:0;height:100%;transition:transform .25s ease}:host.open>nav>.parent{transform:translate(0)}:host.open>nav>.child{transform:translate(100%)}:host.open-active>nav>.parent{transform:translate(-100%)}:host.open-active>nav>.child{transform:translate(0)}:host(.bg-transparent){background-color:transparent}:host-context(.is-always-open){height:100%}:host-context(.is-always-open) .item-wrapper{padding-left:1rem;padding-right:1rem}nav{display:flex;position:relative;height:100%;overflow:hidden}.parent{display:flex;flex-direction:column;flex:auto;position:relative;max-width:100%}.parent>header{cursor:pointer}.parent>header.is-selected .item-wrapper,.parent>header.is-highlighted .item-wrapper{background-color:var(--ec-background-color-selected)}.parent>header:hover .item-wrapper{background-color:var(--ec-background-color-hover)}.parent.no-data ul{display:none}.parent.no-data .no-data-message{display:block}ul{padding:0;margin:0;list-style:none;flex:auto;height:100%;overflow-y:auto}ul li{cursor:pointer;padding:0 .25rem}ul li a{color:inherit;border-bottom:0;text-decoration:none}ul li.is-selected .item-wrapper,ul li.is-highlighted .item-wrapper{background-color:var(--ec-background-color-selected)}ul li:hover .item-wrapper{background-color:var(--ec-background-color-hover)}ul li:focus .item-wrapper{outline:none;background-color:var(--ec-color-disabled-dark);position:relative;z-index:1}ul li.is-disabled .item-wrapper{color:var(--ec-color-disabled-dark);opacity:var(--ec-form-control-opacity-disabled)}ul li.is-disabled,ul li.is-readonly{cursor:default}ul li.is-disabled .item-wrapper,ul li.is-readonly .item-wrapper{background-color:transparent;color:inherit}ul li.is-checked .icon-check{opacity:1}ul li.heading{cursor:default}ul li.heading .item-wrapper{background-color:transparent}ul li.heading:not(:first-child){margin-top:.5rem}ul li.heading:last-child{display:none}ul li.divider:not(:last-child){border-bottom:1px solid var(--ec-border-color);padding-bottom:.25rem;margin-bottom:.25rem}ul li.divider-top:not(:first-child):not(.divider + .divider-top){border-top:1px solid var(--ec-border-color);padding-top:.25rem;margin-top:.25rem}ul li.indent-1 .item-wrapper{padding-left:1.5rem}ul li.indent-2 .item-wrapper{padding-left:2.5rem}ul li.indent-3 .item-wrapper{padding-left:3.5rem}.item-wrapper{cursor:inherit;line-height:1.25rem;min-height:1.75rem;padding:.25rem .5rem;border-radius:var(--ec-border-radius);display:flex;color:inherit}.item-wrapper .label{margin-right:auto}.item-wrapper .label+.ec-icon{margin-left:.5rem}.item-wrapper .ec-icon{margin-top:calc((1.25rem - var(--ec-font-size-icon)) / 2);flex:none}.item-wrapper .ec-icon+.label{margin-left:.5rem}.item-wrapper .ec-icon-sm{margin-top:calc((1.25rem - calc(var(--ec-font-size-icon) * .75)) / 2)}.item-wrapper .icon-check{opacity:0}.no-data-message{display:none;text-align:center;padding:1rem;color:var(--ec-color-hint-dark);margin-bottom:0;font-size:var(--ec-font-size-body)}:host-context(ec-tree) ul{overflow-x:hidden}:host-context(ec-tree) li.is-selected,:host-context(ec-tree) li.is-highlighted{font-weight:700;color:var(--ec-menu-color-highlighted, inherit)}:host-context(ec-tree) li.is-selected:not(:hover),:host-context(ec-tree) li.is-highlighted:not(:hover){background-color:transparent}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: NavItemActiveDirective, selector: "[ecNavItemActive]", inputs: ["ecNavItemActive", "ecNavItemActiveExactMatch", "ecNavItemActiveQueryParams", "ecNavItemActiveUrl"], outputs: ["routerLinkActivated"] }, { kind: "component", type: MenuComponent, selector: "ec-menu", inputs: ["id", "items", "selected", "parent", "templateType", "customMenuTemplate", "title", "showNoItems", "noDataText", "enableKeyNav", "highlightedItem", "maintainSelectedItem", "truncateItems", "preserveIconSpace", "dropdownToggleButton"], outputs: ["selectedChanged", "menuClosed"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] });
|
2280
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type:
|
2584
|
+
TextboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TextboxComponent, deps: [{ token: ValidationMessageService }, { token: FormGroupHelper }, { token: i2.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
|
2585
|
+
TextboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: TextboxComponent, selector: "ec-textbox", inputs: { autocomplete: "autocomplete", type: "type", placeholder: "placeholder", maxlength: "maxlength", minlength: "minlength", rows: "rows", selectOnAutofocus: "selectOnAutofocus", upperCase: "upperCase" }, viewQueries: [{ propertyName: "inputElement", first: true, predicate: ["textboxInput"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"control control-label-{{labelPosition}}\"\r\n [ngClass]=\"{'is-readonly': readonly}\">\r\n\r\n <label *ngIf=\"label\">\r\n <span>{{label | translate}}</span>\r\n <span *ngIf=\"validationErrors.length > 0 && formModel.touched && formModel.invalid\"> {{validationErrors |\r\n translate}}</span>\r\n <ec-help-popover id=\"{{id}}_helpPopover\"\r\n *ngIf=\"helpPopover\"\r\n class=\"d-inline-block my-n3 mx-n1\"\r\n text=\"{{helpPopover | translate}}\"\r\n contentPosition=\"{{helpPopoverPosition}}\">\r\n </ec-help-popover>\r\n </label>\r\n\r\n <div class=\"input-wrapper control-input\">\r\n <input *ngIf=\"type !== 'multi_line'\"\r\n #textboxInput\r\n email=\"{{type === 'email' ? true : false}}\"\r\n pattern=\"{{validationPattern}}\"\r\n type=\"{{type}}\"\r\n tabindex=\"{{tabindex}}\"\r\n title=\"{{tooltip}}\"\r\n [attr.id]=\"inputId\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.placeholder]=\"placeholder\"\r\n [attr.maxlength]=\"maxlength\"\r\n [attr.minlength]=\"minlength\"\r\n [attr.required]=\"required ? required : null\"\r\n [formControl]=\"formModel\"\r\n [ngClass]=\"{'is-empty': !formModel?.value, 'is-pending': pending, 'is-uppercase': upperCase}\"\r\n (focusout)=\"focusOutEvent()\"\r\n [attr.cdkFocusInitial]=\"autofocus || null\">\r\n\r\n <textarea *ngIf=\"type === 'multi_line'\"\r\n [attr.rows]=\"rows\"\r\n #textboxInput\r\n tabindex=\"{{tabindex}}\"\r\n [attr.id]=\"inputId\"\r\n [attr.placeholder]=\"placeholder\"\r\n [attr.maxlength]=\"maxlength\"\r\n [attr.minlength]=\"minlength\"\r\n [attr.required]=\"required ? required : null\"\r\n [formControl]=\"formModel\"\r\n [ngClass]=\"{'is-empty': formModel?.value === '', 'is-pending': pending}\"\r\n [attr.cdkFocusInitial]=\"autofocus || null\">\r\n </textarea>\r\n\r\n <i class=\"ec-icon icon-required\"></i>\r\n <i class=\"ec-icon icon-invalid\"></i>\r\n <i class=\"ec-icon icon-loading\"></i>\r\n </div>\r\n</div>", styles: [":host{color:var(--ec-form-control-color);font-size:var(--ec-form-control-font-size);display:block;margin-bottom:1rem;width:100%}:host :host-context(.form-condensed){margin-bottom:.5rem}:host .control{width:100%;display:flex;flex-direction:column}:host .control.control-label-bottom{flex-direction:column-reverse}:host .control.control-label-left{flex-direction:row}:host .control.control-label-left label{margin-right:.25rem}:host .control.control-label-right{flex-direction:row-reverse}:host .control.control-label-right label{margin-left:.25rem}:host .control.control-label-left,:host .control.control-label-right{align-items:center}:host .control.control-label-left label,:host .control.control-label-right label{flex:1 1;margin-top:0;margin-bottom:0}:host .control.control-label-left .control-input,:host .control.control-label-right .control-input{flex:2 2}:host .control.is-readonly input,:host .control.is-readonly select,:host .control.is-readonly textarea{border-color:var(--ec-form-control-border-color-readonly);background-color:var(--ec-form-control-background-color-readonly);background-clip:border-box;background-image:none;color:var(--ec-form-control-color-readonly);opacity:1;-webkit-user-select:none;user-select:none;pointer-events:none;overflow:hidden;white-space:nowrap}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid:focus,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid:focus{border-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-invalid{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-required,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-required{display:none}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button{background-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button:not(:focus){border-color:var(--ec-form-control-border-color-invalid)}:host .textbox-group{display:flex;position:relative}:host textarea:focus,:host input:focus,:host select:focus{outline:none}:host label{color:var(--ec-form-control-label-color, var(--ec-color-secondary-dark));display:block;font-size:var(--ec-font-size-label);line-height:1;margin:calc(var(--ec-font-size-label) / 2) 0}:host input{background-color:var(--ec-form-control-background-color);border:1px solid var(--ec-form-control-border-color);border-radius:var(--ec-border-radius);background-image:none;background-clip:padding-box;width:100%;line-height:1.25rem;padding:.3125rem .5rem;height:2rem}:host input::selection{background-color:var(--ec-form-control-background-color-selection);color:var(--ec-form-control-color-selection)}:host input::-webkit-input-placeholder{color:var(--ec-form-control-color-placeholder)}:host input::-moz-placeholder{color:var(--ec-form-control-color-placeholder);opacity:1}:host input:-ms-input-placeholder{color:var(--ec-form-control-color-placeholder)}:host input:-moz-placeholder{color:var(--ec-form-control-color-placeholder);opacity:1}:host input~.icon-required,:host input~.icon-invalid{color:var(--ec-form-control-border-color-invalid)}:host input:required.is-empty{background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host input:required.is-empty~.icon-required{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host input.ng-invalid.ng-touched{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host input.ng-invalid.ng-touched:focus{border-color:var(--ec-form-control-background-color-invalid)}:host input.ng-invalid.ng-touched~.icon-invalid{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host input.ng-invalid.ng-touched~.icon-required{display:none}:host input.is-pending.ng-valid,:host input.is-pending.ng-invalid,:host input.is-pending.ng-pending{background-image:\"\";background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem}:host input.is-pending.ng-valid~.icon-loading,:host input.is-pending.ng-invalid~.icon-loading,:host input.is-pending.ng-pending~.icon-loading{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host input.is-pending.ng-valid~.icon-required,:host input.is-pending.ng-valid~.icon-invalid,:host input.is-pending.ng-invalid~.icon-required,:host input.is-pending.ng-invalid~.icon-invalid,:host input.is-pending.ng-pending~.icon-required,:host input.is-pending.ng-pending~.icon-invalid{display:none}:host input:focus,:host input:focus.is-empty{border-color:var(--ec-form-control-border-color-focus);box-shadow:var(--ec-form-control-box-shadow-focus);position:relative;z-index:1}:host input:disabled{background-color:var(--ec-form-control-background-color-disabled);border-color:var(--ec-form-control-border-color-disabled);color:var(--ec-form-control-color-disabled);opacity:var(--ec-form-control-opacity-disabled)}:host input:disabled:required,:host input:disabled:required.is-empty{background-image:none;padding-left:.5rem;background-color:var(--ec-form-control-background-color-disabled);border-color:var(--ec-form-control-border-color-disabled)}:host input:disabled:required+.icon-required,:host input:disabled:required.is-empty+.icon-required{display:none}:host input.is-uppercase:not(.is-empty){text-transform:uppercase}:host textarea{background-color:var(--ec-form-control-background-color);border:1px solid var(--ec-form-control-border-color);border-radius:var(--ec-border-radius);background-image:none;background-clip:padding-box;width:100%;line-height:1.25rem;padding:.3125rem .5rem;height:auto;resize:none;display:block}:host textarea::selection{background-color:var(--ec-form-control-background-color-selection);color:var(--ec-form-control-color-selection)}:host textarea::-webkit-input-placeholder{color:var(--ec-form-control-color-placeholder)}:host textarea::-moz-placeholder{color:var(--ec-form-control-color-placeholder);opacity:1}:host textarea:-ms-input-placeholder{color:var(--ec-form-control-color-placeholder)}:host textarea:-moz-placeholder{color:var(--ec-form-control-color-placeholder);opacity:1}:host textarea~.icon-required,:host textarea~.icon-invalid{color:var(--ec-form-control-border-color-invalid)}:host textarea:required.is-empty{background-repeat:no-repeat;background-position:.5rem .5rem;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host textarea:required.is-empty~.icon-required{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host textarea.ng-invalid.ng-touched{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-repeat:no-repeat;background-position:.5rem .5rem;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host textarea.ng-invalid.ng-touched:focus{border-color:var(--ec-form-control-background-color-invalid)}:host textarea.ng-invalid.ng-touched~.icon-invalid{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host textarea.ng-invalid.ng-touched~.icon-required{display:none}:host textarea.is-pending.ng-valid,:host textarea.is-pending.ng-invalid,:host textarea.is-pending.ng-pending{background-image:\"\";background-repeat:no-repeat;background-position:.5rem .5rem;background-size:1rem,1rem;padding-left:1.75rem}:host textarea.is-pending.ng-valid~.icon-loading,:host textarea.is-pending.ng-invalid~.icon-loading,:host textarea.is-pending.ng-pending~.icon-loading{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host textarea.is-pending.ng-valid~.icon-required,:host textarea.is-pending.ng-valid~.icon-invalid,:host textarea.is-pending.ng-invalid~.icon-required,:host textarea.is-pending.ng-invalid~.icon-invalid,:host textarea.is-pending.ng-pending~.icon-required,:host textarea.is-pending.ng-pending~.icon-invalid{display:none}:host textarea:focus,:host textarea:focus.is-empty{border-color:var(--ec-form-control-border-color-focus);box-shadow:var(--ec-form-control-box-shadow-focus);position:relative;z-index:1}:host textarea:disabled{background-color:var(--ec-form-control-background-color-disabled);border-color:var(--ec-form-control-border-color-disabled);color:var(--ec-form-control-color-disabled);opacity:var(--ec-form-control-opacity-disabled)}:host textarea:disabled:required,:host textarea:disabled:required.is-empty{background-image:none;padding-left:.5rem;background-color:var(--ec-form-control-background-color-disabled);border-color:var(--ec-form-control-border-color-disabled)}:host textarea:disabled:required+.icon-required,:host textarea:disabled:required.is-empty+.icon-required{display:none}:host textarea.is-uppercase:not(.is-empty){text-transform:uppercase}.input-wrapper{position:relative}.input-wrapper>.ec-icon{display:none}:host(.textbox-group-input:not(:last-child)){flex:1 1 0%;width:1px}:host(.textbox-group-input:not(:last-child)) .control{margin-bottom:0}:host(.textbox-group-input:not(:last-child)) .control.is-readonly input{border-right-width:1px}:host(.textbox-group-input:not(:last-child)) input{border-top-right-radius:0;border-bottom-right-radius:0;border-right-width:0}:host(.textbox-group-input:not(:last-child)) input:focus{position:relative;z-index:1;border-right-width:1px}:host(.text-truncate) input{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host(.is-monospace) input,:host(.is-monospace) textarea,:host-context(.is-monospace) input,:host-context(.is-monospace) textarea{font-family:var(--ec-font-family-monospace)}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i4.MinLengthValidator, selector: "[minlength][formControlName],[minlength][formControl],[minlength][ngModel]", inputs: ["minlength"] }, { kind: "directive", type: i4.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i4.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i4.EmailValidator, selector: "[email][formControlName],[email][formControl],[email][ngModel]", inputs: ["email"] }, { kind: "directive", type: i4.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: HelpPopoverComponent, selector: "ec-help-popover", inputs: ["id", "text", "contentPosition", "maxWidth"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] });
|
2586
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TextboxComponent, decorators: [{
|
2281
2587
|
type: Component,
|
2282
|
-
args: [{ selector: 'ec-menu', template: "<nav>\r\n <div class=\"parent\"\r\n [class.no-data]=\"showNoItems && (!items || items.length === 0)\">\r\n <header id=\"{{id}}_header\"\r\n class=\"text-heading-3 p-1\"\r\n [class.is-selected]=\"highlightedItemIndex === -1\"\r\n *ngIf=\"parent\"\r\n (click)=\"back($event)\">\r\n <div class=\"item-wrapper\">\r\n <i class=\"ec-icon icon-angle-down rotate-90 flex-shrink\"></i>\r\n <span class=\"label text-truncate flex-grow\">{{parent?.label}}</span>\r\n </div>\r\n </header>\r\n\r\n <ul id=\"{{id}}_list\"\r\n class=\"py-1\">\r\n <ng-container *ngFor=\"let item of items; index as i\"\r\n [ngTemplateOutlet]=\"itemTemplate\"\r\n [ngTemplateOutletContext]=\"{$implicit: item, index: i}\">\r\n </ng-container>\r\n </ul>\r\n\r\n <p class=\"no-data-message\">{{noDataText | translate}}</p>\r\n </div>\r\n\r\n <!-- Child menu (Rendered to the right) -->\r\n <ec-menu *ngIf=\"selected?.items && selected?.display !== 'heading'\"\r\n id=\"{{id}}_child\"\r\n class=\"child\"\r\n [parent]=\"selected\"\r\n [items]=\"selected?.items\"\r\n [showNoItems]=\"true\"\r\n [templateType]=\"templateType\"\r\n [enableKeyNav]=\"true\"\r\n [truncateItems]=\"truncateItems\"\r\n (selectedChanged)=\"onSelection($event)\"\r\n (menuClosed)=\"toggleChildMenu(false)\">\r\n </ec-menu>\r\n</nav>\r\n\r\n<ng-template #itemTemplate\r\n let-item\r\n let-i=\"index\">\r\n <li *ngIf=\"!item.hideIfNoItems || (item.items?.length > 0)\"\r\n id=\"{{item.id || id + '_item' + i}}\"\r\n class=\"{{item.display || 'item'}} {{item.classList}}\"\r\n [attr.disabled]=\"item.disabled\"\r\n [hidden]=\"item.hidden\"\r\n ecNavItemActive=\"is-selected\"\r\n [ecNavItemActiveQueryParams]=\"item.queryParams\"\r\n [ecNavItemActiveUrl]=\"item.url\"\r\n [ecNavItemActiveExactMatch]='item.isActiveExactMatch'\r\n (routerLinkActivated)=\"selectItem($event, item)\"\r\n [ngClass]=\"{'is-highlighted':(selected === item && item?.display !== 'heading') || highlightedItem === item, 'is-link': item.url, 'is-disabled': item.disabled, 'is-readonly': item.readonly, 'is-checked': item.checked, 'text-heading-3': item?.display === 'heading'}\"\r\n (click)=\"selectItem($event, item)\">\r\n\r\n <a *ngIf=\"item.url && !item.externalLink\"\r\n id=\"{{item.id}}_link\"\r\n title=\"{{truncateItems ? item.label : ''}}\"\r\n class=\"item-wrapper\"\r\n [routerLink]=\"item.url\"\r\n [queryParams]=\"item.queryParams || null\"\r\n target=\"{{item.target || '_self'}}\">\r\n <ng-container *ngTemplateOutlet=\"internalizedTemplate; context: {$implicit: item}\"></ng-container>\r\n </a>\r\n\r\n <a *ngIf=\"item.url && item.externalLink\"\r\n id=\"{{item.id}}_link\"\r\n title=\"{{truncateItems ? item.label : ''}}\"\r\n class=\"item-wrapper\"\r\n href=\"{{item.url}}\"\r\n target=\"{{item.target || '_self'}}\">\r\n <ng-container *ngTemplateOutlet=\"internalizedTemplate; context: {$implicit: item}\"></ng-container>\r\n </a>\r\n\r\n <div *ngIf=\"!item.url\"\r\n title=\"{{truncateItems ? item.label : ''}}\"\r\n class=\"item-wrapper\">\r\n <ng-container *ngTemplateOutlet=\"internalizedTemplate; context: {$implicit: item}\"></ng-container>\r\n </div>\r\n </li>\r\n\r\n <ng-container *ngIf=\"item.items?.length && item.display === 'heading'\">\r\n <ng-container *ngFor=\"let subItem of item.items; index as j\"\r\n [ngTemplateOutlet]=\"itemTemplate\"\r\n [ngTemplateOutletContext]=\"{$implicit: subItem, index: i + '-' + j}\">\r\n </ng-container>\r\n </ng-container>\r\n</ng-template>\r\n\r\n<!-- 'label' Item Template -->\r\n<ng-template #label\r\n let-item>\r\n <span id=\"{{item.id}}_label\"\r\n class=\"label\"\r\n [class.text-truncate]=\"truncateItems\">{{item.label}}</span>\r\n\r\n <i class=\"ec-icon icon-angle-down rotate-270\"\r\n *ngIf=\"item?.items && item.display !== 'heading'\"></i>\r\n</ng-template>\r\n\r\n<!-- 'checkAndLabel' Item Template -->\r\n<ng-template #checkAndLabel\r\n let-item>\r\n\r\n <i class=\"ec-icon icon-check ec-icon-sm\"\r\n *ngIf=\"item.display !== 'heading'\"></i>\r\n\r\n <i class=\"ec-icon {{item.icon}} ml-2\"\r\n *ngIf=\"item.icon\"></i>\r\n\r\n <span id=\"{{item.id}}_label\"\r\n class=\"label\"\r\n [class.text-truncate]=\"truncateItems\">{{item.label}}</span>\r\n\r\n <i class=\"ec-icon icon-angle-down rotate-270\"\r\n *ngIf=\"item?.items && item.display !== 'heading'\"></i>\r\n</ng-template>\r\n\r\n<!-- 'iconAndLabel' Item Template -->\r\n<ng-template #iconAndLabel\r\n let-item>\r\n <!-- If menuItem.icon exists and is not blank, show the icon in the menu -->\r\n <i class=\"ec-icon {{item.icon}}\"\r\n *ngIf=\"(item.icon && item.icon !== '') || preserveIconSpace\"></i>\r\n\r\n <span id=\"{{item.id}}_label\"\r\n class=\"label\"\r\n [class.text-truncate]=\"truncateItems\">{{item.label}}</span>\r\n\r\n <i class=\"ec-icon icon-angle-down rotate-270\"\r\n *ngIf=\"item?.items && item.display !== 'heading'\"></i>\r\n</ng-template>\r\n\r\n<ng-template #iconLabelCaption\r\n let-item>\r\n <i class=\"ec-icon {{item.icon}}\"\r\n *ngIf=\"(item.icon && item.icon !== '') || preserveIconSpace\"></i>\r\n <div *ngIf=\"item.display !== 'heading'\"\r\n class=\"label flex-grow\">\r\n <div id=\"{{item.id}}_label\"\r\n class=\"text-body-1\"\r\n [class.text-truncate]=\"truncateItems\">{{item.label}}</div>\r\n <div id=\"{{item.id}}_caption\"\r\n *ngIf=\"item.caption\"\r\n class=\"text-caption-1\"\r\n [class.text-truncate]=\"truncateItems\">{{item.caption}}</div>\r\n </div>\r\n <h3 *ngIf=\"item.display === 'heading'\"\r\n class=\"flex-grow text-heading-3 align-self-center\"\r\n [class.text-truncate]=\"truncateItems\">{{item.label}}</h3>\r\n <i class=\"ec-icon icon-angle-down rotate-270 align-self-center\"\r\n *ngIf=\"item?.items && item.display !== 'heading'\"></i>\r\n</ng-template>", styles: ["@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}:host{display:block;font-size:var(--ec-menu-font-size, var(--ec-font-size-action));font-weight:400;background-color:var(--ec-menu-background-color, var(--ec-background-color))}:host.open>nav>.parent,:host.open>nav>.child{position:absolute;left:0;top:0;right:0;height:100%;transition:transform .25s ease}:host.open>nav>.parent{transform:translate(0)}:host.open>nav>.child{transform:translate(100%)}:host.open-active>nav>.parent{transform:translate(-100%)}:host.open-active>nav>.child{transform:translate(0)}:host(.bg-transparent){background-color:transparent}:host-context(.is-always-open){height:100%}:host-context(.is-always-open) .item-wrapper{padding-left:1rem;padding-right:1rem}nav{display:flex;position:relative;height:100%;overflow:hidden}.parent{display:flex;flex-direction:column;flex:auto;position:relative;max-width:100%}.parent>header{cursor:pointer}.parent>header.is-selected .item-wrapper,.parent>header.is-highlighted .item-wrapper{background-color:var(--ec-background-color-selected)}.parent>header:hover .item-wrapper{background-color:var(--ec-background-color-hover)}.parent.no-data ul{display:none}.parent.no-data .no-data-message{display:block}ul{padding:0;margin:0;list-style:none;flex:auto;height:100%;overflow-y:auto}ul li{cursor:pointer;padding:0 .25rem}ul li a{color:inherit;border-bottom:0;text-decoration:none}ul li.is-selected .item-wrapper,ul li.is-highlighted .item-wrapper{background-color:var(--ec-background-color-selected)}ul li:hover .item-wrapper{background-color:var(--ec-background-color-hover)}ul li:focus .item-wrapper{outline:none;background-color:var(--ec-color-disabled-dark);position:relative;z-index:1}ul li.is-disabled .item-wrapper{color:var(--ec-color-disabled-dark);opacity:var(--ec-form-control-opacity-disabled)}ul li.is-disabled,ul li.is-readonly{cursor:default}ul li.is-disabled .item-wrapper,ul li.is-readonly .item-wrapper{background-color:transparent;color:inherit}ul li.is-checked .icon-check{opacity:1}ul li.heading{cursor:default}ul li.heading .item-wrapper{background-color:transparent}ul li.heading:not(:first-child){margin-top:.5rem}ul li.heading:last-child{display:none}ul li.divider:not(:last-child){border-bottom:1px solid var(--ec-border-color);padding-bottom:.25rem;margin-bottom:.25rem}ul li.divider-top:not(:first-child):not(.divider + .divider-top){border-top:1px solid var(--ec-border-color);padding-top:.25rem;margin-top:.25rem}ul li.indent-1 .item-wrapper{padding-left:1.5rem}ul li.indent-2 .item-wrapper{padding-left:2.5rem}ul li.indent-3 .item-wrapper{padding-left:3.5rem}.item-wrapper{cursor:inherit;line-height:1.25rem;min-height:1.75rem;padding:.25rem .5rem;border-radius:var(--ec-border-radius);display:flex;color:inherit}.item-wrapper .label{margin-right:auto}.item-wrapper .label+.ec-icon{margin-left:.5rem}.item-wrapper .ec-icon{margin-top:calc((1.25rem - var(--ec-font-size-icon)) / 2);flex:none}.item-wrapper .ec-icon+.label{margin-left:.5rem}.item-wrapper .ec-icon-sm{margin-top:calc((1.25rem - calc(var(--ec-font-size-icon) * .75)) / 2)}.item-wrapper .icon-check{opacity:0}.no-data-message{display:none;text-align:center;padding:1rem;color:var(--ec-color-hint-dark);margin-bottom:0;font-size:var(--ec-font-size-body)}:host-context(ec-tree) ul{overflow-x:hidden}:host-context(ec-tree) li.is-selected,:host-context(ec-tree) li.is-highlighted{font-weight:700;color:var(--ec-menu-color-highlighted, inherit)}:host-context(ec-tree) li.is-selected:not(:hover),:host-context(ec-tree) li.is-highlighted:not(:hover){background-color:transparent}\n"] }]
|
2283
|
-
}], ctorParameters: function () { return [{ type:
|
2284
|
-
type: Input
|
2285
|
-
}], attrId: [{
|
2286
|
-
type: HostBinding,
|
2287
|
-
args: ['attr.id']
|
2288
|
-
}], items: [{
|
2588
|
+
args: [{ selector: 'ec-textbox', template: "<div class=\"control control-label-{{labelPosition}}\"\r\n [ngClass]=\"{'is-readonly': readonly}\">\r\n\r\n <label *ngIf=\"label\">\r\n <span>{{label | translate}}</span>\r\n <span *ngIf=\"validationErrors.length > 0 && formModel.touched && formModel.invalid\"> {{validationErrors |\r\n translate}}</span>\r\n <ec-help-popover id=\"{{id}}_helpPopover\"\r\n *ngIf=\"helpPopover\"\r\n class=\"d-inline-block my-n3 mx-n1\"\r\n text=\"{{helpPopover | translate}}\"\r\n contentPosition=\"{{helpPopoverPosition}}\">\r\n </ec-help-popover>\r\n </label>\r\n\r\n <div class=\"input-wrapper control-input\">\r\n <input *ngIf=\"type !== 'multi_line'\"\r\n #textboxInput\r\n email=\"{{type === 'email' ? true : false}}\"\r\n pattern=\"{{validationPattern}}\"\r\n type=\"{{type}}\"\r\n tabindex=\"{{tabindex}}\"\r\n title=\"{{tooltip}}\"\r\n [attr.id]=\"inputId\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.placeholder]=\"placeholder\"\r\n [attr.maxlength]=\"maxlength\"\r\n [attr.minlength]=\"minlength\"\r\n [attr.required]=\"required ? required : null\"\r\n [formControl]=\"formModel\"\r\n [ngClass]=\"{'is-empty': !formModel?.value, 'is-pending': pending, 'is-uppercase': upperCase}\"\r\n (focusout)=\"focusOutEvent()\"\r\n [attr.cdkFocusInitial]=\"autofocus || null\">\r\n\r\n <textarea *ngIf=\"type === 'multi_line'\"\r\n [attr.rows]=\"rows\"\r\n #textboxInput\r\n tabindex=\"{{tabindex}}\"\r\n [attr.id]=\"inputId\"\r\n [attr.placeholder]=\"placeholder\"\r\n [attr.maxlength]=\"maxlength\"\r\n [attr.minlength]=\"minlength\"\r\n [attr.required]=\"required ? required : null\"\r\n [formControl]=\"formModel\"\r\n [ngClass]=\"{'is-empty': formModel?.value === '', 'is-pending': pending}\"\r\n [attr.cdkFocusInitial]=\"autofocus || null\">\r\n </textarea>\r\n\r\n <i class=\"ec-icon icon-required\"></i>\r\n <i class=\"ec-icon icon-invalid\"></i>\r\n <i class=\"ec-icon icon-loading\"></i>\r\n </div>\r\n</div>", styles: [":host{color:var(--ec-form-control-color);font-size:var(--ec-form-control-font-size);display:block;margin-bottom:1rem;width:100%}:host :host-context(.form-condensed){margin-bottom:.5rem}:host .control{width:100%;display:flex;flex-direction:column}:host .control.control-label-bottom{flex-direction:column-reverse}:host .control.control-label-left{flex-direction:row}:host .control.control-label-left label{margin-right:.25rem}:host .control.control-label-right{flex-direction:row-reverse}:host .control.control-label-right label{margin-left:.25rem}:host .control.control-label-left,:host .control.control-label-right{align-items:center}:host .control.control-label-left label,:host .control.control-label-right label{flex:1 1;margin-top:0;margin-bottom:0}:host .control.control-label-left .control-input,:host .control.control-label-right .control-input{flex:2 2}:host .control.is-readonly input,:host .control.is-readonly select,:host .control.is-readonly textarea{border-color:var(--ec-form-control-border-color-readonly);background-color:var(--ec-form-control-background-color-readonly);background-clip:border-box;background-image:none;color:var(--ec-form-control-color-readonly);opacity:1;-webkit-user-select:none;user-select:none;pointer-events:none;overflow:hidden;white-space:nowrap}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid:focus,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid:focus{border-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-invalid{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-required,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-required{display:none}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button{background-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button:not(:focus){border-color:var(--ec-form-control-border-color-invalid)}:host .textbox-group{display:flex;position:relative}:host textarea:focus,:host input:focus,:host select:focus{outline:none}:host label{color:var(--ec-form-control-label-color, var(--ec-color-secondary-dark));display:block;font-size:var(--ec-font-size-label);line-height:1;margin:calc(var(--ec-font-size-label) / 2) 0}:host input{background-color:var(--ec-form-control-background-color);border:1px solid var(--ec-form-control-border-color);border-radius:var(--ec-border-radius);background-image:none;background-clip:padding-box;width:100%;line-height:1.25rem;padding:.3125rem .5rem;height:2rem}:host input::selection{background-color:var(--ec-form-control-background-color-selection);color:var(--ec-form-control-color-selection)}:host input::-webkit-input-placeholder{color:var(--ec-form-control-color-placeholder)}:host input::-moz-placeholder{color:var(--ec-form-control-color-placeholder);opacity:1}:host input:-ms-input-placeholder{color:var(--ec-form-control-color-placeholder)}:host input:-moz-placeholder{color:var(--ec-form-control-color-placeholder);opacity:1}:host input~.icon-required,:host input~.icon-invalid{color:var(--ec-form-control-border-color-invalid)}:host input:required.is-empty{background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host input:required.is-empty~.icon-required{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host input.ng-invalid.ng-touched{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host input.ng-invalid.ng-touched:focus{border-color:var(--ec-form-control-background-color-invalid)}:host input.ng-invalid.ng-touched~.icon-invalid{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host input.ng-invalid.ng-touched~.icon-required{display:none}:host input.is-pending.ng-valid,:host input.is-pending.ng-invalid,:host input.is-pending.ng-pending{background-image:\"\";background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem}:host input.is-pending.ng-valid~.icon-loading,:host input.is-pending.ng-invalid~.icon-loading,:host input.is-pending.ng-pending~.icon-loading{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host input.is-pending.ng-valid~.icon-required,:host input.is-pending.ng-valid~.icon-invalid,:host input.is-pending.ng-invalid~.icon-required,:host input.is-pending.ng-invalid~.icon-invalid,:host input.is-pending.ng-pending~.icon-required,:host input.is-pending.ng-pending~.icon-invalid{display:none}:host input:focus,:host input:focus.is-empty{border-color:var(--ec-form-control-border-color-focus);box-shadow:var(--ec-form-control-box-shadow-focus);position:relative;z-index:1}:host input:disabled{background-color:var(--ec-form-control-background-color-disabled);border-color:var(--ec-form-control-border-color-disabled);color:var(--ec-form-control-color-disabled);opacity:var(--ec-form-control-opacity-disabled)}:host input:disabled:required,:host input:disabled:required.is-empty{background-image:none;padding-left:.5rem;background-color:var(--ec-form-control-background-color-disabled);border-color:var(--ec-form-control-border-color-disabled)}:host input:disabled:required+.icon-required,:host input:disabled:required.is-empty+.icon-required{display:none}:host input.is-uppercase:not(.is-empty){text-transform:uppercase}:host textarea{background-color:var(--ec-form-control-background-color);border:1px solid var(--ec-form-control-border-color);border-radius:var(--ec-border-radius);background-image:none;background-clip:padding-box;width:100%;line-height:1.25rem;padding:.3125rem .5rem;height:auto;resize:none;display:block}:host textarea::selection{background-color:var(--ec-form-control-background-color-selection);color:var(--ec-form-control-color-selection)}:host textarea::-webkit-input-placeholder{color:var(--ec-form-control-color-placeholder)}:host textarea::-moz-placeholder{color:var(--ec-form-control-color-placeholder);opacity:1}:host textarea:-ms-input-placeholder{color:var(--ec-form-control-color-placeholder)}:host textarea:-moz-placeholder{color:var(--ec-form-control-color-placeholder);opacity:1}:host textarea~.icon-required,:host textarea~.icon-invalid{color:var(--ec-form-control-border-color-invalid)}:host textarea:required.is-empty{background-repeat:no-repeat;background-position:.5rem .5rem;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host textarea:required.is-empty~.icon-required{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host textarea.ng-invalid.ng-touched{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-repeat:no-repeat;background-position:.5rem .5rem;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host textarea.ng-invalid.ng-touched:focus{border-color:var(--ec-form-control-background-color-invalid)}:host textarea.ng-invalid.ng-touched~.icon-invalid{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host textarea.ng-invalid.ng-touched~.icon-required{display:none}:host textarea.is-pending.ng-valid,:host textarea.is-pending.ng-invalid,:host textarea.is-pending.ng-pending{background-image:\"\";background-repeat:no-repeat;background-position:.5rem .5rem;background-size:1rem,1rem;padding-left:1.75rem}:host textarea.is-pending.ng-valid~.icon-loading,:host textarea.is-pending.ng-invalid~.icon-loading,:host textarea.is-pending.ng-pending~.icon-loading{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host textarea.is-pending.ng-valid~.icon-required,:host textarea.is-pending.ng-valid~.icon-invalid,:host textarea.is-pending.ng-invalid~.icon-required,:host textarea.is-pending.ng-invalid~.icon-invalid,:host textarea.is-pending.ng-pending~.icon-required,:host textarea.is-pending.ng-pending~.icon-invalid{display:none}:host textarea:focus,:host textarea:focus.is-empty{border-color:var(--ec-form-control-border-color-focus);box-shadow:var(--ec-form-control-box-shadow-focus);position:relative;z-index:1}:host textarea:disabled{background-color:var(--ec-form-control-background-color-disabled);border-color:var(--ec-form-control-border-color-disabled);color:var(--ec-form-control-color-disabled);opacity:var(--ec-form-control-opacity-disabled)}:host textarea:disabled:required,:host textarea:disabled:required.is-empty{background-image:none;padding-left:.5rem;background-color:var(--ec-form-control-background-color-disabled);border-color:var(--ec-form-control-border-color-disabled)}:host textarea:disabled:required+.icon-required,:host textarea:disabled:required.is-empty+.icon-required{display:none}:host textarea.is-uppercase:not(.is-empty){text-transform:uppercase}.input-wrapper{position:relative}.input-wrapper>.ec-icon{display:none}:host(.textbox-group-input:not(:last-child)){flex:1 1 0%;width:1px}:host(.textbox-group-input:not(:last-child)) .control{margin-bottom:0}:host(.textbox-group-input:not(:last-child)) .control.is-readonly input{border-right-width:1px}:host(.textbox-group-input:not(:last-child)) input{border-top-right-radius:0;border-bottom-right-radius:0;border-right-width:0}:host(.textbox-group-input:not(:last-child)) input:focus{position:relative;z-index:1;border-right-width:1px}:host(.text-truncate) input{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host(.is-monospace) input,:host(.is-monospace) textarea,:host-context(.is-monospace) input,:host-context(.is-monospace) textarea{font-family:var(--ec-font-family-monospace)}\n"] }]
|
2589
|
+
}], ctorParameters: function () { return [{ type: ValidationMessageService }, { type: FormGroupHelper }, { type: i2.TranslateService }]; }, propDecorators: { autocomplete: [{
|
2289
2590
|
type: Input
|
2290
|
-
}],
|
2591
|
+
}], type: [{
|
2291
2592
|
type: Input
|
2292
|
-
}],
|
2593
|
+
}], placeholder: [{
|
2293
2594
|
type: Input
|
2294
|
-
}],
|
2595
|
+
}], maxlength: [{
|
2295
2596
|
type: Input
|
2296
|
-
}],
|
2597
|
+
}], minlength: [{
|
2297
2598
|
type: Input
|
2298
|
-
}],
|
2599
|
+
}], rows: [{
|
2299
2600
|
type: Input
|
2300
|
-
}],
|
2601
|
+
}], selectOnAutofocus: [{
|
2301
2602
|
type: Input
|
2302
|
-
}],
|
2603
|
+
}], upperCase: [{
|
2303
2604
|
type: Input
|
2304
|
-
}],
|
2605
|
+
}], inputElement: [{
|
2606
|
+
type: ViewChild,
|
2607
|
+
args: ['textboxInput']
|
2608
|
+
}] } });
|
2609
|
+
|
2610
|
+
/** Exposes the markup and styles that represent the spinner. No inputs or outputs defined because it is just a visual component*/
|
2611
|
+
class SpinnerComponent {
|
2612
|
+
}
|
2613
|
+
SpinnerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SpinnerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
2614
|
+
SpinnerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: SpinnerComponent, selector: "ec-spinner", ngImport: i0, template: "<div class=\"spinner\">\r\n <span class=\"spinner-dot\"></span>\r\n <span class=\"spinner-dot\"></span>\r\n <span class=\"spinner-dot\"></span>\r\n <span class=\"spinner-dot\"></span>\r\n</div>", styles: ["@keyframes sk-bouncedelay{0%,80%,to{opacity:0}40%{opacity:1}}.spinner{display:flex}.spinner-dot{width:.75rem;height:.75rem;background-color:var(--ec-color-interactive);animation:sk-bouncedelay 1.7s infinite ease-in-out both;margin-right:.25rem}.spinner-dot:nth-child(1){animation-delay:-.6s}.spinner-dot:nth-child(2){animation-delay:-.4s}.spinner-dot:nth-child(3){animation-delay:-.2s}:host(.spinner-small) .spinner-dot{width:.5rem;height:.5rem;background-color:var(--ec-color-interactive);animation:sk-bouncedelay 1.7s infinite ease-in-out both;margin-right:.1666666667rem}:host(.spinner-small) .spinner-dot:nth-child(1){animation-delay:-.6s}:host(.spinner-small) .spinner-dot:nth-child(2){animation-delay:-.4s}:host(.spinner-small) .spinner-dot:nth-child(3){animation-delay:-.2s}\n"] });
|
2615
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SpinnerComponent, decorators: [{
|
2616
|
+
type: Component,
|
2617
|
+
args: [{ selector: 'ec-spinner', template: "<div class=\"spinner\">\r\n <span class=\"spinner-dot\"></span>\r\n <span class=\"spinner-dot\"></span>\r\n <span class=\"spinner-dot\"></span>\r\n <span class=\"spinner-dot\"></span>\r\n</div>", styles: ["@keyframes sk-bouncedelay{0%,80%,to{opacity:0}40%{opacity:1}}.spinner{display:flex}.spinner-dot{width:.75rem;height:.75rem;background-color:var(--ec-color-interactive);animation:sk-bouncedelay 1.7s infinite ease-in-out both;margin-right:.25rem}.spinner-dot:nth-child(1){animation-delay:-.6s}.spinner-dot:nth-child(2){animation-delay:-.4s}.spinner-dot:nth-child(3){animation-delay:-.2s}:host(.spinner-small) .spinner-dot{width:.5rem;height:.5rem;background-color:var(--ec-color-interactive);animation:sk-bouncedelay 1.7s infinite ease-in-out both;margin-right:.1666666667rem}:host(.spinner-small) .spinner-dot:nth-child(1){animation-delay:-.6s}:host(.spinner-small) .spinner-dot:nth-child(2){animation-delay:-.4s}:host(.spinner-small) .spinner-dot:nth-child(3){animation-delay:-.2s}\n"] }]
|
2618
|
+
}] });
|
2619
|
+
|
2620
|
+
class Overlay {
|
2621
|
+
constructor(status, message) {
|
2622
|
+
this.status = 'hasData';
|
2623
|
+
this.message = '';
|
2624
|
+
this.setStatus(status, message);
|
2625
|
+
}
|
2626
|
+
setStatus(status, message, action, noDataTemplate, overlayClassList) {
|
2627
|
+
this.status = status;
|
2628
|
+
this.message = message || '';
|
2629
|
+
this.action = action || undefined;
|
2630
|
+
this.noDataTemplate = noDataTemplate || undefined;
|
2631
|
+
this.overlayClassList = overlayClassList || '';
|
2632
|
+
}
|
2633
|
+
}
|
2634
|
+
/**
|
2635
|
+
* Wraps content in order to show pending, error, and no data states with an optional message/noDataTemplate
|
2636
|
+
*/
|
2637
|
+
class ViewOverlayComponent {
|
2638
|
+
constructor() {
|
2639
|
+
this.status = 'hasData';
|
2640
|
+
}
|
2641
|
+
setStatus(status, message, action, noDataTemplate) {
|
2642
|
+
this.status = status;
|
2643
|
+
this.message = message || '';
|
2644
|
+
this.action = action || undefined;
|
2645
|
+
this.noDataTemplate = noDataTemplate || undefined;
|
2646
|
+
}
|
2647
|
+
actionClicked(event) {
|
2648
|
+
if (this.action && this.action.onClick) {
|
2649
|
+
this.action.onClick(event);
|
2650
|
+
}
|
2651
|
+
}
|
2652
|
+
}
|
2653
|
+
ViewOverlayComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ViewOverlayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
2654
|
+
ViewOverlayComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: ViewOverlayComponent, selector: "[ecOverlay]", inputs: { status: "status", message: "message", action: "action", noDataTemplate: "noDataTemplate", displayAsMask: "displayAsMask", overlayClassList: "overlayClassList" }, ngImport: i0, template: "<!-- Transcluded Content -->\r\n<ng-content *ngIf=\"displayAsMask || (!displayAsMask && status === 'hasData')\"></ng-content>\r\n<!--Used by GI tests to know the overlay status whether we use ngIf or mask version. No visual impact-->\r\n<span [hidden]=\"true\"\r\n\t class=\"overlay-status-{{status}}\"></span>\r\n<!-- Overlay goes last so it is rendered on top of preceding content due to source order -->\r\n<div *ngIf=\"status !== 'hasData'\"\r\n\t class=\"overlay flex-grow {{overlayClassList}}\"\r\n\t [ngClass]=\"{'not-mask': !displayAsMask,\r\n\t\t\t\t'overlay-error': status === 'error',\r\n\t\t\t\t'overlay-nodata': status === 'noData',\r\n\t\t\t\t'overlay-pending': status === 'pending'}\">\r\n\r\n\t<!--Pending Spinner-->\r\n\t<ec-spinner [hidden]=\"status !== 'pending'\"></ec-spinner>\r\n\r\n\t<ng-template [ngIf]=\"status === 'noData' && noDataTemplate\">\r\n\t\t<ng-container *ngTemplateOutlet=\"noDataTemplate\"></ng-container>\r\n\t</ng-template>\r\n\r\n\t<ng-container *ngIf=\"(status === 'noData' && !noDataTemplate) || status !== 'noData'\">\r\n\t\t<!--Status Message-->\r\n\t\t<div id=\"statusMessage\"\r\n\t\t\t class=\"message\"\r\n\t\t\t *ngIf=\"message\"\r\n\t\t\t [ngClass]=\"{'error': status === 'error', 'mt-1': status === 'pending'}\"\r\n\t\t\t [innerHtml]=\"message | translate\">\r\n\t\t</div>\r\n\r\n\t\t<!-- Action -->\r\n\t\t<ec-button type=\"common\"\r\n\t\t\t\t class=\"mt-3\"\r\n\t\t\t\t *ngIf=\"action?.onClick\"\r\n\t\t\t\t [icon]=\"action?.icon\"\r\n\t\t\t\t (clicked)=\"actionClicked($event)\"\r\n\t\t\t\t [label]=\"action?.label\"\r\n\t\t\t\t [hidden]=\"status === 'pending'\">\r\n\t\t</ec-button>\r\n\t</ng-container>\r\n\r\n</div>", styles: [":host{position:relative}:host(.bg-body)>.overlay{background-color:var(--ec-background-color-body)}:host(.bg-body).is-translucent>.overlay{background-color:var(--ec-background-color-overlay)}:host(.bg-content)>.overlay{background-color:var(--ec-background-color)}:host(.bg-content).is-translucent>.overlay{background-color:var(--ec-background-color-overlay)}.overlay{align-items:center;background-color:var(--ec-overlay-background-color, var(--ec-background-color));display:flex;flex-direction:column;justify-content:center;padding:3rem 4rem;z-index:var(--ec-z-index-overlay);position:absolute;inset:0}.overlay.not-mask{position:relative;min-height:100%}.message{color:var(--ec-color-secondary-dark);font-size:var(--ec-font-size-title)}.message.error{color:var(--ec-color-danger);font-size:var(--ec-font-size-title)}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ButtonComponent, selector: "ec-button", inputs: ["id", "disabled", "icon", "label", "badge", "tabindex", "type", "pending", "pendingIcon", "customTemplate", "isSubmit", "autofocus"], outputs: ["clicked"] }, { kind: "component", type: SpinnerComponent, selector: "ec-spinner" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] });
|
2655
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ViewOverlayComponent, decorators: [{
|
2656
|
+
type: Component,
|
2657
|
+
args: [{ selector: '[ecOverlay]', template: "<!-- Transcluded Content -->\r\n<ng-content *ngIf=\"displayAsMask || (!displayAsMask && status === 'hasData')\"></ng-content>\r\n<!--Used by GI tests to know the overlay status whether we use ngIf or mask version. No visual impact-->\r\n<span [hidden]=\"true\"\r\n\t class=\"overlay-status-{{status}}\"></span>\r\n<!-- Overlay goes last so it is rendered on top of preceding content due to source order -->\r\n<div *ngIf=\"status !== 'hasData'\"\r\n\t class=\"overlay flex-grow {{overlayClassList}}\"\r\n\t [ngClass]=\"{'not-mask': !displayAsMask,\r\n\t\t\t\t'overlay-error': status === 'error',\r\n\t\t\t\t'overlay-nodata': status === 'noData',\r\n\t\t\t\t'overlay-pending': status === 'pending'}\">\r\n\r\n\t<!--Pending Spinner-->\r\n\t<ec-spinner [hidden]=\"status !== 'pending'\"></ec-spinner>\r\n\r\n\t<ng-template [ngIf]=\"status === 'noData' && noDataTemplate\">\r\n\t\t<ng-container *ngTemplateOutlet=\"noDataTemplate\"></ng-container>\r\n\t</ng-template>\r\n\r\n\t<ng-container *ngIf=\"(status === 'noData' && !noDataTemplate) || status !== 'noData'\">\r\n\t\t<!--Status Message-->\r\n\t\t<div id=\"statusMessage\"\r\n\t\t\t class=\"message\"\r\n\t\t\t *ngIf=\"message\"\r\n\t\t\t [ngClass]=\"{'error': status === 'error', 'mt-1': status === 'pending'}\"\r\n\t\t\t [innerHtml]=\"message | translate\">\r\n\t\t</div>\r\n\r\n\t\t<!-- Action -->\r\n\t\t<ec-button type=\"common\"\r\n\t\t\t\t class=\"mt-3\"\r\n\t\t\t\t *ngIf=\"action?.onClick\"\r\n\t\t\t\t [icon]=\"action?.icon\"\r\n\t\t\t\t (clicked)=\"actionClicked($event)\"\r\n\t\t\t\t [label]=\"action?.label\"\r\n\t\t\t\t [hidden]=\"status === 'pending'\">\r\n\t\t</ec-button>\r\n\t</ng-container>\r\n\r\n</div>", styles: [":host{position:relative}:host(.bg-body)>.overlay{background-color:var(--ec-background-color-body)}:host(.bg-body).is-translucent>.overlay{background-color:var(--ec-background-color-overlay)}:host(.bg-content)>.overlay{background-color:var(--ec-background-color)}:host(.bg-content).is-translucent>.overlay{background-color:var(--ec-background-color-overlay)}.overlay{align-items:center;background-color:var(--ec-overlay-background-color, var(--ec-background-color));display:flex;flex-direction:column;justify-content:center;padding:3rem 4rem;z-index:var(--ec-z-index-overlay);position:absolute;inset:0}.overlay.not-mask{position:relative;min-height:100%}.message{color:var(--ec-color-secondary-dark);font-size:var(--ec-font-size-title)}.message.error{color:var(--ec-color-danger);font-size:var(--ec-font-size-title)}\n"] }]
|
2658
|
+
}], propDecorators: { status: [{
|
2305
2659
|
type: Input
|
2306
|
-
}],
|
2660
|
+
}], message: [{
|
2307
2661
|
type: Input
|
2308
|
-
}],
|
2662
|
+
}], action: [{
|
2309
2663
|
type: Input
|
2310
|
-
}],
|
2664
|
+
}], noDataTemplate: [{
|
2311
2665
|
type: Input
|
2312
|
-
}],
|
2666
|
+
}], displayAsMask: [{
|
2313
2667
|
type: Input
|
2314
|
-
}],
|
2668
|
+
}], overlayClassList: [{
|
2315
2669
|
type: Input
|
2316
|
-
}], selectedChanged: [{
|
2317
|
-
type: Output
|
2318
|
-
}], menuClosed: [{
|
2319
|
-
type: Output
|
2320
|
-
}], labelTemplate: [{
|
2321
|
-
type: ViewChild,
|
2322
|
-
args: ['label', { static: true }]
|
2323
|
-
}], iconAndLabelTemplate: [{
|
2324
|
-
type: ViewChild,
|
2325
|
-
args: ['iconAndLabel', { static: true }]
|
2326
|
-
}], checkAndLabelTemplate: [{
|
2327
|
-
type: ViewChild,
|
2328
|
-
args: ['checkAndLabel', { static: true }]
|
2329
|
-
}], iconLabelCaptionTemplate: [{
|
2330
|
-
type: ViewChild,
|
2331
|
-
args: ['iconLabelCaption', { static: true }]
|
2332
2670
|
}] } });
|
2333
2671
|
|
2334
2672
|
/**
|
@@ -2484,6 +2822,11 @@ class ComboboxComponent extends FormControlBase {
|
|
2484
2822
|
* Number of filtered options to display in the footer. Excludes headings.
|
2485
2823
|
*/
|
2486
2824
|
this.filteredOptionCount = 0;
|
2825
|
+
/**
|
2826
|
+
* Flat list of selectable items in the combobox.
|
2827
|
+
* Does not include headings or divider-section items.
|
2828
|
+
*/
|
2829
|
+
this.selectableItems = [];
|
2487
2830
|
/**
|
2488
2831
|
* Index of the currently-selected options
|
2489
2832
|
*/
|
@@ -2620,13 +2963,14 @@ class ComboboxComponent extends FormControlBase {
|
|
2620
2963
|
*/
|
2621
2964
|
resetOptions(options) {
|
2622
2965
|
this.filteredOptions = options || this.options;
|
2966
|
+
this.selectableItems = MenuComponent.getSelectableItems(this.filteredOptions);
|
2623
2967
|
// do not count headings
|
2624
|
-
this.filteredOptionCount = this.filteredOptions?.filter(o => o.display !== 'heading').length || 0;
|
2968
|
+
this.filteredOptionCount = this.filteredOptions?.filter(o => o.display !== 'heading' && o.display !== 'divided-section').length || 0;
|
2625
2969
|
//if they have no search term, don't try to select anything so they can clear the box out by hitting enter
|
2626
2970
|
//if they have a search term and the options changed, select an option from the menu so they will get it automatically if they hit enter
|
2627
2971
|
if (this.textboxFormModel.value !== '') {
|
2628
|
-
this.selectedItemIndex = this.findDefaultSelectionIndex(this.
|
2629
|
-
this.selectedItem = this.
|
2972
|
+
this.selectedItemIndex = this.findDefaultSelectionIndex(this.selectableItems, this.textboxFormModel.value);
|
2973
|
+
this.selectedItem = this.selectableItems[this.selectedItemIndex] || null;
|
2630
2974
|
this.scrollMenu(this.selectedItemIndex);
|
2631
2975
|
}
|
2632
2976
|
else {
|
@@ -2820,18 +3164,11 @@ class ComboboxComponent extends FormControlBase {
|
|
2820
3164
|
if (this.selectedItemIndex === -1 && this.addNewButton && !this.addNewButton.nativeElement.hidden && !this.addNewSelected) {
|
2821
3165
|
this.addNewSelected = true;
|
2822
3166
|
}
|
2823
|
-
else if (this.selectedItemIndex < this.
|
3167
|
+
else if (this.selectedItemIndex < this.selectableItems.length - 1) {
|
3168
|
+
this.selectedItemIndex++;
|
2824
3169
|
if (this.addNewSelected) {
|
2825
3170
|
this.addNewSelected = false;
|
2826
3171
|
}
|
2827
|
-
//if the last item is a heading and we are on the second last item, we shouldn't increment the selectedItemIndex because that would select the heading
|
2828
|
-
if (!(this.selectedItemIndex == this.filteredOptions.length - 2 && this.filteredOptions[this.selectedItemIndex + 1].display === 'heading')) {
|
2829
|
-
this.selectedItemIndex++;
|
2830
|
-
// Skip any in-menu heading items
|
2831
|
-
if (this.selectedItemIndex < this.filteredOptions.length - 1 && this.filteredOptions[this.selectedItemIndex].display === 'heading') {
|
2832
|
-
this.selectedItemIndex++;
|
2833
|
-
}
|
2834
|
-
}
|
2835
3172
|
}
|
2836
3173
|
break;
|
2837
3174
|
case "ArrowUp":
|
@@ -2840,30 +3177,16 @@ class ComboboxComponent extends FormControlBase {
|
|
2840
3177
|
this.addNewSelected = false;
|
2841
3178
|
}
|
2842
3179
|
else if (this.selectedItemIndex > -1) {
|
2843
|
-
if (this.selectedItemIndex === 0 && this.addNewButton && !this.addNewButton.nativeElement.hidden) {
|
2844
|
-
this.addNewSelected = true;
|
2845
|
-
}
|
2846
3180
|
this.selectedItemIndex--;
|
2847
|
-
|
2848
|
-
|
2849
|
-
this.selectedItemIndex--;
|
2850
|
-
//if the selectedItemIndex is -1, that means the very first item was a heading and we just skipped over it.
|
2851
|
-
if (this.selectedItemIndex == -1) {
|
2852
|
-
//if there is an add new button we should select it. otherwise we should lock them at index 1 (right before the heading)
|
2853
|
-
if (this.addNewButton && !this.addNewButton.nativeElement.hidden) {
|
2854
|
-
this.addNewSelected = true;
|
2855
|
-
}
|
2856
|
-
else {
|
2857
|
-
this.selectedItemIndex = 1;
|
2858
|
-
}
|
2859
|
-
}
|
3181
|
+
if (this.selectedItemIndex === -1 && this.addNewButton && !this.addNewButton.nativeElement.hidden) {
|
3182
|
+
this.addNewSelected = true;
|
2860
3183
|
}
|
2861
3184
|
}
|
2862
3185
|
break;
|
2863
3186
|
default:
|
2864
3187
|
return;
|
2865
3188
|
}
|
2866
|
-
this.selectedItem = this.
|
3189
|
+
this.selectedItem = this.selectableItems[this.selectedItemIndex];
|
2867
3190
|
if (this.menuStatus === 'hidden') {
|
2868
3191
|
this.setFormModelValue(this.selectedItem);
|
2869
3192
|
}
|
@@ -2882,10 +3205,16 @@ class ComboboxComponent extends FormControlBase {
|
|
2882
3205
|
filterOptionsArray(filterText) {
|
2883
3206
|
let searchText = filterText.toLowerCase();
|
2884
3207
|
if (filterText && filterText !== '') {
|
2885
|
-
|
2886
|
-
|
2887
|
-
|
2888
|
-
|
3208
|
+
const matchesSearch = (item) => item.label.toLowerCase().indexOf(searchText) >= 0 || (item.caption && item.caption.toLowerCase().indexOf(searchText) >= 0);
|
3209
|
+
return this.options.reduce((filteredItems, item) => {
|
3210
|
+
if (!item.items?.length && matchesSearch(item)) {
|
3211
|
+
filteredItems.push(item);
|
3212
|
+
}
|
3213
|
+
else if (item.items?.length && (item.display === 'heading' || item.display === 'divided-section')) {
|
3214
|
+
filteredItems.push({ ...item, items: item.items.filter(matchesSearch) });
|
3215
|
+
}
|
3216
|
+
return filteredItems;
|
3217
|
+
}, []);
|
2889
3218
|
}
|
2890
3219
|
else {
|
2891
3220
|
return this.options;
|
@@ -2902,7 +3231,7 @@ class ComboboxComponent extends FormControlBase {
|
|
2902
3231
|
findSelectedItemIndex(item) {
|
2903
3232
|
let itemToFind = item ? item : this.selectedItem;
|
2904
3233
|
if (itemToFind) {
|
2905
|
-
return this.
|
3234
|
+
return this.selectableItems.findIndex(item => {
|
2906
3235
|
if (item.id && itemToFind.id) {
|
2907
3236
|
return item.label === itemToFind.label && item.id === itemToFind.id;
|
2908
3237
|
}
|
@@ -2928,7 +3257,7 @@ class ComboboxComponent extends FormControlBase {
|
|
2928
3257
|
this.textboxFormModel.setValue(data.selectedLabel || data.label);
|
2929
3258
|
this.selectedItemIndex = this.findSelectedItemIndex(data);
|
2930
3259
|
if (this.selectedItemIndex >= 0) {
|
2931
|
-
this.selectedItem = this.
|
3260
|
+
this.selectedItem = this.selectableItems[this.selectedItemIndex];
|
2932
3261
|
}
|
2933
3262
|
}
|
2934
3263
|
else {
|
@@ -2949,10 +3278,10 @@ class ComboboxComponent extends FormControlBase {
|
|
2949
3278
|
if (this.selectedItemIndex > -1 && this.selectedItem) {
|
2950
3279
|
// The menu component will automatically generate ids for the menu items if they dont have them,
|
2951
3280
|
// so they need to be accounted for here since the combobox doesn't know about those ids
|
2952
|
-
let
|
3281
|
+
let itemId = this.selectedItem.id ? this.selectedItem.id : MenuComponent.getIndexedItemId(this.filteredOptions, this.selectedItem, `${this.id}_menu`);
|
2953
3282
|
//trigger the scrolling after a tick to allow the menu to be up to date (and pending mask cleared) before measuring
|
2954
3283
|
setTimeout(() => {
|
2955
|
-
this.scrollService.scrollItemCentered(`#${this.id}_menu_list`,
|
3284
|
+
this.scrollService.scrollItemCentered(`#${this.id}_menu_list`, `#${itemId}`);
|
2956
3285
|
}, 0);
|
2957
3286
|
}
|
2958
3287
|
else {
|
@@ -3118,10 +3447,10 @@ class ComboboxComponent extends FormControlBase {
|
|
3118
3447
|
findDefaultSelectionIndex(options, searchText) {
|
3119
3448
|
let index = -1;
|
3120
3449
|
if (options && options.length) {
|
3121
|
-
index = options.findIndex(option => option != null
|
3450
|
+
index = options.findIndex(option => option != null);
|
3122
3451
|
if (searchText) {
|
3123
3452
|
searchText = searchText.toLowerCase().trim();
|
3124
|
-
let exactMatchIndex = options.findIndex(option => option.label.toLowerCase() == searchText
|
3453
|
+
let exactMatchIndex = options.findIndex(option => option.label.toLowerCase() == searchText);
|
3125
3454
|
if (exactMatchIndex >= 0) {
|
3126
3455
|
index = exactMatchIndex;
|
3127
3456
|
}
|
@@ -3131,10 +3460,10 @@ class ComboboxComponent extends FormControlBase {
|
|
3131
3460
|
}
|
3132
3461
|
}
|
3133
3462
|
ComboboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ComboboxComponent, deps: [{ token: ValidationMessageService }, { token: FormGroupHelper }, { token: i2.TranslateService }, { token: ScrollService }], target: i0.ɵɵFactoryTarget.Component });
|
3134
|
-
ComboboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: ComboboxComponent, selector: "ec-combobox", inputs: { addNew: "addNew", addNewOptions: "addNewOptions", maxlength: "maxlength", menuPosition: "menuPosition", minlength: "minlength", options: "options", templateType: "templateType", customMenuTemplate: "customMenuTemplate", preserveIconSpace: "preserveIconSpace", popupFixed: "popupFixed", totalRecords: "totalRecords", upperCase: "upperCase", placeholder: "placeholder", loadOnOpenObservable: "loadOnOpenObservable", hideToggleButton: "hideToggleButton", alwaysOpen: "alwaysOpen", menuElementClasses: "menuElementClasses", textboxElementClasses: "textboxElementClasses", hideNoMatches: "hideNoMatches", noMatchesText: "noMatchesText", truncateItems: "truncateItems" }, outputs: { addNewClick: "addNewClick", search: "search" }, host: { listeners: { "window:resize": "onResize()" } }, viewQueries: [{ propertyName: "textbox", first: true, predicate: ["textbox"], descendants: true }, { propertyName: "popup", first: true, predicate: PopupContainerDirective, descendants: true }, { propertyName: "addNewButton", first: true, predicate: ["addNewButton"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"control control-label-{{labelPosition}}\"\r\n [ngClass]=\"{'open': menuStatus === 'visible',\r\n 'invalid': formModel.touched && formModel.invalid,\r\n 'has-icon': ((templateType === 'iconAndLabel' || templateType === 'iconLabelCaption') && formModel.value && formModel.value.icon && formModel.value.label === textboxFormModel.value),\r\n 'is-readonly': readonly,\r\n 'is-disabled': formModel.disabled,\r\n 'is-always-open': alwaysOpen}\">\r\n\r\n <label *ngIf=\"label\" ngPreserveWhitespaces>\r\n <span>{{label | translate}}</span>\r\n <span *ngIf=\"validationErrors.length > 0 && formModel.touched && formModel.invalid\">{{validationErrors}}</span>\r\n </label>\r\n\r\n <ng-container *ngIf=\"alwaysOpen; else popupTarget\">\r\n <div class=\"textbox-group control-input\" [ngClass]=\"textboxElementClasses\">\r\n <ng-container *ngTemplateOutlet=\"textbox\"></ng-container>\r\n </div>\r\n\r\n <ng-container *ngIf=\"filteredOptions.length > 0 || textboxFormModel.value\">\r\n <ng-container *ngTemplateOutlet=\"dropdownmenu\"></ng-container>\r\n </ng-container>\r\n </ng-container>\r\n</div>\r\n\r\n<ng-template #popupTarget>\r\n <div class=\"textbox-group control-input\" [ngClass]=\"textboxElementClasses\" *ecPopup=\"dropdownmenu\">\r\n <ng-container *ngTemplateOutlet=\"textbox\"></ng-container>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #textbox>\r\n <i class=\"ec-icon {{formModel.value?.icon}}\"></i>\r\n\r\n <ec-textbox class=\"textbox-group-input mb-0\"\r\n #textbox\r\n [id]=\"id\"\r\n [autofocus]=\"autofocus\"\r\n [formModel]=\"textboxFormModel\"\r\n [maxlength]=\"maxlength\"\r\n [minlength]=\"minlength\"\r\n [placeholder]=\"effectivePlaceholder\"\r\n [required]=\"required\"\r\n [tabindex]=\"tabindex\"\r\n [readonly]=\"readonly\"\r\n (input)=\"textboxValueChanged($event)\"\r\n (keydown)=\"keyNavigate($event)\"\r\n (focusout)=\"onBlur()\"\r\n [upperCase]=\"upperCase\"\r\n [pending]=\"pending && alwaysOpen\"\r\n [autocomplete]=\"'off'\"></ec-textbox>\r\n\r\n <ec-button class=\"textbox-group-btn-right\"\r\n *ngIf=\"!hideToggleButton\"\r\n [id]=\"id + '_button'\"\r\n [disabled]=\"formModel.disabled\"\r\n icon=\"icon-caret-down\"\r\n [tabindex]=\"-1\"\r\n type=\"secondary\"\r\n (click)=\"toggleMenu($event)\"\r\n (keydown)=\"keyNavigate($event)\"\r\n [class.active]=\"menuStatus === 'visible'\"></ec-button>\r\n</ng-template>\r\n\r\n<ng-template #dropdownmenu>\r\n <div class=\"popup\"\r\n ecOverlay\r\n [status]=\"pending && !alwaysOpen ? 'pending' : 'hasData'\">\r\n\r\n <button class=\"add-new {{addNewOptions?.classList}}\"\r\n id=\"{{id}}_addNew\"\r\n #addNewButton\r\n [class.is-selected]=\"addNewSelected\"\r\n *ngIf=\"addNew\"\r\n [hidden]=\"foundMatch || (addNew === 'dynamic' && (!textboxFormModel.value || (formModel.value && textboxFormModel.value === formModel.value.label)))\"\r\n (click)=\"onAddNew($event)\">\r\n <span class=\"add-new-label ec-util-truncate\">\r\n <span *ngIf=\"addNew === 'static' || addNew === true\"\r\n translate>{{addNewOptions?.label}}\r\n </span>\r\n <span *ngIf=\"addNew === 'dynamic'\">{{'Add' | translate}} <strong \r\n class=\"ec-util-truncate\" \r\n [ngClass]=\"{'text-uppercase': upperCase}\">{{textboxFormModel.value}}</strong>\r\n </span>\r\n </span>\r\n <i class=\"ec-icon {{addNewOptions?.icon}}\"></i>\r\n </button>\r\n\r\n <ec-menu id=\"{{id}}_menu\"\r\n [class.border-top-0]=\"!filteredOptions.length && hideNoMatches\"\r\n [ngClass]=\"menuElementClasses\"\r\n [templateType]=\"templateType\"\r\n [customMenuTemplate]=\"customMenuTemplate\"\r\n [showNoItems]=\"!hideNoMatches\"\r\n [noDataText]=\"noMatchesText\"\r\n [items]=\"filteredOptions\"\r\n [selected]=\"selectedItem\"\r\n (selectedChanged)=\"selectedChanged($event)\"\r\n [preserveIconSpace]=\"preserveIconSpace\"\r\n [truncateItems]=\"truncateItems\"></ec-menu>\r\n\r\n <footer *ngIf=\"totalRecords && totalRecords > filteredOptions.length && filteredOptions.length > 0\">\r\n <span>{{filteredOptionCount}} {{'of' | translate}} {{totalRecords}}</span>\r\n </footer>\r\n </div>\r\n</ng-template>\r\n", styles: [":host{color:var(--ec-form-control-color);font-size:var(--ec-form-control-font-size);display:block;margin-bottom:1rem;width:100%}:host :host-context(.form-condensed){margin-bottom:.5rem}:host .control{width:100%;display:flex;flex-direction:column}:host .control.control-label-bottom{flex-direction:column-reverse}:host .control.control-label-left{flex-direction:row}:host .control.control-label-left label{margin-right:.25rem}:host .control.control-label-right{flex-direction:row-reverse}:host .control.control-label-right label{margin-left:.25rem}:host .control.control-label-left,:host .control.control-label-right{align-items:center}:host .control.control-label-left label,:host .control.control-label-right label{flex:1 1;margin-top:0;margin-bottom:0}:host .control.control-label-left .control-input,:host .control.control-label-right .control-input{flex:2 2}:host .control.is-readonly input,:host .control.is-readonly select,:host .control.is-readonly textarea{border-color:var(--ec-form-control-border-color-readonly);background-color:var(--ec-form-control-background-color-readonly);background-clip:border-box;background-image:none;color:var(--ec-form-control-color-readonly);opacity:1;-webkit-user-select:none;user-select:none;pointer-events:none;overflow:hidden;white-space:nowrap}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid:focus,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid:focus{border-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-invalid{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-required,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-required{display:none}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button{background-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button:not(:focus){border-color:var(--ec-form-control-border-color-invalid)}:host .textbox-group{display:flex;position:relative}:host textarea:focus,:host input:focus,:host select:focus{outline:none}:host(.invalid) .control .textbox-group-input ::ng-deep .control input.ng-invalid,:host(.invalid) .control .textbox-group-input ::ng-deep .control input.ng-valid{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host(.invalid) .control .textbox-group-input ::ng-deep .control input.ng-invalid:focus,:host(.invalid) .control .textbox-group-input ::ng-deep .control input.ng-valid:focus{border-color:var(--ec-form-control-background-color-invalid)}:host(.invalid) .control .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-invalid,:host(.invalid) .control .textbox-group-input ::ng-deep .control input.ng-valid~.icon-invalid{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host(.invalid) .control .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-required,:host(.invalid) .control .textbox-group-input ::ng-deep .control input.ng-valid~.icon-required{display:none}:host(.invalid) .control:not(.open) .textbox-group-btn-right ::ng-deep button{background-color:var(--ec-form-control-background-color-invalid)}:host(.invalid) .control:not(.open) .textbox-group-btn-right ::ng-deep button:not(:focus){border-color:var(--ec-form-control-border-color-invalid)}.control{position:relative}.control ec-textbox ::ng-deep input.ng-invalid.ng-touched{background-image:none;padding-left:.5rem}.control ec-textbox ::ng-deep input.ng-invalid.ng-touched:not(.is-empty)~.units-left{left:0}.control ec-textbox ::ng-deep input:required:not(:disabled).is-empty{background-image:none;background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem}.control ec-textbox ::ng-deep input:required:not(:disabled).is-empty:focus{border-color:var(--ec-form-control-border-color-focus);box-shadow:var(--ec-form-control-box-shadow-focus);position:relative;z-index:1}.control .textbox-group .ec-icon{display:none;position:absolute;top:.5rem;left:.5rem;z-index:2}.control.has-icon:not(.invalid) .ec-icon{display:inline-flex}.control.has-icon:not(.invalid) ec-textbox ::ng-deep input{padding-left:1.75rem}.control.is-disabled:not(.is-readonly) .ec-icon{filter:grayscale(100%);opacity:var(--ec-form-control-opacity-disabled)}.control.is-readonly ec-textbox ::ng-deep input{border-right-width:1px;border-top-right-radius:var(--ec-border-radius);border-bottom-right-radius:var(--ec-border-radius)}.control.is-readonly ec-button{display:none}.control.is-always-open{height:100%}.control.is-always-open label,.control.is-always-open .textbox-group{margin-left:1rem;margin-right:1rem}.control.is-always-open .textbox-group{margin-bottom:1rem}.control.is-always-open .popup{background-color:transparent;box-shadow:none;flex:1 1;border:0;margin:0;z-index:0;min-height:0}.control.is-always-open ec-menu{border-top:1px solid var(--ec-border-color)}.control.is-always-open ec-menu ::ng-deep ul{max-height:none}label{color:var(--ec-form-control-label-color, var(--ec-color-secondary-dark));display:block;font-size:var(--ec-font-size-label);line-height:1;margin:calc(var(--ec-font-size-label) / 2) 0}.popup{background-color:var(--ec-background-color);border-radius:var(--ec-border-radius-card);box-shadow:var(--ec-box-shadow-overlay);margin-top:.25rem;overflow:hidden;z-index:var(--ec-z-index-popup)}ec-menu{display:block}ec-menu:not(:first-child){border-top:1px solid var(--ec-border-color)}ec-menu ::ng-deep ul{max-height:30vh}ec-menu ::ng-deep ul li{white-space:nowrap}.add-new{height:2rem;line-height:1.25rem;padding:.25rem .5rem;display:flex;align-items:center;background-color:var(--ec-background-color);cursor:pointer;border:0;width:100%}.add-new:hover,.add-new.is-selected{background-color:var(--ec-background-color-hover)}.add-new:focus{outline:none;background-color:var(--ec-background-color-hover)}.add-new-label{flex:1 1;margin-right:.5rem;text-align:left}.add-new .ec-icon{flex:0 0 auto}footer{padding:.5rem;border-top:1px solid var(--ec-border-color);color:var(--ec-color-hint-dark);font-size:var(--ec-font-size-label);text-align:right;line-height:1}ec-button{--ec-button-border-color-secondary: var(--ec-form-control-border-color);--ec-button-border-color-secondary-focus: var(--ec-form-control-border-color);--ec-button-color-icon-secondary: var(--ec-color-icon)}.open:not(.is-always-open) .textbox-group ec-textbox{--ec-form-control-box-shadow-focus: none;--ec-form-control-border-color-focus: var(--ec-form-control-border-color)}.open:not(.is-always-open) .textbox-group ec-button{--ec-button-box-shadow-focus-secondary: none;--ec-button-background-color-secondary: var(--ec-background-color-selected)}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }, { kind: "component", type: ButtonComponent, selector: "ec-button", inputs: ["id", "disabled", "icon", "label", "badge", "tabindex", "type", "pending", "pendingIcon", "customTemplate", "isSubmit", "autofocus"], outputs: ["clicked"] }, { kind: "component", type: TextboxComponent, selector: "ec-textbox", inputs: ["autocomplete", "type", "placeholder", "maxlength", "minlength", "rows", "selectOnAutofocus", "upperCase"] }, { kind: "component", type: ViewOverlayComponent, selector: "[ecOverlay]", inputs: ["status", "message", "action", "noDataTemplate", "displayAsMask", "overlayClassList"] }, { kind: "component", type: MenuComponent, selector: "ec-menu", inputs: ["id", "items", "selected", "parent", "templateType", "customMenuTemplate", "title", "showNoItems", "noDataText", "enableKeyNav", "highlightedItem", "maintainSelectedItem", "truncateItems", "preserveIconSpace", "dropdownToggleButton"], outputs: ["selectedChanged", "menuClosed"] }, { kind: "directive", type: PopupContainerDirective, selector: "[ecPopup]", inputs: ["ecPopup", "options"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] });
|
3463
|
+
ComboboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: ComboboxComponent, selector: "ec-combobox", inputs: { addNew: "addNew", addNewOptions: "addNewOptions", maxlength: "maxlength", menuPosition: "menuPosition", minlength: "minlength", options: "options", templateType: "templateType", customMenuTemplate: "customMenuTemplate", preserveIconSpace: "preserveIconSpace", popupFixed: "popupFixed", totalRecords: "totalRecords", upperCase: "upperCase", placeholder: "placeholder", loadOnOpenObservable: "loadOnOpenObservable", hideToggleButton: "hideToggleButton", alwaysOpen: "alwaysOpen", menuElementClasses: "menuElementClasses", textboxElementClasses: "textboxElementClasses", hideNoMatches: "hideNoMatches", noMatchesText: "noMatchesText", truncateItems: "truncateItems" }, outputs: { addNewClick: "addNewClick", search: "search" }, host: { listeners: { "window:resize": "onResize()" } }, viewQueries: [{ propertyName: "textbox", first: true, predicate: ["textbox"], descendants: true }, { propertyName: "popup", first: true, predicate: PopupContainerDirective, descendants: true }, { propertyName: "addNewButton", first: true, predicate: ["addNewButton"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"control control-label-{{labelPosition}}\"\r\n [ngClass]=\"{'open': menuStatus === 'visible',\r\n 'invalid': formModel.touched && formModel.invalid,\r\n 'has-icon': ((templateType === 'iconAndLabel' || templateType === 'iconLabelCaption') && formModel.value && formModel.value.icon && formModel.value.label === textboxFormModel.value),\r\n 'is-readonly': readonly,\r\n 'is-disabled': formModel.disabled,\r\n 'is-always-open': alwaysOpen}\">\r\n\r\n <label *ngIf=\"label\">\r\n <span>{{label | translate}}</span>\r\n <span *ngIf=\"validationErrors.length > 0 && formModel.touched && formModel.invalid\"> {{validationErrors}}</span>\r\n <ec-help-popover id=\"{{id}}_helpPopover\"\r\n *ngIf=\"helpPopover\"\r\n class=\"d-inline-block my-n3 mx-n1\"\r\n text=\"{{helpPopover | translate}}\"\r\n contentPosition=\"{{helpPopoverPosition}}\">\r\n </ec-help-popover>\r\n </label>\r\n\r\n <ng-container *ngIf=\"alwaysOpen; else popupTarget\">\r\n <div class=\"textbox-group control-input\"\r\n [ngClass]=\"textboxElementClasses\">\r\n <ng-container *ngTemplateOutlet=\"textbox\"></ng-container>\r\n </div>\r\n\r\n <ng-container *ngIf=\"filteredOptions.length > 0 || textboxFormModel.value\">\r\n <ng-container *ngTemplateOutlet=\"dropdownmenu\"></ng-container>\r\n </ng-container>\r\n </ng-container>\r\n</div>\r\n\r\n<ng-template #popupTarget>\r\n <div class=\"textbox-group control-input\"\r\n [ngClass]=\"textboxElementClasses\"\r\n *ecPopup=\"dropdownmenu\">\r\n <ng-container *ngTemplateOutlet=\"textbox\"></ng-container>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #textbox>\r\n <i class=\"ec-icon {{formModel.value?.icon}}\"></i>\r\n\r\n <ec-textbox class=\"textbox-group-input mb-0\"\r\n #textbox\r\n [id]=\"id\"\r\n [autofocus]=\"autofocus\"\r\n [formModel]=\"textboxFormModel\"\r\n [maxlength]=\"maxlength\"\r\n [minlength]=\"minlength\"\r\n [placeholder]=\"effectivePlaceholder\"\r\n [required]=\"required\"\r\n [tabindex]=\"tabindex\"\r\n [readonly]=\"readonly\"\r\n (input)=\"textboxValueChanged($event)\"\r\n (keydown)=\"keyNavigate($event)\"\r\n (focusout)=\"onBlur()\"\r\n [upperCase]=\"upperCase\"\r\n [pending]=\"pending && alwaysOpen\"\r\n [autocomplete]=\"'off'\"></ec-textbox>\r\n\r\n <ec-button class=\"textbox-group-btn-right\"\r\n *ngIf=\"!hideToggleButton\"\r\n [id]=\"id + '_button'\"\r\n [disabled]=\"formModel.disabled\"\r\n icon=\"icon-caret-down\"\r\n [tabindex]=\"-1\"\r\n type=\"secondary\"\r\n (click)=\"toggleMenu($event)\"\r\n (keydown)=\"keyNavigate($event)\"\r\n [class.active]=\"menuStatus === 'visible'\"></ec-button>\r\n</ng-template>\r\n\r\n<ng-template #dropdownmenu>\r\n <div class=\"popup\"\r\n ecOverlay\r\n [status]=\"pending && !alwaysOpen ? 'pending' : 'hasData'\">\r\n\r\n <button class=\"add-new {{addNewOptions?.classList}}\"\r\n id=\"{{id}}_addNew\"\r\n #addNewButton\r\n [class.is-selected]=\"addNewSelected\"\r\n *ngIf=\"addNew\"\r\n [hidden]=\"foundMatch || (addNew === 'dynamic' && (!textboxFormModel.value || (formModel.value && textboxFormModel.value === formModel.value.label)))\"\r\n (click)=\"onAddNew($event)\">\r\n <span class=\"add-new-label ec-util-truncate\">\r\n <span *ngIf=\"addNew === 'static' || addNew === true\"\r\n translate>{{addNewOptions?.label}}\r\n </span>\r\n <span *ngIf=\"addNew === 'dynamic'\">{{'Add' | translate}} <strong class=\"ec-util-truncate\"\r\n [ngClass]=\"{'text-uppercase': upperCase}\">{{textboxFormModel.value}}</strong>\r\n </span>\r\n </span>\r\n <i class=\"ec-icon {{addNewOptions?.icon}}\"></i>\r\n </button>\r\n\r\n <ec-menu id=\"{{id}}_menu\"\r\n [class.border-top-0]=\"!filteredOptions.length && hideNoMatches\"\r\n [ngClass]=\"menuElementClasses\"\r\n [templateType]=\"templateType\"\r\n [customMenuTemplate]=\"customMenuTemplate\"\r\n [showNoItems]=\"!hideNoMatches\"\r\n [noDataText]=\"noMatchesText\"\r\n [items]=\"filteredOptions\"\r\n [selected]=\"selectedItem\"\r\n (selectedChanged)=\"selectedChanged($event)\"\r\n [preserveIconSpace]=\"preserveIconSpace\"\r\n [truncateItems]=\"truncateItems\"></ec-menu>\r\n\r\n <footer *ngIf=\"totalRecords && totalRecords > filteredOptions.length && filteredOptions.length > 0\">\r\n <span>{{filteredOptionCount}} {{'of' | translate}} {{totalRecords}}</span>\r\n </footer>\r\n </div>\r\n</ng-template>", styles: [":host{color:var(--ec-form-control-color);font-size:var(--ec-form-control-font-size);display:block;margin-bottom:1rem;width:100%}:host :host-context(.form-condensed){margin-bottom:.5rem}:host .control{width:100%;display:flex;flex-direction:column}:host .control.control-label-bottom{flex-direction:column-reverse}:host .control.control-label-left{flex-direction:row}:host .control.control-label-left label{margin-right:.25rem}:host .control.control-label-right{flex-direction:row-reverse}:host .control.control-label-right label{margin-left:.25rem}:host .control.control-label-left,:host .control.control-label-right{align-items:center}:host .control.control-label-left label,:host .control.control-label-right label{flex:1 1;margin-top:0;margin-bottom:0}:host .control.control-label-left .control-input,:host .control.control-label-right .control-input{flex:2 2}:host .control.is-readonly input,:host .control.is-readonly select,:host .control.is-readonly textarea{border-color:var(--ec-form-control-border-color-readonly);background-color:var(--ec-form-control-background-color-readonly);background-clip:border-box;background-image:none;color:var(--ec-form-control-color-readonly);opacity:1;-webkit-user-select:none;user-select:none;pointer-events:none;overflow:hidden;white-space:nowrap}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid:focus,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid:focus{border-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-invalid{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-required,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-required{display:none}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button{background-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button:not(:focus){border-color:var(--ec-form-control-border-color-invalid)}:host .textbox-group{display:flex;position:relative}:host textarea:focus,:host input:focus,:host select:focus{outline:none}:host(.invalid) .control .textbox-group-input ::ng-deep .control input.ng-invalid,:host(.invalid) .control .textbox-group-input ::ng-deep .control input.ng-valid{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host(.invalid) .control .textbox-group-input ::ng-deep .control input.ng-invalid:focus,:host(.invalid) .control .textbox-group-input ::ng-deep .control input.ng-valid:focus{border-color:var(--ec-form-control-background-color-invalid)}:host(.invalid) .control .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-invalid,:host(.invalid) .control .textbox-group-input ::ng-deep .control input.ng-valid~.icon-invalid{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host(.invalid) .control .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-required,:host(.invalid) .control .textbox-group-input ::ng-deep .control input.ng-valid~.icon-required{display:none}:host(.invalid) .control:not(.open) .textbox-group-btn-right ::ng-deep button{background-color:var(--ec-form-control-background-color-invalid)}:host(.invalid) .control:not(.open) .textbox-group-btn-right ::ng-deep button:not(:focus){border-color:var(--ec-form-control-border-color-invalid)}.control{position:relative}.control ec-textbox ::ng-deep input.ng-invalid.ng-touched{background-image:none;padding-left:.5rem}.control ec-textbox ::ng-deep input.ng-invalid.ng-touched:not(.is-empty)~.units-left{left:0}.control ec-textbox ::ng-deep input:required:not(:disabled).is-empty{background-image:none;background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem}.control ec-textbox ::ng-deep input:required:not(:disabled).is-empty:focus{border-color:var(--ec-form-control-border-color-focus);box-shadow:var(--ec-form-control-box-shadow-focus);position:relative;z-index:1}.control .textbox-group .ec-icon{display:none;position:absolute;top:.5rem;left:.5rem;z-index:2}.control.has-icon:not(.invalid) .ec-icon{display:inline-flex}.control.has-icon:not(.invalid) ec-textbox ::ng-deep input{padding-left:1.75rem}.control.is-disabled:not(.is-readonly) .ec-icon{filter:grayscale(100%);opacity:var(--ec-form-control-opacity-disabled)}.control.is-readonly ec-textbox ::ng-deep input{border-right-width:1px;border-top-right-radius:var(--ec-border-radius);border-bottom-right-radius:var(--ec-border-radius)}.control.is-readonly ec-button{display:none}.control.is-always-open{height:100%}.control.is-always-open label,.control.is-always-open .textbox-group{margin-left:1rem;margin-right:1rem}.control.is-always-open .textbox-group{margin-bottom:1rem}.control.is-always-open .popup{background-color:transparent;box-shadow:none;flex:1 1;border:0;margin:0;z-index:0;min-height:0}.control.is-always-open ec-menu{border-top:1px solid var(--ec-border-color)}.control.is-always-open ec-menu ::ng-deep ul{max-height:none}label{color:var(--ec-form-control-label-color, var(--ec-color-secondary-dark));display:block;font-size:var(--ec-font-size-label);line-height:1;margin:calc(var(--ec-font-size-label) / 2) 0}.popup{background-color:var(--ec-background-color);border-radius:var(--ec-border-radius-card);box-shadow:var(--ec-box-shadow-overlay);margin-top:.25rem;overflow:hidden;z-index:var(--ec-z-index-popup)}ec-menu{display:block}ec-menu:not(:first-child){border-top:1px solid var(--ec-border-color)}ec-menu ::ng-deep ul{max-height:30vh}ec-menu ::ng-deep ul li{white-space:nowrap}.add-new{height:2rem;line-height:1.25rem;padding:.25rem .5rem;display:flex;align-items:center;background-color:var(--ec-background-color);cursor:pointer;border:0;width:100%}.add-new:hover,.add-new.is-selected{background-color:var(--ec-background-color-hover)}.add-new:focus{outline:none;background-color:var(--ec-background-color-hover)}.add-new-label{flex:1 1;margin-right:.5rem;text-align:left}.add-new .ec-icon{flex:0 0 auto}footer{padding:.5rem;border-top:1px solid var(--ec-border-color);color:var(--ec-color-hint-dark);font-size:var(--ec-font-size-label);text-align:right;line-height:1}ec-button{--ec-button-border-color-secondary: var(--ec-form-control-border-color);--ec-button-border-color-secondary-focus: var(--ec-form-control-border-color);--ec-button-color-icon-secondary: var(--ec-color-icon)}.open:not(.is-always-open) .textbox-group ec-textbox{--ec-form-control-box-shadow-focus: none;--ec-form-control-border-color-focus: var(--ec-form-control-border-color)}.open:not(.is-always-open) .textbox-group ec-button{--ec-button-box-shadow-focus-secondary: none;--ec-button-background-color-secondary: var(--ec-background-color-selected)}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }, { kind: "component", type: ButtonComponent, selector: "ec-button", inputs: ["id", "disabled", "icon", "label", "badge", "tabindex", "type", "pending", "pendingIcon", "customTemplate", "isSubmit", "autofocus"], outputs: ["clicked"] }, { kind: "component", type: TextboxComponent, selector: "ec-textbox", inputs: ["autocomplete", "type", "placeholder", "maxlength", "minlength", "rows", "selectOnAutofocus", "upperCase"] }, { kind: "component", type: ViewOverlayComponent, selector: "[ecOverlay]", inputs: ["status", "message", "action", "noDataTemplate", "displayAsMask", "overlayClassList"] }, { kind: "component", type: MenuComponent, selector: "ec-menu", inputs: ["id", "items", "selected", "parent", "templateType", "customMenuTemplate", "title", "showNoItems", "noDataText", "enableKeyNav", "highlightedItem", "maintainSelectedItem", "truncateItems", "preserveIconSpace", "dropdownToggleButton"], outputs: ["selectedChanged", "menuClosed"] }, { kind: "directive", type: PopupContainerDirective, selector: "[ecPopup]", inputs: ["ecPopup", "options"] }, { kind: "component", type: HelpPopoverComponent, selector: "ec-help-popover", inputs: ["id", "text", "contentPosition", "maxWidth"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] });
|
3135
3464
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ComboboxComponent, decorators: [{
|
3136
3465
|
type: Component,
|
3137
|
-
args: [{ selector: 'ec-combobox', template: "<div class=\"control control-label-{{labelPosition}}\"\r\n [ngClass]=\"{'open': menuStatus === 'visible',\r\n 'invalid': formModel.touched && formModel.invalid,\r\n 'has-icon': ((templateType === 'iconAndLabel' || templateType === 'iconLabelCaption') && formModel.value && formModel.value.icon && formModel.value.label === textboxFormModel.value),\r\n 'is-readonly': readonly,\r\n 'is-disabled': formModel.disabled,\r\n 'is-always-open': alwaysOpen}\">\r\n\r\n <label *ngIf=\"label\" ngPreserveWhitespaces>\r\n <span>{{label | translate}}</span>\r\n <span *ngIf=\"validationErrors.length > 0 && formModel.touched && formModel.invalid\">{{validationErrors}}</span>\r\n </label>\r\n\r\n <ng-container *ngIf=\"alwaysOpen; else popupTarget\">\r\n <div class=\"textbox-group control-input\" [ngClass]=\"textboxElementClasses\">\r\n <ng-container *ngTemplateOutlet=\"textbox\"></ng-container>\r\n </div>\r\n\r\n <ng-container *ngIf=\"filteredOptions.length > 0 || textboxFormModel.value\">\r\n <ng-container *ngTemplateOutlet=\"dropdownmenu\"></ng-container>\r\n </ng-container>\r\n </ng-container>\r\n</div>\r\n\r\n<ng-template #popupTarget>\r\n <div class=\"textbox-group control-input\" [ngClass]=\"textboxElementClasses\" *ecPopup=\"dropdownmenu\">\r\n <ng-container *ngTemplateOutlet=\"textbox\"></ng-container>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #textbox>\r\n <i class=\"ec-icon {{formModel.value?.icon}}\"></i>\r\n\r\n <ec-textbox class=\"textbox-group-input mb-0\"\r\n #textbox\r\n [id]=\"id\"\r\n [autofocus]=\"autofocus\"\r\n [formModel]=\"textboxFormModel\"\r\n [maxlength]=\"maxlength\"\r\n [minlength]=\"minlength\"\r\n [placeholder]=\"effectivePlaceholder\"\r\n [required]=\"required\"\r\n [tabindex]=\"tabindex\"\r\n [readonly]=\"readonly\"\r\n (input)=\"textboxValueChanged($event)\"\r\n (keydown)=\"keyNavigate($event)\"\r\n (focusout)=\"onBlur()\"\r\n [upperCase]=\"upperCase\"\r\n [pending]=\"pending && alwaysOpen\"\r\n [autocomplete]=\"'off'\"></ec-textbox>\r\n\r\n <ec-button class=\"textbox-group-btn-right\"\r\n *ngIf=\"!hideToggleButton\"\r\n [id]=\"id + '_button'\"\r\n [disabled]=\"formModel.disabled\"\r\n icon=\"icon-caret-down\"\r\n [tabindex]=\"-1\"\r\n type=\"secondary\"\r\n (click)=\"toggleMenu($event)\"\r\n (keydown)=\"keyNavigate($event)\"\r\n [class.active]=\"menuStatus === 'visible'\"></ec-button>\r\n</ng-template>\r\n\r\n<ng-template #dropdownmenu>\r\n <div class=\"popup\"\r\n ecOverlay\r\n [status]=\"pending && !alwaysOpen ? 'pending' : 'hasData'\">\r\n\r\n <button class=\"add-new {{addNewOptions?.classList}}\"\r\n id=\"{{id}}_addNew\"\r\n #addNewButton\r\n [class.is-selected]=\"addNewSelected\"\r\n *ngIf=\"addNew\"\r\n [hidden]=\"foundMatch || (addNew === 'dynamic' && (!textboxFormModel.value || (formModel.value && textboxFormModel.value === formModel.value.label)))\"\r\n (click)=\"onAddNew($event)\">\r\n <span class=\"add-new-label ec-util-truncate\">\r\n <span *ngIf=\"addNew === 'static' || addNew === true\"\r\n translate>{{addNewOptions?.label}}\r\n </span>\r\n <span *ngIf=\"addNew === 'dynamic'\">{{'Add' | translate}} <strong \r\n class=\"ec-util-truncate\" \r\n [ngClass]=\"{'text-uppercase': upperCase}\">{{textboxFormModel.value}}</strong>\r\n </span>\r\n </span>\r\n <i class=\"ec-icon {{addNewOptions?.icon}}\"></i>\r\n </button>\r\n\r\n <ec-menu id=\"{{id}}_menu\"\r\n [class.border-top-0]=\"!filteredOptions.length && hideNoMatches\"\r\n [ngClass]=\"menuElementClasses\"\r\n [templateType]=\"templateType\"\r\n [customMenuTemplate]=\"customMenuTemplate\"\r\n [showNoItems]=\"!hideNoMatches\"\r\n [noDataText]=\"noMatchesText\"\r\n [items]=\"filteredOptions\"\r\n [selected]=\"selectedItem\"\r\n (selectedChanged)=\"selectedChanged($event)\"\r\n [preserveIconSpace]=\"preserveIconSpace\"\r\n [truncateItems]=\"truncateItems\"></ec-menu>\r\n\r\n <footer *ngIf=\"totalRecords && totalRecords > filteredOptions.length && filteredOptions.length > 0\">\r\n <span>{{filteredOptionCount}} {{'of' | translate}} {{totalRecords}}</span>\r\n </footer>\r\n </div>\r\n</ng-template>\r\n", styles: [":host{color:var(--ec-form-control-color);font-size:var(--ec-form-control-font-size);display:block;margin-bottom:1rem;width:100%}:host :host-context(.form-condensed){margin-bottom:.5rem}:host .control{width:100%;display:flex;flex-direction:column}:host .control.control-label-bottom{flex-direction:column-reverse}:host .control.control-label-left{flex-direction:row}:host .control.control-label-left label{margin-right:.25rem}:host .control.control-label-right{flex-direction:row-reverse}:host .control.control-label-right label{margin-left:.25rem}:host .control.control-label-left,:host .control.control-label-right{align-items:center}:host .control.control-label-left label,:host .control.control-label-right label{flex:1 1;margin-top:0;margin-bottom:0}:host .control.control-label-left .control-input,:host .control.control-label-right .control-input{flex:2 2}:host .control.is-readonly input,:host .control.is-readonly select,:host .control.is-readonly textarea{border-color:var(--ec-form-control-border-color-readonly);background-color:var(--ec-form-control-background-color-readonly);background-clip:border-box;background-image:none;color:var(--ec-form-control-color-readonly);opacity:1;-webkit-user-select:none;user-select:none;pointer-events:none;overflow:hidden;white-space:nowrap}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid:focus,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid:focus{border-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-invalid{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-required,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-required{display:none}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button{background-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button:not(:focus){border-color:var(--ec-form-control-border-color-invalid)}:host .textbox-group{display:flex;position:relative}:host textarea:focus,:host input:focus,:host select:focus{outline:none}:host(.invalid) .control .textbox-group-input ::ng-deep .control input.ng-invalid,:host(.invalid) .control .textbox-group-input ::ng-deep .control input.ng-valid{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host(.invalid) .control .textbox-group-input ::ng-deep .control input.ng-invalid:focus,:host(.invalid) .control .textbox-group-input ::ng-deep .control input.ng-valid:focus{border-color:var(--ec-form-control-background-color-invalid)}:host(.invalid) .control .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-invalid,:host(.invalid) .control .textbox-group-input ::ng-deep .control input.ng-valid~.icon-invalid{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host(.invalid) .control .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-required,:host(.invalid) .control .textbox-group-input ::ng-deep .control input.ng-valid~.icon-required{display:none}:host(.invalid) .control:not(.open) .textbox-group-btn-right ::ng-deep button{background-color:var(--ec-form-control-background-color-invalid)}:host(.invalid) .control:not(.open) .textbox-group-btn-right ::ng-deep button:not(:focus){border-color:var(--ec-form-control-border-color-invalid)}.control{position:relative}.control ec-textbox ::ng-deep input.ng-invalid.ng-touched{background-image:none;padding-left:.5rem}.control ec-textbox ::ng-deep input.ng-invalid.ng-touched:not(.is-empty)~.units-left{left:0}.control ec-textbox ::ng-deep input:required:not(:disabled).is-empty{background-image:none;background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem}.control ec-textbox ::ng-deep input:required:not(:disabled).is-empty:focus{border-color:var(--ec-form-control-border-color-focus);box-shadow:var(--ec-form-control-box-shadow-focus);position:relative;z-index:1}.control .textbox-group .ec-icon{display:none;position:absolute;top:.5rem;left:.5rem;z-index:2}.control.has-icon:not(.invalid) .ec-icon{display:inline-flex}.control.has-icon:not(.invalid) ec-textbox ::ng-deep input{padding-left:1.75rem}.control.is-disabled:not(.is-readonly) .ec-icon{filter:grayscale(100%);opacity:var(--ec-form-control-opacity-disabled)}.control.is-readonly ec-textbox ::ng-deep input{border-right-width:1px;border-top-right-radius:var(--ec-border-radius);border-bottom-right-radius:var(--ec-border-radius)}.control.is-readonly ec-button{display:none}.control.is-always-open{height:100%}.control.is-always-open label,.control.is-always-open .textbox-group{margin-left:1rem;margin-right:1rem}.control.is-always-open .textbox-group{margin-bottom:1rem}.control.is-always-open .popup{background-color:transparent;box-shadow:none;flex:1 1;border:0;margin:0;z-index:0;min-height:0}.control.is-always-open ec-menu{border-top:1px solid var(--ec-border-color)}.control.is-always-open ec-menu ::ng-deep ul{max-height:none}label{color:var(--ec-form-control-label-color, var(--ec-color-secondary-dark));display:block;font-size:var(--ec-font-size-label);line-height:1;margin:calc(var(--ec-font-size-label) / 2) 0}.popup{background-color:var(--ec-background-color);border-radius:var(--ec-border-radius-card);box-shadow:var(--ec-box-shadow-overlay);margin-top:.25rem;overflow:hidden;z-index:var(--ec-z-index-popup)}ec-menu{display:block}ec-menu:not(:first-child){border-top:1px solid var(--ec-border-color)}ec-menu ::ng-deep ul{max-height:30vh}ec-menu ::ng-deep ul li{white-space:nowrap}.add-new{height:2rem;line-height:1.25rem;padding:.25rem .5rem;display:flex;align-items:center;background-color:var(--ec-background-color);cursor:pointer;border:0;width:100%}.add-new:hover,.add-new.is-selected{background-color:var(--ec-background-color-hover)}.add-new:focus{outline:none;background-color:var(--ec-background-color-hover)}.add-new-label{flex:1 1;margin-right:.5rem;text-align:left}.add-new .ec-icon{flex:0 0 auto}footer{padding:.5rem;border-top:1px solid var(--ec-border-color);color:var(--ec-color-hint-dark);font-size:var(--ec-font-size-label);text-align:right;line-height:1}ec-button{--ec-button-border-color-secondary: var(--ec-form-control-border-color);--ec-button-border-color-secondary-focus: var(--ec-form-control-border-color);--ec-button-color-icon-secondary: var(--ec-color-icon)}.open:not(.is-always-open) .textbox-group ec-textbox{--ec-form-control-box-shadow-focus: none;--ec-form-control-border-color-focus: var(--ec-form-control-border-color)}.open:not(.is-always-open) .textbox-group ec-button{--ec-button-box-shadow-focus-secondary: none;--ec-button-background-color-secondary: var(--ec-background-color-selected)}\n"] }]
|
3466
|
+
args: [{ selector: 'ec-combobox', template: "<div class=\"control control-label-{{labelPosition}}\"\r\n [ngClass]=\"{'open': menuStatus === 'visible',\r\n 'invalid': formModel.touched && formModel.invalid,\r\n 'has-icon': ((templateType === 'iconAndLabel' || templateType === 'iconLabelCaption') && formModel.value && formModel.value.icon && formModel.value.label === textboxFormModel.value),\r\n 'is-readonly': readonly,\r\n 'is-disabled': formModel.disabled,\r\n 'is-always-open': alwaysOpen}\">\r\n\r\n <label *ngIf=\"label\">\r\n <span>{{label | translate}}</span>\r\n <span *ngIf=\"validationErrors.length > 0 && formModel.touched && formModel.invalid\"> {{validationErrors}}</span>\r\n <ec-help-popover id=\"{{id}}_helpPopover\"\r\n *ngIf=\"helpPopover\"\r\n class=\"d-inline-block my-n3 mx-n1\"\r\n text=\"{{helpPopover | translate}}\"\r\n contentPosition=\"{{helpPopoverPosition}}\">\r\n </ec-help-popover>\r\n </label>\r\n\r\n <ng-container *ngIf=\"alwaysOpen; else popupTarget\">\r\n <div class=\"textbox-group control-input\"\r\n [ngClass]=\"textboxElementClasses\">\r\n <ng-container *ngTemplateOutlet=\"textbox\"></ng-container>\r\n </div>\r\n\r\n <ng-container *ngIf=\"filteredOptions.length > 0 || textboxFormModel.value\">\r\n <ng-container *ngTemplateOutlet=\"dropdownmenu\"></ng-container>\r\n </ng-container>\r\n </ng-container>\r\n</div>\r\n\r\n<ng-template #popupTarget>\r\n <div class=\"textbox-group control-input\"\r\n [ngClass]=\"textboxElementClasses\"\r\n *ecPopup=\"dropdownmenu\">\r\n <ng-container *ngTemplateOutlet=\"textbox\"></ng-container>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #textbox>\r\n <i class=\"ec-icon {{formModel.value?.icon}}\"></i>\r\n\r\n <ec-textbox class=\"textbox-group-input mb-0\"\r\n #textbox\r\n [id]=\"id\"\r\n [autofocus]=\"autofocus\"\r\n [formModel]=\"textboxFormModel\"\r\n [maxlength]=\"maxlength\"\r\n [minlength]=\"minlength\"\r\n [placeholder]=\"effectivePlaceholder\"\r\n [required]=\"required\"\r\n [tabindex]=\"tabindex\"\r\n [readonly]=\"readonly\"\r\n (input)=\"textboxValueChanged($event)\"\r\n (keydown)=\"keyNavigate($event)\"\r\n (focusout)=\"onBlur()\"\r\n [upperCase]=\"upperCase\"\r\n [pending]=\"pending && alwaysOpen\"\r\n [autocomplete]=\"'off'\"></ec-textbox>\r\n\r\n <ec-button class=\"textbox-group-btn-right\"\r\n *ngIf=\"!hideToggleButton\"\r\n [id]=\"id + '_button'\"\r\n [disabled]=\"formModel.disabled\"\r\n icon=\"icon-caret-down\"\r\n [tabindex]=\"-1\"\r\n type=\"secondary\"\r\n (click)=\"toggleMenu($event)\"\r\n (keydown)=\"keyNavigate($event)\"\r\n [class.active]=\"menuStatus === 'visible'\"></ec-button>\r\n</ng-template>\r\n\r\n<ng-template #dropdownmenu>\r\n <div class=\"popup\"\r\n ecOverlay\r\n [status]=\"pending && !alwaysOpen ? 'pending' : 'hasData'\">\r\n\r\n <button class=\"add-new {{addNewOptions?.classList}}\"\r\n id=\"{{id}}_addNew\"\r\n #addNewButton\r\n [class.is-selected]=\"addNewSelected\"\r\n *ngIf=\"addNew\"\r\n [hidden]=\"foundMatch || (addNew === 'dynamic' && (!textboxFormModel.value || (formModel.value && textboxFormModel.value === formModel.value.label)))\"\r\n (click)=\"onAddNew($event)\">\r\n <span class=\"add-new-label ec-util-truncate\">\r\n <span *ngIf=\"addNew === 'static' || addNew === true\"\r\n translate>{{addNewOptions?.label}}\r\n </span>\r\n <span *ngIf=\"addNew === 'dynamic'\">{{'Add' | translate}} <strong class=\"ec-util-truncate\"\r\n [ngClass]=\"{'text-uppercase': upperCase}\">{{textboxFormModel.value}}</strong>\r\n </span>\r\n </span>\r\n <i class=\"ec-icon {{addNewOptions?.icon}}\"></i>\r\n </button>\r\n\r\n <ec-menu id=\"{{id}}_menu\"\r\n [class.border-top-0]=\"!filteredOptions.length && hideNoMatches\"\r\n [ngClass]=\"menuElementClasses\"\r\n [templateType]=\"templateType\"\r\n [customMenuTemplate]=\"customMenuTemplate\"\r\n [showNoItems]=\"!hideNoMatches\"\r\n [noDataText]=\"noMatchesText\"\r\n [items]=\"filteredOptions\"\r\n [selected]=\"selectedItem\"\r\n (selectedChanged)=\"selectedChanged($event)\"\r\n [preserveIconSpace]=\"preserveIconSpace\"\r\n [truncateItems]=\"truncateItems\"></ec-menu>\r\n\r\n <footer *ngIf=\"totalRecords && totalRecords > filteredOptions.length && filteredOptions.length > 0\">\r\n <span>{{filteredOptionCount}} {{'of' | translate}} {{totalRecords}}</span>\r\n </footer>\r\n </div>\r\n</ng-template>", styles: [":host{color:var(--ec-form-control-color);font-size:var(--ec-form-control-font-size);display:block;margin-bottom:1rem;width:100%}:host :host-context(.form-condensed){margin-bottom:.5rem}:host .control{width:100%;display:flex;flex-direction:column}:host .control.control-label-bottom{flex-direction:column-reverse}:host .control.control-label-left{flex-direction:row}:host .control.control-label-left label{margin-right:.25rem}:host .control.control-label-right{flex-direction:row-reverse}:host .control.control-label-right label{margin-left:.25rem}:host .control.control-label-left,:host .control.control-label-right{align-items:center}:host .control.control-label-left label,:host .control.control-label-right label{flex:1 1;margin-top:0;margin-bottom:0}:host .control.control-label-left .control-input,:host .control.control-label-right .control-input{flex:2 2}:host .control.is-readonly input,:host .control.is-readonly select,:host .control.is-readonly textarea{border-color:var(--ec-form-control-border-color-readonly);background-color:var(--ec-form-control-background-color-readonly);background-clip:border-box;background-image:none;color:var(--ec-form-control-color-readonly);opacity:1;-webkit-user-select:none;user-select:none;pointer-events:none;overflow:hidden;white-space:nowrap}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid:focus,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid:focus{border-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-invalid{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-required,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-required{display:none}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button{background-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button:not(:focus){border-color:var(--ec-form-control-border-color-invalid)}:host .textbox-group{display:flex;position:relative}:host textarea:focus,:host input:focus,:host select:focus{outline:none}:host(.invalid) .control .textbox-group-input ::ng-deep .control input.ng-invalid,:host(.invalid) .control .textbox-group-input ::ng-deep .control input.ng-valid{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host(.invalid) .control .textbox-group-input ::ng-deep .control input.ng-invalid:focus,:host(.invalid) .control .textbox-group-input ::ng-deep .control input.ng-valid:focus{border-color:var(--ec-form-control-background-color-invalid)}:host(.invalid) .control .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-invalid,:host(.invalid) .control .textbox-group-input ::ng-deep .control input.ng-valid~.icon-invalid{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host(.invalid) .control .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-required,:host(.invalid) .control .textbox-group-input ::ng-deep .control input.ng-valid~.icon-required{display:none}:host(.invalid) .control:not(.open) .textbox-group-btn-right ::ng-deep button{background-color:var(--ec-form-control-background-color-invalid)}:host(.invalid) .control:not(.open) .textbox-group-btn-right ::ng-deep button:not(:focus){border-color:var(--ec-form-control-border-color-invalid)}.control{position:relative}.control ec-textbox ::ng-deep input.ng-invalid.ng-touched{background-image:none;padding-left:.5rem}.control ec-textbox ::ng-deep input.ng-invalid.ng-touched:not(.is-empty)~.units-left{left:0}.control ec-textbox ::ng-deep input:required:not(:disabled).is-empty{background-image:none;background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem}.control ec-textbox ::ng-deep input:required:not(:disabled).is-empty:focus{border-color:var(--ec-form-control-border-color-focus);box-shadow:var(--ec-form-control-box-shadow-focus);position:relative;z-index:1}.control .textbox-group .ec-icon{display:none;position:absolute;top:.5rem;left:.5rem;z-index:2}.control.has-icon:not(.invalid) .ec-icon{display:inline-flex}.control.has-icon:not(.invalid) ec-textbox ::ng-deep input{padding-left:1.75rem}.control.is-disabled:not(.is-readonly) .ec-icon{filter:grayscale(100%);opacity:var(--ec-form-control-opacity-disabled)}.control.is-readonly ec-textbox ::ng-deep input{border-right-width:1px;border-top-right-radius:var(--ec-border-radius);border-bottom-right-radius:var(--ec-border-radius)}.control.is-readonly ec-button{display:none}.control.is-always-open{height:100%}.control.is-always-open label,.control.is-always-open .textbox-group{margin-left:1rem;margin-right:1rem}.control.is-always-open .textbox-group{margin-bottom:1rem}.control.is-always-open .popup{background-color:transparent;box-shadow:none;flex:1 1;border:0;margin:0;z-index:0;min-height:0}.control.is-always-open ec-menu{border-top:1px solid var(--ec-border-color)}.control.is-always-open ec-menu ::ng-deep ul{max-height:none}label{color:var(--ec-form-control-label-color, var(--ec-color-secondary-dark));display:block;font-size:var(--ec-font-size-label);line-height:1;margin:calc(var(--ec-font-size-label) / 2) 0}.popup{background-color:var(--ec-background-color);border-radius:var(--ec-border-radius-card);box-shadow:var(--ec-box-shadow-overlay);margin-top:.25rem;overflow:hidden;z-index:var(--ec-z-index-popup)}ec-menu{display:block}ec-menu:not(:first-child){border-top:1px solid var(--ec-border-color)}ec-menu ::ng-deep ul{max-height:30vh}ec-menu ::ng-deep ul li{white-space:nowrap}.add-new{height:2rem;line-height:1.25rem;padding:.25rem .5rem;display:flex;align-items:center;background-color:var(--ec-background-color);cursor:pointer;border:0;width:100%}.add-new:hover,.add-new.is-selected{background-color:var(--ec-background-color-hover)}.add-new:focus{outline:none;background-color:var(--ec-background-color-hover)}.add-new-label{flex:1 1;margin-right:.5rem;text-align:left}.add-new .ec-icon{flex:0 0 auto}footer{padding:.5rem;border-top:1px solid var(--ec-border-color);color:var(--ec-color-hint-dark);font-size:var(--ec-font-size-label);text-align:right;line-height:1}ec-button{--ec-button-border-color-secondary: var(--ec-form-control-border-color);--ec-button-border-color-secondary-focus: var(--ec-form-control-border-color);--ec-button-color-icon-secondary: var(--ec-color-icon)}.open:not(.is-always-open) .textbox-group ec-textbox{--ec-form-control-box-shadow-focus: none;--ec-form-control-border-color-focus: var(--ec-form-control-border-color)}.open:not(.is-always-open) .textbox-group ec-button{--ec-button-box-shadow-focus-secondary: none;--ec-button-background-color-secondary: var(--ec-background-color-selected)}\n"] }]
|
3138
3467
|
}], ctorParameters: function () { return [{ type: ValidationMessageService }, { type: FormGroupHelper }, { type: i2.TranslateService }, { type: ScrollService }]; }, propDecorators: { onResize: [{
|
3139
3468
|
type: HostListener,
|
3140
3469
|
args: ['window:resize']
|
@@ -3640,6 +3969,10 @@ class FormGroupComponent {
|
|
3640
3969
|
/**An optional flag to hide the validation messages.
|
3641
3970
|
*/
|
3642
3971
|
this.hideValidationMessage = false;
|
3972
|
+
/**
|
3973
|
+
* When a help popover is present, allows the popover to be positioned in different locations.
|
3974
|
+
*/
|
3975
|
+
this.helpPopoverPosition = 'top-left';
|
3643
3976
|
/**
|
3644
3977
|
* All current validation errors
|
3645
3978
|
*
|
@@ -3728,10 +4061,10 @@ class FormGroupComponent {
|
|
3728
4061
|
}
|
3729
4062
|
}
|
3730
4063
|
FormGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FormGroupComponent, deps: [{ token: ValidationMessageService }, { token: i2.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
|
3731
|
-
FormGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: FormGroupComponent, selector: "ec-form-group", inputs: { id: "id", label: "label", formGroup: "formGroup", labelPosition: "labelPosition", overrideValidationError: "overrideValidationError", hideValidationMessage: "hideValidationMessage" }, host: { properties: { "attr.id": "this.attrId" } }, ngImport: i0, template: "<div class=\"control control-label-{{labelPosition}}\"
|
4064
|
+
FormGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: FormGroupComponent, selector: "ec-form-group", inputs: { id: "id", label: "label", formGroup: "formGroup", labelPosition: "labelPosition", overrideValidationError: "overrideValidationError", hideValidationMessage: "hideValidationMessage", helpPopover: "helpPopover", helpPopoverPosition: "helpPopoverPosition" }, host: { properties: { "attr.id": "this.attrId" } }, ngImport: i0, template: "<div class=\"control control-label-{{labelPosition}}\"\r\n [class.ec-untouched]=\"formGroup?.untouched\">\r\n\r\n <label *ngIf=\"label\">\r\n <span id=\"{{id}}_label\">{{label | translate}}</span>\r\n <span *ngIf=\"!hideValidationMessage && validationErrors && formGroup?.touched && formGroup?.invalid\"> {{validationErrors | translate}}</span>\r\n <ec-help-popover id=\"{{id}}_helpPopover\"\r\n *ngIf=\"helpPopover\"\r\n class=\"d-inline-block my-n3 mx-n1\"\r\n text=\"{{helpPopover | translate}}\"\r\n contentPosition=\"{{helpPopoverPosition}}\">\r\n </ec-help-popover>\r\n </label>\r\n\r\n <ng-content></ng-content>\r\n</div>", styles: [":host{color:var(--ec-form-control-color);font-size:var(--ec-form-control-font-size);display:block;margin-bottom:1rem;width:100%}:host :host-context(.form-condensed){margin-bottom:.5rem}:host .control{width:100%;display:flex;flex-direction:column}:host .control.control-label-bottom{flex-direction:column-reverse}:host .control.control-label-left{flex-direction:row}:host .control.control-label-left label{margin-right:.25rem}:host .control.control-label-right{flex-direction:row-reverse}:host .control.control-label-right label{margin-left:.25rem}:host .control.control-label-left,:host .control.control-label-right{align-items:center}:host .control.control-label-left label,:host .control.control-label-right label{flex:1 1;margin-top:0;margin-bottom:0}:host .control.control-label-left .control-input,:host .control.control-label-right .control-input{flex:2 2}:host .control.is-readonly input,:host .control.is-readonly select,:host .control.is-readonly textarea{border-color:var(--ec-form-control-border-color-readonly);background-color:var(--ec-form-control-background-color-readonly);background-clip:border-box;background-image:none;color:var(--ec-form-control-color-readonly);opacity:1;-webkit-user-select:none;user-select:none;pointer-events:none;overflow:hidden;white-space:nowrap}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid:focus,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid:focus{border-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-invalid{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-required,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-required{display:none}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button{background-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button:not(:focus){border-color:var(--ec-form-control-border-color-invalid)}:host .textbox-group{display:flex;position:relative}:host textarea:focus,:host input:focus,:host select:focus{outline:none}label{color:var(--ec-form-control-label-color, var(--ec-color-secondary-dark));display:block;font-size:var(--ec-font-size-label);line-height:1;margin:calc(var(--ec-font-size-label) / 2) 0}.control.ec-untouched ::ng-deep input.ng-invalid.ng-touched{background-image:none;padding-left:.5rem}.control.ec-untouched ::ng-deep input.ng-invalid.ng-touched:not(.is-empty)~.units-left{left:0}.control.ec-untouched ::ng-deep input:required:not(:disabled).is-empty{background-image:none;background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem}.control.ec-untouched ::ng-deep input:required:not(:disabled).is-empty:focus{border-color:var(--ec-form-control-border-color-focus);box-shadow:var(--ec-form-control-box-shadow-focus);position:relative;z-index:1}.control-label-left{display:flex}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: HelpPopoverComponent, selector: "ec-help-popover", inputs: ["id", "text", "contentPosition", "maxWidth"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] });
|
3732
4065
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FormGroupComponent, decorators: [{
|
3733
4066
|
type: Component,
|
3734
|
-
args: [{ selector: 'ec-form-group', template: "<div class=\"control control-label-{{labelPosition}}\"
|
4067
|
+
args: [{ selector: 'ec-form-group', template: "<div class=\"control control-label-{{labelPosition}}\"\r\n [class.ec-untouched]=\"formGroup?.untouched\">\r\n\r\n <label *ngIf=\"label\">\r\n <span id=\"{{id}}_label\">{{label | translate}}</span>\r\n <span *ngIf=\"!hideValidationMessage && validationErrors && formGroup?.touched && formGroup?.invalid\"> {{validationErrors | translate}}</span>\r\n <ec-help-popover id=\"{{id}}_helpPopover\"\r\n *ngIf=\"helpPopover\"\r\n class=\"d-inline-block my-n3 mx-n1\"\r\n text=\"{{helpPopover | translate}}\"\r\n contentPosition=\"{{helpPopoverPosition}}\">\r\n </ec-help-popover>\r\n </label>\r\n\r\n <ng-content></ng-content>\r\n</div>", styles: [":host{color:var(--ec-form-control-color);font-size:var(--ec-form-control-font-size);display:block;margin-bottom:1rem;width:100%}:host :host-context(.form-condensed){margin-bottom:.5rem}:host .control{width:100%;display:flex;flex-direction:column}:host .control.control-label-bottom{flex-direction:column-reverse}:host .control.control-label-left{flex-direction:row}:host .control.control-label-left label{margin-right:.25rem}:host .control.control-label-right{flex-direction:row-reverse}:host .control.control-label-right label{margin-left:.25rem}:host .control.control-label-left,:host .control.control-label-right{align-items:center}:host .control.control-label-left label,:host .control.control-label-right label{flex:1 1;margin-top:0;margin-bottom:0}:host .control.control-label-left .control-input,:host .control.control-label-right .control-input{flex:2 2}:host .control.is-readonly input,:host .control.is-readonly select,:host .control.is-readonly textarea{border-color:var(--ec-form-control-border-color-readonly);background-color:var(--ec-form-control-background-color-readonly);background-clip:border-box;background-image:none;color:var(--ec-form-control-color-readonly);opacity:1;-webkit-user-select:none;user-select:none;pointer-events:none;overflow:hidden;white-space:nowrap}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid:focus,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid:focus{border-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-invalid{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-required,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-required{display:none}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button{background-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button:not(:focus){border-color:var(--ec-form-control-border-color-invalid)}:host .textbox-group{display:flex;position:relative}:host textarea:focus,:host input:focus,:host select:focus{outline:none}label{color:var(--ec-form-control-label-color, var(--ec-color-secondary-dark));display:block;font-size:var(--ec-font-size-label);line-height:1;margin:calc(var(--ec-font-size-label) / 2) 0}.control.ec-untouched ::ng-deep input.ng-invalid.ng-touched{background-image:none;padding-left:.5rem}.control.ec-untouched ::ng-deep input.ng-invalid.ng-touched:not(.is-empty)~.units-left{left:0}.control.ec-untouched ::ng-deep input:required:not(:disabled).is-empty{background-image:none;background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem}.control.ec-untouched ::ng-deep input:required:not(:disabled).is-empty:focus{border-color:var(--ec-form-control-border-color-focus);box-shadow:var(--ec-form-control-box-shadow-focus);position:relative;z-index:1}.control-label-left{display:flex}\n"] }]
|
3735
4068
|
}], ctorParameters: function () { return [{ type: ValidationMessageService }, { type: i2.TranslateService }]; }, propDecorators: { id: [{
|
3736
4069
|
type: Input
|
3737
4070
|
}], attrId: [{
|
@@ -3747,6 +4080,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
3747
4080
|
type: Input
|
3748
4081
|
}], hideValidationMessage: [{
|
3749
4082
|
type: Input
|
4083
|
+
}], helpPopover: [{
|
4084
|
+
type: Input
|
4085
|
+
}], helpPopoverPosition: [{
|
4086
|
+
type: Input
|
3750
4087
|
}] } });
|
3751
4088
|
|
3752
4089
|
const FileTypeExtensions = {
|
@@ -3925,10 +4262,10 @@ class FileUploadComponent extends FormControlBase {
|
|
3925
4262
|
}
|
3926
4263
|
}
|
3927
4264
|
FileUploadComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FileUploadComponent, deps: [{ token: ValidationMessageService }, { token: FormGroupHelper }], target: i0.ɵɵFactoryTarget.Component });
|
3928
|
-
FileUploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: FileUploadComponent, selector: "ec-file-upload", inputs: { placeholder: "placeholder", fileType: "fileType", fileOutput: "fileOutput", customExtensions: "customExtensions", onFileSelected: "onFileSelected", onMultipleFilesSelected: "onMultipleFilesSelected", displayType: "displayType", buttonLabel: "buttonLabel", buttonType: "buttonType", multiSelect: "multiSelect" }, viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true, read: ElementRef, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<ec-form-group [label]=\"label\"\r\n [formGroup]=\"formModel\"\r\n class=\"mb-0\">\r\n <div class=\"d-flex control-group\">\r\n <div class=\"d-flex flex-grow position-relative\">\r\n <input #fileInput\r\n id=\"{{inputId}}_input\"\r\n type=\"file\"\r\n tabindex=\"-1\"\r\n [attr.accept]=\"fileTypeAccept\"\r\n (change)=\"fileChange($event.target.files)\"\r\n [class.has-value]=\"displayType === 'file' ? formModel?.get('name').value : undefined\"\r\n [attr.multiple]=\"multiSelect ? 'multiple' : undefined\">\r\n <ec-form-control *ngIf=\"displayType === 'file'\"\r\n id=\"{{inputId}}_formControl\"\r\n class=\"text-truncate\"\r\n [required]=\"required\"\r\n [pending]=\"pending\">\r\n <input id=\"{{inputId}}_name\"\r\n [formControl]=\"formModel?.get('name')\"\r\n type=\"text\"\r\n [placeholder]=\"placeholder\"\r\n [tabindex]=\"-1\">\r\n </ec-form-control>\r\n </div>\r\n <ec-button *ngIf=\"displayType === 'file'\"\r\n #browseBtn\r\n id=\"{{inputId}}_browseBtn\"\r\n (clicked)=\"fileInput.click()\"\r\n type=\"secondary\"\r\n [tabindex]=\"tabindex\"\r\n [disabled]=\"formModel?.get('name').disabled\"\r\n label=\"Browse\"\r\n [autofocus]=\"autofocus\">\r\n </ec-button>\r\n </div>\r\n <ec-button *ngIf=\"displayType === 'button'\"\r\n id=\"{{inputId}}_btn\"\r\n [pending]=\"pending\"\r\n [type]=\"buttonType\"\r\n [label]=\"buttonLabel ?? 'Browse_TC' | translate\"\r\n (clicked)=\"fileInput.click()\"\r\n style=\"width: 100%;\">\r\n </ec-button>\r\n</ec-form-group>", styles: [":host{display:block;margin-bottom:1rem}ec-form-control{margin-bottom:0}ec-form-control ::ng-deep>.ec-focus-ring{display:none!important}input[type=file]{opacity:0;display:block;position:absolute;top:0;left:0;width:100%;height:100%;z-index:1;cursor:pointer}input[type=file].has-value{width:calc(100% - 1.5rem)}ec-button{--ec-button-border-color-secondary: var(--ec-form-control-border-color);--ec-button-color-icon-secondary: var(--ec-color-icon)}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: ButtonComponent, selector: "ec-button", inputs: ["id", "disabled", "icon", "label", "badge", "tabindex", "type", "pending", "pendingIcon", "customTemplate", "isSubmit", "autofocus"], outputs: ["clicked"] }, { kind: "component", type: FormControlComponent, selector: "ec-form-control", inputs: ["id", "icon", "actionIcon", "showClear", "pending", "required", "readonly"], outputs: ["actionClicked"] }, { kind: "component", type: FormGroupComponent, selector: "ec-form-group", inputs: ["id", "label", "formGroup", "labelPosition", "overrideValidationError", "hideValidationMessage"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] });
|
4265
|
+
FileUploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: FileUploadComponent, selector: "ec-file-upload", inputs: { placeholder: "placeholder", fileType: "fileType", fileOutput: "fileOutput", customExtensions: "customExtensions", onFileSelected: "onFileSelected", onMultipleFilesSelected: "onMultipleFilesSelected", displayType: "displayType", buttonLabel: "buttonLabel", buttonType: "buttonType", multiSelect: "multiSelect" }, viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true, read: ElementRef, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<ec-form-group [label]=\"label\"\r\n [formGroup]=\"formModel\"\r\n [helpPopover]=\"helpPopover\"\r\n [helpPopoverPosition]=\"helpPopoverPosition\"\r\n class=\"mb-0\">\r\n <div class=\"d-flex control-group\">\r\n <div class=\"d-flex flex-grow position-relative\">\r\n <input #fileInput\r\n id=\"{{inputId}}_input\"\r\n type=\"file\"\r\n tabindex=\"-1\"\r\n [attr.accept]=\"fileTypeAccept\"\r\n (change)=\"fileChange($event.target.files)\"\r\n [class.has-value]=\"displayType === 'file' ? formModel?.get('name').value : undefined\"\r\n [attr.multiple]=\"multiSelect ? 'multiple' : undefined\">\r\n <ec-form-control *ngIf=\"displayType === 'file'\"\r\n id=\"{{inputId}}_formControl\"\r\n class=\"text-truncate\"\r\n [required]=\"required\"\r\n [pending]=\"pending\">\r\n <input id=\"{{inputId}}_name\"\r\n [formControl]=\"formModel?.get('name')\"\r\n type=\"text\"\r\n [placeholder]=\"placeholder\"\r\n [tabindex]=\"-1\">\r\n </ec-form-control>\r\n </div>\r\n <ec-button *ngIf=\"displayType === 'file'\"\r\n #browseBtn\r\n id=\"{{inputId}}_browseBtn\"\r\n (clicked)=\"fileInput.click()\"\r\n type=\"secondary\"\r\n [tabindex]=\"tabindex\"\r\n [disabled]=\"formModel?.get('name').disabled\"\r\n label=\"Browse\"\r\n [autofocus]=\"autofocus\">\r\n </ec-button>\r\n </div>\r\n <ec-button *ngIf=\"displayType === 'button'\"\r\n id=\"{{inputId}}_btn\"\r\n [pending]=\"pending\"\r\n [type]=\"buttonType\"\r\n [label]=\"buttonLabel ?? 'Browse_TC' | translate\"\r\n (clicked)=\"fileInput.click()\"\r\n style=\"width: 100%;\">\r\n </ec-button>\r\n</ec-form-group>", styles: [":host{display:block;margin-bottom:1rem}ec-form-control{margin-bottom:0}ec-form-control ::ng-deep>.ec-focus-ring{display:none!important}input[type=file]{opacity:0;display:block;position:absolute;top:0;left:0;width:100%;height:100%;z-index:1;cursor:pointer}input[type=file].has-value{width:calc(100% - 1.5rem)}ec-button{--ec-button-border-color-secondary: var(--ec-form-control-border-color);--ec-button-color-icon-secondary: var(--ec-color-icon)}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: ButtonComponent, selector: "ec-button", inputs: ["id", "disabled", "icon", "label", "badge", "tabindex", "type", "pending", "pendingIcon", "customTemplate", "isSubmit", "autofocus"], outputs: ["clicked"] }, { kind: "component", type: FormControlComponent, selector: "ec-form-control", inputs: ["id", "icon", "actionIcon", "showClear", "pending", "required", "readonly"], outputs: ["actionClicked"] }, { kind: "component", type: FormGroupComponent, selector: "ec-form-group", inputs: ["id", "label", "formGroup", "labelPosition", "overrideValidationError", "hideValidationMessage", "helpPopover", "helpPopoverPosition"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] });
|
3929
4266
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FileUploadComponent, decorators: [{
|
3930
4267
|
type: Component,
|
3931
|
-
args: [{ selector: "ec-file-upload", template: "<ec-form-group [label]=\"label\"\r\n [formGroup]=\"formModel\"\r\n class=\"mb-0\">\r\n <div class=\"d-flex control-group\">\r\n <div class=\"d-flex flex-grow position-relative\">\r\n <input #fileInput\r\n id=\"{{inputId}}_input\"\r\n type=\"file\"\r\n tabindex=\"-1\"\r\n [attr.accept]=\"fileTypeAccept\"\r\n (change)=\"fileChange($event.target.files)\"\r\n [class.has-value]=\"displayType === 'file' ? formModel?.get('name').value : undefined\"\r\n [attr.multiple]=\"multiSelect ? 'multiple' : undefined\">\r\n <ec-form-control *ngIf=\"displayType === 'file'\"\r\n id=\"{{inputId}}_formControl\"\r\n class=\"text-truncate\"\r\n [required]=\"required\"\r\n [pending]=\"pending\">\r\n <input id=\"{{inputId}}_name\"\r\n [formControl]=\"formModel?.get('name')\"\r\n type=\"text\"\r\n [placeholder]=\"placeholder\"\r\n [tabindex]=\"-1\">\r\n </ec-form-control>\r\n </div>\r\n <ec-button *ngIf=\"displayType === 'file'\"\r\n #browseBtn\r\n id=\"{{inputId}}_browseBtn\"\r\n (clicked)=\"fileInput.click()\"\r\n type=\"secondary\"\r\n [tabindex]=\"tabindex\"\r\n [disabled]=\"formModel?.get('name').disabled\"\r\n label=\"Browse\"\r\n [autofocus]=\"autofocus\">\r\n </ec-button>\r\n </div>\r\n <ec-button *ngIf=\"displayType === 'button'\"\r\n id=\"{{inputId}}_btn\"\r\n [pending]=\"pending\"\r\n [type]=\"buttonType\"\r\n [label]=\"buttonLabel ?? 'Browse_TC' | translate\"\r\n (clicked)=\"fileInput.click()\"\r\n style=\"width: 100%;\">\r\n </ec-button>\r\n</ec-form-group>", styles: [":host{display:block;margin-bottom:1rem}ec-form-control{margin-bottom:0}ec-form-control ::ng-deep>.ec-focus-ring{display:none!important}input[type=file]{opacity:0;display:block;position:absolute;top:0;left:0;width:100%;height:100%;z-index:1;cursor:pointer}input[type=file].has-value{width:calc(100% - 1.5rem)}ec-button{--ec-button-border-color-secondary: var(--ec-form-control-border-color);--ec-button-color-icon-secondary: var(--ec-color-icon)}\n"] }]
|
4268
|
+
args: [{ selector: "ec-file-upload", template: "<ec-form-group [label]=\"label\"\r\n [formGroup]=\"formModel\"\r\n [helpPopover]=\"helpPopover\"\r\n [helpPopoverPosition]=\"helpPopoverPosition\"\r\n class=\"mb-0\">\r\n <div class=\"d-flex control-group\">\r\n <div class=\"d-flex flex-grow position-relative\">\r\n <input #fileInput\r\n id=\"{{inputId}}_input\"\r\n type=\"file\"\r\n tabindex=\"-1\"\r\n [attr.accept]=\"fileTypeAccept\"\r\n (change)=\"fileChange($event.target.files)\"\r\n [class.has-value]=\"displayType === 'file' ? formModel?.get('name').value : undefined\"\r\n [attr.multiple]=\"multiSelect ? 'multiple' : undefined\">\r\n <ec-form-control *ngIf=\"displayType === 'file'\"\r\n id=\"{{inputId}}_formControl\"\r\n class=\"text-truncate\"\r\n [required]=\"required\"\r\n [pending]=\"pending\">\r\n <input id=\"{{inputId}}_name\"\r\n [formControl]=\"formModel?.get('name')\"\r\n type=\"text\"\r\n [placeholder]=\"placeholder\"\r\n [tabindex]=\"-1\">\r\n </ec-form-control>\r\n </div>\r\n <ec-button *ngIf=\"displayType === 'file'\"\r\n #browseBtn\r\n id=\"{{inputId}}_browseBtn\"\r\n (clicked)=\"fileInput.click()\"\r\n type=\"secondary\"\r\n [tabindex]=\"tabindex\"\r\n [disabled]=\"formModel?.get('name').disabled\"\r\n label=\"Browse\"\r\n [autofocus]=\"autofocus\">\r\n </ec-button>\r\n </div>\r\n <ec-button *ngIf=\"displayType === 'button'\"\r\n id=\"{{inputId}}_btn\"\r\n [pending]=\"pending\"\r\n [type]=\"buttonType\"\r\n [label]=\"buttonLabel ?? 'Browse_TC' | translate\"\r\n (clicked)=\"fileInput.click()\"\r\n style=\"width: 100%;\">\r\n </ec-button>\r\n</ec-form-group>", styles: [":host{display:block;margin-bottom:1rem}ec-form-control{margin-bottom:0}ec-form-control ::ng-deep>.ec-focus-ring{display:none!important}input[type=file]{opacity:0;display:block;position:absolute;top:0;left:0;width:100%;height:100%;z-index:1;cursor:pointer}input[type=file].has-value{width:calc(100% - 1.5rem)}ec-button{--ec-button-border-color-secondary: var(--ec-form-control-border-color);--ec-button-color-icon-secondary: var(--ec-color-icon)}\n"] }]
|
3932
4269
|
}], ctorParameters: function () { return [{ type: ValidationMessageService }, { type: FormGroupHelper }]; }, propDecorators: { placeholder: [{
|
3933
4270
|
type: Input
|
3934
4271
|
}], fileType: [{
|
@@ -4208,416 +4545,140 @@ class NumericboxComponent extends FormControlBase {
|
|
4208
4545
|
this.formModel.setValue(null);
|
4209
4546
|
}
|
4210
4547
|
// We only will update the textbox form model with formatting if needed
|
4211
|
-
// on Focus out. This works well for the user whether the auto update
|
4212
|
-
// is opted in or not
|
4213
|
-
if (isFocusOut) {
|
4214
|
-
this.textboxFormModel.setValue(this.formatDisplayNumber(number));
|
4215
|
-
}
|
4216
|
-
}
|
4217
|
-
this.formModel.markAsTouched();
|
4218
|
-
}
|
4219
|
-
catch (error) {
|
4220
|
-
// Nothing to display, just ensuring we reset our flag that filters
|
4221
|
-
// the form model value changes
|
4222
|
-
}
|
4223
|
-
finally {
|
4224
|
-
this.autoUpdatingFormModel = false;
|
4225
|
-
}
|
4226
|
-
}
|
4227
|
-
/**
|
4228
|
-
* Convert a number value to the formmated display string. If there is no value
|
4229
|
-
* return null
|
4230
|
-
*/
|
4231
|
-
formatDisplayNumber(value) {
|
4232
|
-
if (value || value === 0) {
|
4233
|
-
// Guard against calling toFixed if the value isn't a number. This is possible
|
4234
|
-
// if patching a value from outside of the component as you don't have
|
4235
|
-
// type checking there
|
4236
|
-
if (this.showPrecision && this.decimals && !isNaN(value)) {
|
4237
|
-
return value.toFixed(this.decimals);
|
4238
|
-
}
|
4239
|
-
else {
|
4240
|
-
return value.toString();
|
4241
|
-
}
|
4242
|
-
}
|
4243
|
-
else {
|
4244
|
-
return null;
|
4245
|
-
}
|
4246
|
-
}
|
4247
|
-
/**
|
4248
|
-
* Position the units element and set the padding in the textbox input based
|
4249
|
-
* on the width of the units element
|
4250
|
-
*/
|
4251
|
-
positionRightUnits() {
|
4252
|
-
let unitsEl = this.textboxEl.nativeElement.querySelector('.units-right');
|
4253
|
-
let inputEl = this.textboxEl.nativeElement.querySelector('input');
|
4254
|
-
if (unitsEl && inputEl) {
|
4255
|
-
let unitsWidth = unitsEl.offsetWidth;
|
4256
|
-
if (unitsWidth > 0) {
|
4257
|
-
this.unitsWidthCalculated = true;
|
4258
|
-
}
|
4259
|
-
let padding = unitsWidth;
|
4260
|
-
this.renderer.setStyle(inputEl, 'padding-right', padding + 'px');
|
4261
|
-
}
|
4262
|
-
}
|
4263
|
-
positionLeftUnits() {
|
4264
|
-
let unitsEl = this.textboxEl.nativeElement.querySelector('.units-left');
|
4265
|
-
let inputEl = this.textboxEl.nativeElement.querySelector('input');
|
4266
|
-
if (unitsEl && inputEl) {
|
4267
|
-
let unitsWidth = unitsEl.offsetWidth;
|
4268
|
-
if (unitsWidth > 0) {
|
4269
|
-
this.unitsWidthCalculated = true;
|
4270
|
-
}
|
4271
|
-
let padding = unitsWidth;
|
4272
|
-
let leftPosition = getComputedStyle(unitsEl).left;
|
4273
|
-
if (leftPosition) {
|
4274
|
-
padding += parseInt(leftPosition.replace('px', ''), 0);
|
4275
|
-
}
|
4276
|
-
this.renderer.setStyle(inputEl, 'padding-left', padding + 'px');
|
4277
|
-
}
|
4278
|
-
}
|
4279
|
-
/**
|
4280
|
-
* Create and append the units element to the textbox element
|
4281
|
-
*/
|
4282
|
-
showUnits() {
|
4283
|
-
let inputWrapper = this.textboxEl.nativeElement.querySelector('.input-wrapper');
|
4284
|
-
if (inputWrapper) {
|
4285
|
-
if (this.leftUnits) {
|
4286
|
-
let unitsEl = this.textboxEl.nativeElement.querySelector('.units-left');
|
4287
|
-
if (unitsEl) {
|
4288
|
-
this.renderer.setProperty(unitsEl, 'innerHTML', this.leftUnits);
|
4289
|
-
}
|
4290
|
-
else {
|
4291
|
-
this.renderer.appendChild(inputWrapper, this.makeUnitElement('left', this.leftUnits));
|
4292
|
-
}
|
4293
|
-
this.positionLeftUnits();
|
4294
|
-
}
|
4295
|
-
if (this.rightUnits) {
|
4296
|
-
let unitsEl = this.textboxEl.nativeElement.querySelector('.units-right');
|
4297
|
-
if (unitsEl) {
|
4298
|
-
this.renderer.setProperty(unitsEl, 'innerHTML', this.rightUnits);
|
4299
|
-
}
|
4300
|
-
else {
|
4301
|
-
this.renderer.appendChild(inputWrapper, this.makeUnitElement('right', this.rightUnits));
|
4302
|
-
}
|
4303
|
-
this.positionRightUnits();
|
4304
|
-
}
|
4305
|
-
}
|
4306
|
-
}
|
4307
|
-
makeUnitElement(side, text) {
|
4308
|
-
let unitsEl = this.renderer.createElement('span');
|
4309
|
-
this.renderer.setAttribute(unitsEl, 'class', `units units-${side}`);
|
4310
|
-
this.renderer.setAttribute(unitsEl, 'id', `${this.id}_units`);
|
4311
|
-
this.renderer.setAttribute(unitsEl, 'style', 'pointer-events: none');
|
4312
|
-
this.renderer.setProperty(unitsEl, 'innerHTML', text);
|
4313
|
-
return unitsEl;
|
4314
|
-
}
|
4315
|
-
}
|
4316
|
-
NumericboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NumericboxComponent, deps: [{ token: ValidationMessageService }, { token: FormGroupHelper }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
4317
|
-
NumericboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: NumericboxComponent, selector: "ec-numericbox", inputs: { placeholder: "placeholder", decimals: "decimals", showPrecision: "showPrecision", maxPrecisionDigits: "maxPrecisionDigits", max: "max", min: "min", leftUnits: "leftUnits", rightUnits: "rightUnits", autoUpdateFormModel: "autoUpdateFormModel" }, viewQueries: [{ propertyName: "textboxEl", first: true, predicate: TextboxComponent, descendants: true, read: ElementRef, static: true }, { propertyName: "textboxInput", first: true, predicate: ["textbox"], descendants: true, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"control control-label-{{labelPosition}}\"\r\n [class.invalid]=\"formModel?.invalid && (formModel?.touched)\">\r\n <label *ngIf=\"label\"\r\n ngPreserveWhitespaces>\r\n <span>{{label | translate}}</span>\r\n\r\n <span *ngIf=\"validationErrors.length && formModel?.touched && formModel?.invalid\">{{validationErrors | translate}}</span>\r\n </label>\r\n <!-- Setting the maxlength to 13 to combat the user from entering too large of a number\r\n for javascript to support. If the user enters all 13 characters as numbers and we have showPrecision set, adding the\r\n decimal and the empty zero characters will get them in a situation where to edit it they must remove characters\r\n as we would push them past the limit -->\r\n <ec-textbox [id]=\"id\"\r\n #textbox\r\n class=\"control-input mb-0\"\r\n [placeholder]=\"placeholder\"\r\n [maxlength]=\"maxPrecisionDigits ? maxPrecisionDigits + 3 : 13\"\r\n [autofocus]=\"autofocus\"\r\n [formModel]=\"textboxFormModel\"\r\n [required]=\"required\"\r\n [tabindex]=\"tabindex\"\r\n [readonly]=\"readonly\"\r\n [tooltip]=\"tooltip\"\r\n (focusout)=\"onFocusOut()\">\r\n </ec-textbox>\r\n</div>\r\n", styles: [":host{color:var(--ec-form-control-color);font-size:var(--ec-form-control-font-size);display:block;margin-bottom:1rem;width:100%}:host :host-context(.form-condensed){margin-bottom:.5rem}:host .control{width:100%;display:flex;flex-direction:column}:host .control.control-label-bottom{flex-direction:column-reverse}:host .control.control-label-left{flex-direction:row}:host .control.control-label-left label{margin-right:.25rem}:host .control.control-label-right{flex-direction:row-reverse}:host .control.control-label-right label{margin-left:.25rem}:host .control.control-label-left,:host .control.control-label-right{align-items:center}:host .control.control-label-left label,:host .control.control-label-right label{flex:1 1;margin-top:0;margin-bottom:0}:host .control.control-label-left .control-input,:host .control.control-label-right .control-input{flex:2 2}:host .control.is-readonly input,:host .control.is-readonly select,:host .control.is-readonly textarea{border-color:var(--ec-form-control-border-color-readonly);background-color:var(--ec-form-control-background-color-readonly);background-clip:border-box;background-image:none;color:var(--ec-form-control-color-readonly);opacity:1;-webkit-user-select:none;user-select:none;pointer-events:none;overflow:hidden;white-space:nowrap}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid:focus,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid:focus{border-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-invalid{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-required,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-required{display:none}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button{background-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button:not(:focus){border-color:var(--ec-form-control-border-color-invalid)}:host .textbox-group{display:flex;position:relative}:host textarea:focus,:host input:focus,:host select:focus{outline:none}label{color:var(--ec-form-control-label-color, var(--ec-color-secondary-dark));display:block;font-size:var(--ec-font-size-label);line-height:1;margin:calc(var(--ec-font-size-label) / 2) 0}ec-textbox ::ng-deep .input-wrapper{position:relative}ec-textbox ::ng-deep input{text-align:right}ec-textbox ::ng-deep input:required.is-empty:not(:disabled)~.units-left{left:1.25rem}ec-textbox ::ng-deep input.ng-invalid.ng-touched~.units-left{left:1.25rem}ec-textbox ::ng-deep .control:not(.is-readonly) input:disabled~.units{color:var(--ec-form-control-color-disabled);opacity:.65}ec-textbox ::ng-deep .units{display:block;position:absolute;top:0;height:2rem;line-height:1.25rem;padding:.375rem .25rem;z-index:2}ec-textbox ::ng-deep .units.units-right{right:0;padding-right:.5rem}ec-textbox ::ng-deep .units.units-left{left:0;padding-left:.5rem}.control.invalid ec-textbox ::ng-deep input.ng-invalid,.control.invalid ec-textbox ::ng-deep input.ng-valid{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}.control.invalid ec-textbox ::ng-deep input.ng-invalid:focus,.control.invalid ec-textbox ::ng-deep input.ng-valid:focus{border-color:var(--ec-form-control-background-color-invalid)}.control.invalid ec-textbox ::ng-deep input.ng-invalid~.units-left,.control.invalid ec-textbox ::ng-deep input.ng-valid~.units-left{left:1.25rem}.control.invalid ec-textbox ::ng-deep input.ng-invalid~.icon-invalid,.control.invalid ec-textbox ::ng-deep input.ng-valid~.icon-invalid{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}.control.invalid ec-textbox ::ng-deep input.ng-invalid~.icon-required,.control.invalid ec-textbox ::ng-deep input.ng-valid~.icon-required{display:none}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: TextboxComponent, selector: "ec-textbox", inputs: ["autocomplete", "type", "placeholder", "maxlength", "minlength", "rows", "selectOnAutofocus", "upperCase"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] });
|
4318
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NumericboxComponent, decorators: [{
|
4319
|
-
type: Component,
|
4320
|
-
args: [{ selector: 'ec-numericbox', template: "<div class=\"control control-label-{{labelPosition}}\"\r\n [class.invalid]=\"formModel?.invalid && (formModel?.touched)\">\r\n <label *ngIf=\"label\"\r\n ngPreserveWhitespaces>\r\n <span>{{label | translate}}</span>\r\n\r\n <span *ngIf=\"validationErrors.length && formModel?.touched && formModel?.invalid\">{{validationErrors | translate}}</span>\r\n </label>\r\n <!-- Setting the maxlength to 13 to combat the user from entering too large of a number\r\n for javascript to support. If the user enters all 13 characters as numbers and we have showPrecision set, adding the\r\n decimal and the empty zero characters will get them in a situation where to edit it they must remove characters\r\n as we would push them past the limit -->\r\n <ec-textbox [id]=\"id\"\r\n #textbox\r\n class=\"control-input mb-0\"\r\n [placeholder]=\"placeholder\"\r\n [maxlength]=\"maxPrecisionDigits ? maxPrecisionDigits + 3 : 13\"\r\n [autofocus]=\"autofocus\"\r\n [formModel]=\"textboxFormModel\"\r\n [required]=\"required\"\r\n [tabindex]=\"tabindex\"\r\n [readonly]=\"readonly\"\r\n [tooltip]=\"tooltip\"\r\n (focusout)=\"onFocusOut()\">\r\n </ec-textbox>\r\n</div>\r\n", styles: [":host{color:var(--ec-form-control-color);font-size:var(--ec-form-control-font-size);display:block;margin-bottom:1rem;width:100%}:host :host-context(.form-condensed){margin-bottom:.5rem}:host .control{width:100%;display:flex;flex-direction:column}:host .control.control-label-bottom{flex-direction:column-reverse}:host .control.control-label-left{flex-direction:row}:host .control.control-label-left label{margin-right:.25rem}:host .control.control-label-right{flex-direction:row-reverse}:host .control.control-label-right label{margin-left:.25rem}:host .control.control-label-left,:host .control.control-label-right{align-items:center}:host .control.control-label-left label,:host .control.control-label-right label{flex:1 1;margin-top:0;margin-bottom:0}:host .control.control-label-left .control-input,:host .control.control-label-right .control-input{flex:2 2}:host .control.is-readonly input,:host .control.is-readonly select,:host .control.is-readonly textarea{border-color:var(--ec-form-control-border-color-readonly);background-color:var(--ec-form-control-background-color-readonly);background-clip:border-box;background-image:none;color:var(--ec-form-control-color-readonly);opacity:1;-webkit-user-select:none;user-select:none;pointer-events:none;overflow:hidden;white-space:nowrap}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid:focus,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid:focus{border-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-invalid{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-required,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-required{display:none}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button{background-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button:not(:focus){border-color:var(--ec-form-control-border-color-invalid)}:host .textbox-group{display:flex;position:relative}:host textarea:focus,:host input:focus,:host select:focus{outline:none}label{color:var(--ec-form-control-label-color, var(--ec-color-secondary-dark));display:block;font-size:var(--ec-font-size-label);line-height:1;margin:calc(var(--ec-font-size-label) / 2) 0}ec-textbox ::ng-deep .input-wrapper{position:relative}ec-textbox ::ng-deep input{text-align:right}ec-textbox ::ng-deep input:required.is-empty:not(:disabled)~.units-left{left:1.25rem}ec-textbox ::ng-deep input.ng-invalid.ng-touched~.units-left{left:1.25rem}ec-textbox ::ng-deep .control:not(.is-readonly) input:disabled~.units{color:var(--ec-form-control-color-disabled);opacity:.65}ec-textbox ::ng-deep .units{display:block;position:absolute;top:0;height:2rem;line-height:1.25rem;padding:.375rem .25rem;z-index:2}ec-textbox ::ng-deep .units.units-right{right:0;padding-right:.5rem}ec-textbox ::ng-deep .units.units-left{left:0;padding-left:.5rem}.control.invalid ec-textbox ::ng-deep input.ng-invalid,.control.invalid ec-textbox ::ng-deep input.ng-valid{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}.control.invalid ec-textbox ::ng-deep input.ng-invalid:focus,.control.invalid ec-textbox ::ng-deep input.ng-valid:focus{border-color:var(--ec-form-control-background-color-invalid)}.control.invalid ec-textbox ::ng-deep input.ng-invalid~.units-left,.control.invalid ec-textbox ::ng-deep input.ng-valid~.units-left{left:1.25rem}.control.invalid ec-textbox ::ng-deep input.ng-invalid~.icon-invalid,.control.invalid ec-textbox ::ng-deep input.ng-valid~.icon-invalid{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}.control.invalid ec-textbox ::ng-deep input.ng-invalid~.icon-required,.control.invalid ec-textbox ::ng-deep input.ng-valid~.icon-required{display:none}\n"] }]
|
4321
|
-
}], ctorParameters: function () { return [{ type: ValidationMessageService }, { type: FormGroupHelper }, { type: i0.Renderer2 }]; }, propDecorators: { placeholder: [{
|
4322
|
-
type: Input
|
4323
|
-
}], decimals: [{
|
4324
|
-
type: Input
|
4325
|
-
}], showPrecision: [{
|
4326
|
-
type: Input
|
4327
|
-
}], maxPrecisionDigits: [{
|
4328
|
-
type: Input
|
4329
|
-
}], max: [{
|
4330
|
-
type: Input
|
4331
|
-
}], min: [{
|
4332
|
-
type: Input
|
4333
|
-
}], leftUnits: [{
|
4334
|
-
type: Input
|
4335
|
-
}], rightUnits: [{
|
4336
|
-
type: Input
|
4337
|
-
}], autoUpdateFormModel: [{
|
4338
|
-
type: Input
|
4339
|
-
}], textboxEl: [{
|
4340
|
-
type: ViewChild,
|
4341
|
-
args: [TextboxComponent, { read: ElementRef, static: true }]
|
4342
|
-
}], textboxInput: [{
|
4343
|
-
type: ViewChild,
|
4344
|
-
args: ['textbox', { static: true }]
|
4345
|
-
}] } });
|
4346
|
-
|
4347
|
-
class TooltipComponent {
|
4348
|
-
constructor() {
|
4349
|
-
this.position = 'top-center';
|
4350
|
-
this.dismissible = false;
|
4351
|
-
this.onHide = new EventEmitter();
|
4352
|
-
}
|
4353
|
-
hide() {
|
4354
|
-
this.onHide.next();
|
4355
|
-
this.overlayRef?.dispose();
|
4356
|
-
}
|
4357
|
-
}
|
4358
|
-
TooltipComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TooltipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
4359
|
-
TooltipComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: TooltipComponent, selector: "ec-tooltip", host: { properties: { "style.--ec-tooltip-background-color": "this.backgroundColor", "style.--ec-tooltip-color-title": "this.titleColor" } }, ngImport: i0, template: "<article id=\"{{id}}\" class=\"py-3 position-{{position}}\" [class.show-arrow]=\"!hideArrow\">\r\n <header *ngIf=\"title || subtitle\" class=\"mb-3\">\r\n <h1 class=\"text-heading-2 px-3 mb-0\">{{title}}</h1>\r\n <p class=\"text-caption-1 px-3 mb-0\">{{subtitle}}</p>\r\n </header>\r\n\r\n <ng-container *ngIf=\"customContent; else textTemplate\">\r\n <ng-container *ngTemplateOutlet=\"customContent\"></ng-container>\r\n </ng-container>\r\n\r\n <ng-template #textTemplate>\r\n <div class=\"text-body-1 px-3\" [innerHTML]=\"text\"></div>\r\n </ng-template>\r\n\r\n <ec-button *ngIf=\"dismissible\" id=\"tooltipDismiss\" type=\"icon\" icon=\"icon-cancel\" (clicked)=\"hide()\"></ec-button>\r\n</article>\r\n", styles: [":host{display:block;padding:.75rem}article{background-color:var(--ec-tooltip-background-color, #162F3B);color:var(--ec-tooltip-color, var(--ec-color-primary-light));border-radius:var(--ec-border-radius-card);position:relative;box-shadow:var(--ec-box-shadow-overlay);--ec-color-link: var(--ec-color-link-light)}article.show-arrow:after{content:\"\";height:0;width:0;border:.625rem solid transparent;display:block;position:absolute;pointer-events:none}article.show-arrow.position-top-left:after,article.show-arrow.position-top-center:after,article.show-arrow.position-top-right:after{bottom:-1.25rem;border-top-color:var(--ec-tooltip-background-color, #162F3B)}article.show-arrow.position-bottom-left:after,article.show-arrow.position-bottom-center:after,article.show-arrow.position-bottom-right:after{top:-1.25rem;border-bottom-color:var(--ec-tooltip-background-color, #162F3B)}article.show-arrow.position-top-left:after,article.show-arrow.position-bottom-left:after{right:1rem}article.show-arrow.position-top-right:after,article.show-arrow.position-bottom-right:after{left:1rem}article.show-arrow.position-top-center:after,article.show-arrow.position-bottom-center:after{right:50%;transform:translate(50%)}article.show-arrow.position-right-top:after,article.show-arrow.position-right-center:after,article.show-arrow.position-right-bottom:after{left:-1.25rem;border-right-color:var(--ec-tooltip-background-color, #162F3B)}article.show-arrow.position-left-top:after,article.show-arrow.position-left-center:after,article.show-arrow.position-left-bottom:after{right:-1.25rem;border-left-color:var(--ec-tooltip-background-color, #162F3B)}article.show-arrow.position-left-top:after,article.show-arrow.position-right-top:after{top:1rem}article.show-arrow.position-left-bottom:after,article.show-arrow.position-right-bottom:after{bottom:1rem}article.show-arrow.position-left-center:after,article.show-arrow.position-right-center:after{bottom:50%;transform:translateY(50%)}.text-heading-2{color:var(--ec-tooltip-color-title, var(--ec-color-primary-light))}.text-body-1{color:var(--ec-color-primary-light)}.text-body-1 ::ng-deep p:last-child{margin-bottom:0}.text-body-1 ::ng-deep a{font-weight:var(--ec-font-weight-bold)}.text-caption-1{color:var(--ec-color-secondary-light)}ec-button{--ec-button-color-icon: var(--ec-color-secondary-light);--ec-button-color-icon-hover: var(--ec-color-primary-light);--ec-background-color-hover: rgba(255,255,255,.15);position:absolute;top:.25rem;right:.25rem}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ButtonComponent, selector: "ec-button", inputs: ["id", "disabled", "icon", "label", "badge", "tabindex", "type", "pending", "pendingIcon", "customTemplate", "isSubmit", "autofocus"], outputs: ["clicked"] }] });
|
4360
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TooltipComponent, decorators: [{
|
4361
|
-
type: Component,
|
4362
|
-
args: [{ selector: 'ec-tooltip', template: "<article id=\"{{id}}\" class=\"py-3 position-{{position}}\" [class.show-arrow]=\"!hideArrow\">\r\n <header *ngIf=\"title || subtitle\" class=\"mb-3\">\r\n <h1 class=\"text-heading-2 px-3 mb-0\">{{title}}</h1>\r\n <p class=\"text-caption-1 px-3 mb-0\">{{subtitle}}</p>\r\n </header>\r\n\r\n <ng-container *ngIf=\"customContent; else textTemplate\">\r\n <ng-container *ngTemplateOutlet=\"customContent\"></ng-container>\r\n </ng-container>\r\n\r\n <ng-template #textTemplate>\r\n <div class=\"text-body-1 px-3\" [innerHTML]=\"text\"></div>\r\n </ng-template>\r\n\r\n <ec-button *ngIf=\"dismissible\" id=\"tooltipDismiss\" type=\"icon\" icon=\"icon-cancel\" (clicked)=\"hide()\"></ec-button>\r\n</article>\r\n", styles: [":host{display:block;padding:.75rem}article{background-color:var(--ec-tooltip-background-color, #162F3B);color:var(--ec-tooltip-color, var(--ec-color-primary-light));border-radius:var(--ec-border-radius-card);position:relative;box-shadow:var(--ec-box-shadow-overlay);--ec-color-link: var(--ec-color-link-light)}article.show-arrow:after{content:\"\";height:0;width:0;border:.625rem solid transparent;display:block;position:absolute;pointer-events:none}article.show-arrow.position-top-left:after,article.show-arrow.position-top-center:after,article.show-arrow.position-top-right:after{bottom:-1.25rem;border-top-color:var(--ec-tooltip-background-color, #162F3B)}article.show-arrow.position-bottom-left:after,article.show-arrow.position-bottom-center:after,article.show-arrow.position-bottom-right:after{top:-1.25rem;border-bottom-color:var(--ec-tooltip-background-color, #162F3B)}article.show-arrow.position-top-left:after,article.show-arrow.position-bottom-left:after{right:1rem}article.show-arrow.position-top-right:after,article.show-arrow.position-bottom-right:after{left:1rem}article.show-arrow.position-top-center:after,article.show-arrow.position-bottom-center:after{right:50%;transform:translate(50%)}article.show-arrow.position-right-top:after,article.show-arrow.position-right-center:after,article.show-arrow.position-right-bottom:after{left:-1.25rem;border-right-color:var(--ec-tooltip-background-color, #162F3B)}article.show-arrow.position-left-top:after,article.show-arrow.position-left-center:after,article.show-arrow.position-left-bottom:after{right:-1.25rem;border-left-color:var(--ec-tooltip-background-color, #162F3B)}article.show-arrow.position-left-top:after,article.show-arrow.position-right-top:after{top:1rem}article.show-arrow.position-left-bottom:after,article.show-arrow.position-right-bottom:after{bottom:1rem}article.show-arrow.position-left-center:after,article.show-arrow.position-right-center:after{bottom:50%;transform:translateY(50%)}.text-heading-2{color:var(--ec-tooltip-color-title, var(--ec-color-primary-light))}.text-body-1{color:var(--ec-color-primary-light)}.text-body-1 ::ng-deep p:last-child{margin-bottom:0}.text-body-1 ::ng-deep a{font-weight:var(--ec-font-weight-bold)}.text-caption-1{color:var(--ec-color-secondary-light)}ec-button{--ec-button-color-icon: var(--ec-color-secondary-light);--ec-button-color-icon-hover: var(--ec-color-primary-light);--ec-background-color-hover: rgba(255,255,255,.15);position:absolute;top:.25rem;right:.25rem}\n"] }]
|
4363
|
-
}], propDecorators: { backgroundColor: [{
|
4364
|
-
type: HostBinding,
|
4365
|
-
args: ['style.--ec-tooltip-background-color']
|
4366
|
-
}], titleColor: [{
|
4367
|
-
type: HostBinding,
|
4368
|
-
args: ['style.--ec-tooltip-color-title']
|
4369
|
-
}] } });
|
4370
|
-
|
4371
|
-
class TooltipService {
|
4372
|
-
constructor(overlay) {
|
4373
|
-
this.overlay = overlay;
|
4374
|
-
this.positions = {
|
4375
|
-
'top-left': { originX: 'center', originY: 'top', overlayX: 'end', overlayY: 'bottom', offsetX: 38 },
|
4376
|
-
'top-center': { originX: 'center', originY: 'top', overlayX: 'center', overlayY: 'bottom' },
|
4377
|
-
'top-right': { originX: 'center', originY: 'top', overlayX: 'start', overlayY: 'bottom', offsetX: -38 },
|
4378
|
-
'bottom-left': { originX: 'center', originY: 'bottom', overlayX: 'end', overlayY: 'top', offsetX: 38 },
|
4379
|
-
'bottom-center': { originX: 'center', originY: 'bottom', overlayX: 'center', overlayY: 'top' },
|
4380
|
-
'bottom-right': { originX: 'center', originY: 'bottom', overlayX: 'start', overlayY: 'top', offsetX: -38 },
|
4381
|
-
'left-top': { originX: 'start', originY: 'center', overlayX: 'end', overlayY: 'top', offsetY: -38 },
|
4382
|
-
'left-center': { originX: 'start', originY: 'center', overlayX: 'end', overlayY: 'center' },
|
4383
|
-
'left-bottom': { originX: 'start', originY: 'center', overlayX: 'end', overlayY: 'bottom', offsetY: 38 },
|
4384
|
-
'right-top': { originX: 'end', originY: 'center', overlayX: 'start', overlayY: 'top', offsetY: -38 },
|
4385
|
-
'right-center': { originX: 'end', originY: 'center', overlayX: 'start', overlayY: 'center' },
|
4386
|
-
'right-bottom': { originX: 'end', originY: 'center', overlayX: 'start', overlayY: 'bottom', offsetY: 38 }
|
4387
|
-
};
|
4388
|
-
}
|
4389
|
-
/**
|
4390
|
-
* Show a tooltip attached to a specified element
|
4391
|
-
*/
|
4392
|
-
show(anchor, position = 'top-center', options) {
|
4393
|
-
const overlayConfig = this.getOverlayConfig(anchor, this.positions[position], options?.width, options?.maxWidth);
|
4394
|
-
const overlayRef = this.overlay.create(overlayConfig);
|
4395
|
-
const contentPortal = new ComponentPortal(TooltipComponent);
|
4396
|
-
const contentViewRef = overlayRef.attach(contentPortal);
|
4397
|
-
contentViewRef.instance.position = position;
|
4398
|
-
contentViewRef.instance.id = options?.id;
|
4399
|
-
contentViewRef.instance.title = options?.title;
|
4400
|
-
contentViewRef.instance.subtitle = options?.subtitle;
|
4401
|
-
contentViewRef.instance.text = options?.text;
|
4402
|
-
contentViewRef.instance.customContent = options?.customContent;
|
4403
|
-
contentViewRef.instance.dismissible = options?.dismissible || false;
|
4404
|
-
contentViewRef.instance.backgroundColor = options?.backgroundColor;
|
4405
|
-
contentViewRef.instance.titleColor = options?.titleColor;
|
4406
|
-
contentViewRef.instance.hideArrow = options?.hideArrow;
|
4407
|
-
contentViewRef.instance.overlayRef = overlayRef;
|
4408
|
-
return contentViewRef.instance;
|
4409
|
-
}
|
4410
|
-
onMove(event, contentRect) {
|
4411
|
-
let callCallback = false;
|
4412
|
-
if (contentRect) {
|
4413
|
-
if (event.clientX > contentRect.right
|
4414
|
-
|| event.clientX < contentRect.left
|
4415
|
-
|| event.clientY > contentRect.bottom
|
4416
|
-
|| event.clientY < contentRect.top) {
|
4417
|
-
callCallback = true;
|
4418
|
-
}
|
4419
|
-
}
|
4420
|
-
return callCallback;
|
4421
|
-
}
|
4422
|
-
getOverlayConfig(element, position, width, maxWidth) {
|
4423
|
-
const positionStrategy = this.overlay.position()
|
4424
|
-
.flexibleConnectedTo(element)
|
4425
|
-
.withPositions([position]);
|
4426
|
-
const config = new OverlayConfig({
|
4427
|
-
positionStrategy: positionStrategy,
|
4428
|
-
width: width,
|
4429
|
-
maxWidth: maxWidth
|
4430
|
-
});
|
4431
|
-
return config;
|
4432
|
-
}
|
4433
|
-
}
|
4434
|
-
TooltipService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TooltipService, deps: [{ token: i1$2.Overlay }], target: i0.ɵɵFactoryTarget.Injectable });
|
4435
|
-
TooltipService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TooltipService, providedIn: 'root' });
|
4436
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TooltipService, decorators: [{
|
4437
|
-
type: Injectable,
|
4438
|
-
args: [{
|
4439
|
-
providedIn: 'root'
|
4440
|
-
}]
|
4441
|
-
}], ctorParameters: function () { return [{ type: i1$2.Overlay }]; } });
|
4442
|
-
|
4443
|
-
class TagsComponent {
|
4444
|
-
constructor() {
|
4445
|
-
/**The ID of this set of tags */
|
4446
|
-
this.id = '';
|
4447
|
-
/**
|
4448
|
-
* Determines whether the tags will wrap or not
|
4449
|
-
*
|
4450
|
-
* @type {boolean}
|
4451
|
-
* @memberof TagsComponent
|
4452
|
-
*/
|
4453
|
-
this.wrap = true;
|
4454
|
-
/**
|
4455
|
-
* Displays the tags in condensed mode
|
4456
|
-
*/
|
4457
|
-
this.isCondensed = false;
|
4458
|
-
/**
|
4459
|
-
* Emits the tag item when the tag's close button is clicked
|
4460
|
-
*/
|
4461
|
-
this.tagClosed = new EventEmitter();
|
4462
|
-
/**
|
4463
|
-
* Tags to be displayed
|
4464
|
-
*
|
4465
|
-
* @type {Tag[]}
|
4466
|
-
* @memberof TagsComponent
|
4467
|
-
*/
|
4468
|
-
this.tagsArray = [];
|
4548
|
+
// on Focus out. This works well for the user whether the auto update
|
4549
|
+
// is opted in or not
|
4550
|
+
if (isFocusOut) {
|
4551
|
+
this.textboxFormModel.setValue(this.formatDisplayNumber(number));
|
4552
|
+
}
|
4553
|
+
}
|
4554
|
+
this.formModel.markAsTouched();
|
4555
|
+
}
|
4556
|
+
catch (error) {
|
4557
|
+
// Nothing to display, just ensuring we reset our flag that filters
|
4558
|
+
// the form model value changes
|
4559
|
+
}
|
4560
|
+
finally {
|
4561
|
+
this.autoUpdatingFormModel = false;
|
4562
|
+
}
|
4469
4563
|
}
|
4470
4564
|
/**
|
4471
|
-
*
|
4472
|
-
*
|
4473
|
-
*
|
4474
|
-
* @param {SimpleChanges} changes
|
4475
|
-
* @memberof TagsComponent
|
4565
|
+
* Convert a number value to the formmated display string. If there is no value
|
4566
|
+
* return null
|
4476
4567
|
*/
|
4477
|
-
|
4478
|
-
if (
|
4479
|
-
if
|
4480
|
-
|
4481
|
-
|
4482
|
-
|
4483
|
-
|
4484
|
-
else {
|
4485
|
-
this.tagsArray = [this.tags];
|
4486
|
-
}
|
4568
|
+
formatDisplayNumber(value) {
|
4569
|
+
if (value || value === 0) {
|
4570
|
+
// Guard against calling toFixed if the value isn't a number. This is possible
|
4571
|
+
// if patching a value from outside of the component as you don't have
|
4572
|
+
// type checking there
|
4573
|
+
if (this.showPrecision && this.decimals && !isNaN(value)) {
|
4574
|
+
return value.toFixed(this.decimals);
|
4487
4575
|
}
|
4488
4576
|
else {
|
4489
|
-
|
4490
|
-
this.tagsArray = [];
|
4577
|
+
return value.toString();
|
4491
4578
|
}
|
4492
4579
|
}
|
4580
|
+
else {
|
4581
|
+
return null;
|
4582
|
+
}
|
4493
4583
|
}
|
4494
|
-
|
4495
|
-
|
4496
|
-
|
4497
|
-
}
|
4498
|
-
}
|
4499
|
-
TagsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TagsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
4500
|
-
TagsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: TagsComponent, selector: "ec-tags", inputs: { id: "id", tags: "tags", wrap: "wrap", isCondensed: "isCondensed" }, outputs: { tagClosed: "tagClosed" }, usesOnChanges: true, ngImport: i0, template: "<ul class=\"tags\"\r\n [class.is-wrapped]=\"wrap\">\r\n <li *ngFor=\"let tag of tagsArray; index as i\"\r\n id=\"{{id}}_tag_{{i}}\"\r\n class=\"tag is-{{tag.type}} {{tag.classList}} mr-1\"\r\n [ngClass]=\"{'text-caption-1': !isCondensed, 'text-caption-2': isCondensed, 'is-condensed': isCondensed, 'pr-0': tag.isDismissable, 'is-link': tag.url}\"\r\n title=\"{{tag.tooltip | translate}}\">\r\n <i *ngIf=\"tag.icon\"\r\n class=\"ec-icon {{tag.icon}} ec-icon-sm\"></i>\r\n <span *ngIf=\"!tag.url\">{{tag.label | translate}}</span>\r\n\r\n <a *ngIf=\"tag.url\"\r\n id=\"{{id}}_tag_{{i}}_link\"\r\n class=\"font-weight-bold\"\r\n href=\"{{tag.url}}\"\r\n target=\"{{tag.target}}\">{{tag.label | translate}}</a>\r\n\r\n <button id=\"{{id}}_tag_{{i}}_dismissButton\"\r\n *ngIf=\"tag.isDismissable\"\r\n (click)=\"closeTag(tag)\">\r\n <i class=\"ec-icon ec-icon-sm icon-cancel\"></i>\r\n </button>\r\n </li>\r\n</ul>", styles: ["@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}:host{display:block}.tags{padding:0;margin:0;list-style:none;display:flex}.tags.is-wrapped{flex-wrap:wrap;margin-top:.25rem}.tags.is-wrapped>.tag{margin-bottom:.25rem}.tag{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background-color:var(--ec-color-gray-1);border:2px solid var(--ec-color-gray-4);display:inline-flex;align-items:center;border-radius:calc(var(--ec-border-radius, .25rem) * 3);height:1.5rem;line-height:1.25rem;padding:0 .4375rem;vertical-align:top}.tag>.ec-icon:first-child{margin-right:.1875rem}.tag .ec-icon{display:flex;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;width:auto;height:auto;min-width:1em;justify-content:center}.tag.is-inverted{background-color:var(--ec-background-color);border-color:var(--ec-background-color)}.tag.is-info{background-color:var(--ec-color-cobalt-1);border-color:var(--ec-color-info)}.tag.is-info>.ec-icon:first-child{color:var(--ec-color-info)}.tag.is-success{background-color:var(--ec-color-green-1);border-color:var(--ec-color-success)}.tag.is-success>.ec-icon:first-child{color:var(--ec-color-success)}.tag.is-warning{background-color:var(--ec-color-yellow-1);border-color:var(--ec-color-caution)}.tag.is-warning>.ec-icon:first-child{color:var(--ec-color-caution)}.tag.is-danger{background-color:var(--ec-color-red-1);border-color:var(--ec-color-danger)}.tag.is-danger>.ec-icon:first-child{color:var(--ec-color-danger)}.tag.is-accent{background-color:var(--ec-color-purple-1);border-color:var(--ec-color-accent)}.tag.is-accent>.ec-icon:first-child{color:var(--ec-color-accent)}.tag.is-chargeback{background-color:var(--ec-color-orange-1);border-color:var(--ec-color-orange-7)}.tag.is-chargeback>.ec-icon:first-child{color:var(--ec-color-orange-7)}.tag.is-accrual{background-color:var(--ec-color-aqua-1);border-color:var(--ec-color-aqua-5)}.tag.is-accrual>.ec-icon:first-child{color:var(--ec-color-aqua-5)}.tag.is-system{background-color:var(--ec-color-gray-1);border-color:var(--ec-color-gray-4)}.tag.is-system>.ec-icon:first-child{color:var(--ec-color-gray-4)}button{background-color:transparent;border:0;display:flex;align-items:center;padding:0 .25rem;height:100%;cursor:pointer;position:relative}button:hover,button:focus{outline:none}button:hover:before,button:focus:before{display:block;content:\"\";position:absolute;inset:.0625rem .125rem;background-color:#1a1a231a;border-radius:.125rem}.is-condensed{border-radius:var(--ec-border-radius);border-width:1px;padding:0 .25rem;height:1.125rem;line-height:1.125rem;min-width:1.125rem;justify-content:center}.is-condensed>.ec-icon:first-child{margin-right:.125rem}.is-link a:after{opacity:1;margin-left:.1875rem}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] });
|
4501
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TagsComponent, decorators: [{
|
4502
|
-
type: Component,
|
4503
|
-
args: [{ selector: 'ec-tags', template: "<ul class=\"tags\"\r\n [class.is-wrapped]=\"wrap\">\r\n <li *ngFor=\"let tag of tagsArray; index as i\"\r\n id=\"{{id}}_tag_{{i}}\"\r\n class=\"tag is-{{tag.type}} {{tag.classList}} mr-1\"\r\n [ngClass]=\"{'text-caption-1': !isCondensed, 'text-caption-2': isCondensed, 'is-condensed': isCondensed, 'pr-0': tag.isDismissable, 'is-link': tag.url}\"\r\n title=\"{{tag.tooltip | translate}}\">\r\n <i *ngIf=\"tag.icon\"\r\n class=\"ec-icon {{tag.icon}} ec-icon-sm\"></i>\r\n <span *ngIf=\"!tag.url\">{{tag.label | translate}}</span>\r\n\r\n <a *ngIf=\"tag.url\"\r\n id=\"{{id}}_tag_{{i}}_link\"\r\n class=\"font-weight-bold\"\r\n href=\"{{tag.url}}\"\r\n target=\"{{tag.target}}\">{{tag.label | translate}}</a>\r\n\r\n <button id=\"{{id}}_tag_{{i}}_dismissButton\"\r\n *ngIf=\"tag.isDismissable\"\r\n (click)=\"closeTag(tag)\">\r\n <i class=\"ec-icon ec-icon-sm icon-cancel\"></i>\r\n </button>\r\n </li>\r\n</ul>", styles: ["@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}:host{display:block}.tags{padding:0;margin:0;list-style:none;display:flex}.tags.is-wrapped{flex-wrap:wrap;margin-top:.25rem}.tags.is-wrapped>.tag{margin-bottom:.25rem}.tag{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background-color:var(--ec-color-gray-1);border:2px solid var(--ec-color-gray-4);display:inline-flex;align-items:center;border-radius:calc(var(--ec-border-radius, .25rem) * 3);height:1.5rem;line-height:1.25rem;padding:0 .4375rem;vertical-align:top}.tag>.ec-icon:first-child{margin-right:.1875rem}.tag .ec-icon{display:flex;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;width:auto;height:auto;min-width:1em;justify-content:center}.tag.is-inverted{background-color:var(--ec-background-color);border-color:var(--ec-background-color)}.tag.is-info{background-color:var(--ec-color-cobalt-1);border-color:var(--ec-color-info)}.tag.is-info>.ec-icon:first-child{color:var(--ec-color-info)}.tag.is-success{background-color:var(--ec-color-green-1);border-color:var(--ec-color-success)}.tag.is-success>.ec-icon:first-child{color:var(--ec-color-success)}.tag.is-warning{background-color:var(--ec-color-yellow-1);border-color:var(--ec-color-caution)}.tag.is-warning>.ec-icon:first-child{color:var(--ec-color-caution)}.tag.is-danger{background-color:var(--ec-color-red-1);border-color:var(--ec-color-danger)}.tag.is-danger>.ec-icon:first-child{color:var(--ec-color-danger)}.tag.is-accent{background-color:var(--ec-color-purple-1);border-color:var(--ec-color-accent)}.tag.is-accent>.ec-icon:first-child{color:var(--ec-color-accent)}.tag.is-chargeback{background-color:var(--ec-color-orange-1);border-color:var(--ec-color-orange-7)}.tag.is-chargeback>.ec-icon:first-child{color:var(--ec-color-orange-7)}.tag.is-accrual{background-color:var(--ec-color-aqua-1);border-color:var(--ec-color-aqua-5)}.tag.is-accrual>.ec-icon:first-child{color:var(--ec-color-aqua-5)}.tag.is-system{background-color:var(--ec-color-gray-1);border-color:var(--ec-color-gray-4)}.tag.is-system>.ec-icon:first-child{color:var(--ec-color-gray-4)}button{background-color:transparent;border:0;display:flex;align-items:center;padding:0 .25rem;height:100%;cursor:pointer;position:relative}button:hover,button:focus{outline:none}button:hover:before,button:focus:before{display:block;content:\"\";position:absolute;inset:.0625rem .125rem;background-color:#1a1a231a;border-radius:.125rem}.is-condensed{border-radius:var(--ec-border-radius);border-width:1px;padding:0 .25rem;height:1.125rem;line-height:1.125rem;min-width:1.125rem;justify-content:center}.is-condensed>.ec-icon:first-child{margin-right:.125rem}.is-link a:after{opacity:1;margin-left:.1875rem}\n"] }]
|
4504
|
-
}], ctorParameters: function () { return []; }, propDecorators: { id: [{
|
4505
|
-
type: Input
|
4506
|
-
}], tags: [{
|
4507
|
-
type: Input
|
4508
|
-
}], wrap: [{
|
4509
|
-
type: Input
|
4510
|
-
}], isCondensed: [{
|
4511
|
-
type: Input
|
4512
|
-
}], tagClosed: [{
|
4513
|
-
type: Output
|
4514
|
-
}] } });
|
4515
|
-
|
4516
|
-
class PopoverComponent {
|
4517
|
-
constructor(overlay, viewContainerRef, elementRef, tooltipService) {
|
4518
|
-
this.overlay = overlay;
|
4519
|
-
this.viewContainerRef = viewContainerRef;
|
4520
|
-
this.elementRef = elementRef;
|
4521
|
-
this.tooltipService = tooltipService;
|
4522
|
-
/** An optional icon that, if provided, enables the popover to use it as the anchor element */
|
4523
|
-
this.icon = '';
|
4524
|
-
this.contentPosition = 'top-left';
|
4525
|
-
this.iconHoverClass = '';
|
4526
|
-
this.isVisible = false;
|
4527
|
-
this.mouseOver = new Subject();
|
4528
|
-
this.interrupt = new Subject();
|
4529
|
-
}
|
4530
|
-
/** When the popover initializes, if a new tagType is provided for the hover state of the popover,
|
4531
|
-
* we use it to update the type of our "hoverTag" (which controls background-color of tag)
|
4584
|
+
/**
|
4585
|
+
* Position the units element and set the padding in the textbox input based
|
4586
|
+
* on the width of the units element
|
4532
4587
|
*/
|
4533
|
-
|
4534
|
-
|
4535
|
-
|
4588
|
+
positionRightUnits() {
|
4589
|
+
let unitsEl = this.textboxEl.nativeElement.querySelector('.units-right');
|
4590
|
+
let inputEl = this.textboxEl.nativeElement.querySelector('input');
|
4591
|
+
if (unitsEl && inputEl) {
|
4592
|
+
let unitsWidth = unitsEl.offsetWidth;
|
4593
|
+
if (unitsWidth > 0) {
|
4594
|
+
this.unitsWidthCalculated = true;
|
4595
|
+
}
|
4596
|
+
let padding = unitsWidth;
|
4597
|
+
this.renderer.setStyle(inputEl, 'padding-right', padding + 'px');
|
4536
4598
|
}
|
4537
|
-
this.mouseOver
|
4538
|
-
.pipe(switchMap(v => of(v).pipe(delay(300), takeUntil(this.interrupt))))
|
4539
|
-
.subscribe(() => this.show());
|
4540
|
-
}
|
4541
|
-
ngOnDestroy() {
|
4542
|
-
this.hide();
|
4543
4599
|
}
|
4544
|
-
|
4545
|
-
|
4546
|
-
|
4547
|
-
|
4548
|
-
|
4549
|
-
|
4550
|
-
|
4600
|
+
positionLeftUnits() {
|
4601
|
+
let unitsEl = this.textboxEl.nativeElement.querySelector('.units-left');
|
4602
|
+
let inputEl = this.textboxEl.nativeElement.querySelector('input');
|
4603
|
+
if (unitsEl && inputEl) {
|
4604
|
+
let unitsWidth = unitsEl.offsetWidth;
|
4605
|
+
if (unitsWidth > 0) {
|
4606
|
+
this.unitsWidthCalculated = true;
|
4607
|
+
}
|
4608
|
+
let padding = unitsWidth;
|
4609
|
+
let leftPosition = getComputedStyle(unitsEl).left;
|
4610
|
+
if (leftPosition) {
|
4611
|
+
padding += parseInt(leftPosition.replace('px', ''), 0);
|
4612
|
+
}
|
4613
|
+
this.renderer.setStyle(inputEl, 'padding-left', padding + 'px');
|
4551
4614
|
}
|
4552
4615
|
}
|
4553
|
-
onMouseOver() {
|
4554
|
-
this.mouseOver.next();
|
4555
|
-
}
|
4556
|
-
onLeave() {
|
4557
|
-
this.interrupt.next();
|
4558
|
-
}
|
4559
4616
|
/**
|
4560
|
-
*
|
4617
|
+
* Create and append the units element to the textbox element
|
4561
4618
|
*/
|
4562
|
-
|
4563
|
-
let
|
4564
|
-
if (
|
4565
|
-
|
4566
|
-
|
4567
|
-
|
4568
|
-
|
4569
|
-
|
4570
|
-
|
4571
|
-
|
4619
|
+
showUnits() {
|
4620
|
+
let inputWrapper = this.textboxEl.nativeElement.querySelector('.input-wrapper');
|
4621
|
+
if (inputWrapper) {
|
4622
|
+
if (this.leftUnits) {
|
4623
|
+
let unitsEl = this.textboxEl.nativeElement.querySelector('.units-left');
|
4624
|
+
if (unitsEl) {
|
4625
|
+
this.renderer.setProperty(unitsEl, 'innerHTML', this.leftUnits);
|
4626
|
+
}
|
4627
|
+
else {
|
4628
|
+
this.renderer.appendChild(inputWrapper, this.makeUnitElement('left', this.leftUnits));
|
4629
|
+
}
|
4630
|
+
this.positionLeftUnits();
|
4631
|
+
}
|
4632
|
+
if (this.rightUnits) {
|
4633
|
+
let unitsEl = this.textboxEl.nativeElement.querySelector('.units-right');
|
4634
|
+
if (unitsEl) {
|
4635
|
+
this.renderer.setProperty(unitsEl, 'innerHTML', this.rightUnits);
|
4636
|
+
}
|
4637
|
+
else {
|
4638
|
+
this.renderer.appendChild(inputWrapper, this.makeUnitElement('right', this.rightUnits));
|
4639
|
+
}
|
4640
|
+
this.positionRightUnits();
|
4641
|
+
}
|
4572
4642
|
}
|
4573
4643
|
}
|
4574
|
-
|
4575
|
-
this.
|
4576
|
-
this.
|
4577
|
-
this.
|
4578
|
-
this.
|
4579
|
-
|
4580
|
-
|
4581
|
-
const position = this.getPosition();
|
4582
|
-
const positionStrategy = this.overlay.position()
|
4583
|
-
.flexibleConnectedTo(this.elementRef)
|
4584
|
-
.withPositions([position]);
|
4585
|
-
const config = new OverlayConfig({
|
4586
|
-
positionStrategy: positionStrategy
|
4587
|
-
});
|
4588
|
-
return config;
|
4589
|
-
}
|
4590
|
-
getPosition() {
|
4591
|
-
const position = this.contentPosition.split('-');
|
4592
|
-
const overlayX = (position[1] == 'left' ? 'start' : 'end');
|
4593
|
-
const overlayY = position[0];
|
4594
|
-
return { originX: overlayX, originY: overlayY, overlayX: overlayX, overlayY: overlayY };
|
4644
|
+
makeUnitElement(side, text) {
|
4645
|
+
let unitsEl = this.renderer.createElement('span');
|
4646
|
+
this.renderer.setAttribute(unitsEl, 'class', `units units-${side}`);
|
4647
|
+
this.renderer.setAttribute(unitsEl, 'id', `${this.id}_units`);
|
4648
|
+
this.renderer.setAttribute(unitsEl, 'style', 'pointer-events: none');
|
4649
|
+
this.renderer.setProperty(unitsEl, 'innerHTML', text);
|
4650
|
+
return unitsEl;
|
4595
4651
|
}
|
4596
4652
|
}
|
4597
|
-
|
4598
|
-
|
4599
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type:
|
4653
|
+
NumericboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NumericboxComponent, deps: [{ token: ValidationMessageService }, { token: FormGroupHelper }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
4654
|
+
NumericboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: NumericboxComponent, selector: "ec-numericbox", inputs: { placeholder: "placeholder", decimals: "decimals", showPrecision: "showPrecision", maxPrecisionDigits: "maxPrecisionDigits", max: "max", min: "min", leftUnits: "leftUnits", rightUnits: "rightUnits", autoUpdateFormModel: "autoUpdateFormModel" }, viewQueries: [{ propertyName: "textboxEl", first: true, predicate: TextboxComponent, descendants: true, read: ElementRef, static: true }, { propertyName: "textboxInput", first: true, predicate: ["textbox"], descendants: true, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"control control-label-{{labelPosition}}\"\r\n [class.invalid]=\"formModel?.invalid && (formModel?.touched)\">\r\n\r\n <label *ngIf=\"label\">\r\n <span>{{label | translate}}</span>\r\n <span *ngIf=\"validationErrors.length && formModel?.touched && formModel?.invalid\"> {{validationErrors | translate}}</span>\r\n <ec-help-popover id=\"{{id}}_helpPopover\"\r\n *ngIf=\"helpPopover\"\r\n class=\"d-inline-block my-n3 mx-n1\"\r\n text=\"{{helpPopover | translate}}\"\r\n contentPosition=\"{{helpPopoverPosition}}\">\r\n </ec-help-popover>\r\n </label>\r\n\r\n <!-- Setting the maxlength to 13 to combat the user from entering too large of a number\r\n for javascript to support. If the user enters all 13 characters as numbers and we have showPrecision set, adding the\r\n decimal and the empty zero characters will get them in a situation where to edit it they must remove characters\r\n as we would push them past the limit -->\r\n <ec-textbox [id]=\"id\"\r\n #textbox\r\n class=\"control-input mb-0\"\r\n [placeholder]=\"placeholder\"\r\n [maxlength]=\"maxPrecisionDigits ? maxPrecisionDigits + 3 : 13\"\r\n [autofocus]=\"autofocus\"\r\n [formModel]=\"textboxFormModel\"\r\n [required]=\"required\"\r\n [tabindex]=\"tabindex\"\r\n [readonly]=\"readonly\"\r\n [tooltip]=\"tooltip\"\r\n (focusout)=\"onFocusOut()\">\r\n </ec-textbox>\r\n</div>", styles: [":host{color:var(--ec-form-control-color);font-size:var(--ec-form-control-font-size);display:block;margin-bottom:1rem;width:100%}:host :host-context(.form-condensed){margin-bottom:.5rem}:host .control{width:100%;display:flex;flex-direction:column}:host .control.control-label-bottom{flex-direction:column-reverse}:host .control.control-label-left{flex-direction:row}:host .control.control-label-left label{margin-right:.25rem}:host .control.control-label-right{flex-direction:row-reverse}:host .control.control-label-right label{margin-left:.25rem}:host .control.control-label-left,:host .control.control-label-right{align-items:center}:host .control.control-label-left label,:host .control.control-label-right label{flex:1 1;margin-top:0;margin-bottom:0}:host .control.control-label-left .control-input,:host .control.control-label-right .control-input{flex:2 2}:host .control.is-readonly input,:host .control.is-readonly select,:host .control.is-readonly textarea{border-color:var(--ec-form-control-border-color-readonly);background-color:var(--ec-form-control-background-color-readonly);background-clip:border-box;background-image:none;color:var(--ec-form-control-color-readonly);opacity:1;-webkit-user-select:none;user-select:none;pointer-events:none;overflow:hidden;white-space:nowrap}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid:focus,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid:focus{border-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-invalid{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-required,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-required{display:none}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button{background-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button:not(:focus){border-color:var(--ec-form-control-border-color-invalid)}:host .textbox-group{display:flex;position:relative}:host textarea:focus,:host input:focus,:host select:focus{outline:none}label{color:var(--ec-form-control-label-color, var(--ec-color-secondary-dark));display:block;font-size:var(--ec-font-size-label);line-height:1;margin:calc(var(--ec-font-size-label) / 2) 0}ec-textbox ::ng-deep .input-wrapper{position:relative}ec-textbox ::ng-deep input{text-align:right}ec-textbox ::ng-deep input:required.is-empty:not(:disabled)~.units-left{left:1.25rem}ec-textbox ::ng-deep input.ng-invalid.ng-touched~.units-left{left:1.25rem}ec-textbox ::ng-deep .control:not(.is-readonly) input:disabled~.units{color:var(--ec-form-control-color-disabled);opacity:.65}ec-textbox ::ng-deep .units{display:block;position:absolute;top:0;height:2rem;line-height:1.25rem;padding:.375rem .25rem;z-index:2}ec-textbox ::ng-deep .units.units-right{right:0;padding-right:.5rem}ec-textbox ::ng-deep .units.units-left{left:0;padding-left:.5rem}.control.invalid ec-textbox ::ng-deep input.ng-invalid,.control.invalid ec-textbox ::ng-deep input.ng-valid{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}.control.invalid ec-textbox ::ng-deep input.ng-invalid:focus,.control.invalid ec-textbox ::ng-deep input.ng-valid:focus{border-color:var(--ec-form-control-background-color-invalid)}.control.invalid ec-textbox ::ng-deep input.ng-invalid~.units-left,.control.invalid ec-textbox ::ng-deep input.ng-valid~.units-left{left:1.25rem}.control.invalid ec-textbox ::ng-deep input.ng-invalid~.icon-invalid,.control.invalid ec-textbox ::ng-deep input.ng-valid~.icon-invalid{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}.control.invalid ec-textbox ::ng-deep input.ng-invalid~.icon-required,.control.invalid ec-textbox ::ng-deep input.ng-valid~.icon-required{display:none}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: TextboxComponent, selector: "ec-textbox", inputs: ["autocomplete", "type", "placeholder", "maxlength", "minlength", "rows", "selectOnAutofocus", "upperCase"] }, { kind: "component", type: HelpPopoverComponent, selector: "ec-help-popover", inputs: ["id", "text", "contentPosition", "maxWidth"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] });
|
4655
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NumericboxComponent, decorators: [{
|
4600
4656
|
type: Component,
|
4601
|
-
args: [{ selector: 'ec-
|
4602
|
-
}], ctorParameters: function () { return [{ type:
|
4657
|
+
args: [{ selector: 'ec-numericbox', template: "<div class=\"control control-label-{{labelPosition}}\"\r\n [class.invalid]=\"formModel?.invalid && (formModel?.touched)\">\r\n\r\n <label *ngIf=\"label\">\r\n <span>{{label | translate}}</span>\r\n <span *ngIf=\"validationErrors.length && formModel?.touched && formModel?.invalid\"> {{validationErrors | translate}}</span>\r\n <ec-help-popover id=\"{{id}}_helpPopover\"\r\n *ngIf=\"helpPopover\"\r\n class=\"d-inline-block my-n3 mx-n1\"\r\n text=\"{{helpPopover | translate}}\"\r\n contentPosition=\"{{helpPopoverPosition}}\">\r\n </ec-help-popover>\r\n </label>\r\n\r\n <!-- Setting the maxlength to 13 to combat the user from entering too large of a number\r\n for javascript to support. If the user enters all 13 characters as numbers and we have showPrecision set, adding the\r\n decimal and the empty zero characters will get them in a situation where to edit it they must remove characters\r\n as we would push them past the limit -->\r\n <ec-textbox [id]=\"id\"\r\n #textbox\r\n class=\"control-input mb-0\"\r\n [placeholder]=\"placeholder\"\r\n [maxlength]=\"maxPrecisionDigits ? maxPrecisionDigits + 3 : 13\"\r\n [autofocus]=\"autofocus\"\r\n [formModel]=\"textboxFormModel\"\r\n [required]=\"required\"\r\n [tabindex]=\"tabindex\"\r\n [readonly]=\"readonly\"\r\n [tooltip]=\"tooltip\"\r\n (focusout)=\"onFocusOut()\">\r\n </ec-textbox>\r\n</div>", styles: [":host{color:var(--ec-form-control-color);font-size:var(--ec-form-control-font-size);display:block;margin-bottom:1rem;width:100%}:host :host-context(.form-condensed){margin-bottom:.5rem}:host .control{width:100%;display:flex;flex-direction:column}:host .control.control-label-bottom{flex-direction:column-reverse}:host .control.control-label-left{flex-direction:row}:host .control.control-label-left label{margin-right:.25rem}:host .control.control-label-right{flex-direction:row-reverse}:host .control.control-label-right label{margin-left:.25rem}:host .control.control-label-left,:host .control.control-label-right{align-items:center}:host .control.control-label-left label,:host .control.control-label-right label{flex:1 1;margin-top:0;margin-bottom:0}:host .control.control-label-left .control-input,:host .control.control-label-right .control-input{flex:2 2}:host .control.is-readonly input,:host .control.is-readonly select,:host .control.is-readonly textarea{border-color:var(--ec-form-control-border-color-readonly);background-color:var(--ec-form-control-background-color-readonly);background-clip:border-box;background-image:none;color:var(--ec-form-control-color-readonly);opacity:1;-webkit-user-select:none;user-select:none;pointer-events:none;overflow:hidden;white-space:nowrap}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid:focus,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid:focus{border-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-invalid{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-required,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-required{display:none}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button{background-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button:not(:focus){border-color:var(--ec-form-control-border-color-invalid)}:host .textbox-group{display:flex;position:relative}:host textarea:focus,:host input:focus,:host select:focus{outline:none}label{color:var(--ec-form-control-label-color, var(--ec-color-secondary-dark));display:block;font-size:var(--ec-font-size-label);line-height:1;margin:calc(var(--ec-font-size-label) / 2) 0}ec-textbox ::ng-deep .input-wrapper{position:relative}ec-textbox ::ng-deep input{text-align:right}ec-textbox ::ng-deep input:required.is-empty:not(:disabled)~.units-left{left:1.25rem}ec-textbox ::ng-deep input.ng-invalid.ng-touched~.units-left{left:1.25rem}ec-textbox ::ng-deep .control:not(.is-readonly) input:disabled~.units{color:var(--ec-form-control-color-disabled);opacity:.65}ec-textbox ::ng-deep .units{display:block;position:absolute;top:0;height:2rem;line-height:1.25rem;padding:.375rem .25rem;z-index:2}ec-textbox ::ng-deep .units.units-right{right:0;padding-right:.5rem}ec-textbox ::ng-deep .units.units-left{left:0;padding-left:.5rem}.control.invalid ec-textbox ::ng-deep input.ng-invalid,.control.invalid ec-textbox ::ng-deep input.ng-valid{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}.control.invalid ec-textbox ::ng-deep input.ng-invalid:focus,.control.invalid ec-textbox ::ng-deep input.ng-valid:focus{border-color:var(--ec-form-control-background-color-invalid)}.control.invalid ec-textbox ::ng-deep input.ng-invalid~.units-left,.control.invalid ec-textbox ::ng-deep input.ng-valid~.units-left{left:1.25rem}.control.invalid ec-textbox ::ng-deep input.ng-invalid~.icon-invalid,.control.invalid ec-textbox ::ng-deep input.ng-valid~.icon-invalid{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}.control.invalid ec-textbox ::ng-deep input.ng-invalid~.icon-required,.control.invalid ec-textbox ::ng-deep input.ng-valid~.icon-required{display:none}\n"] }]
|
4658
|
+
}], ctorParameters: function () { return [{ type: ValidationMessageService }, { type: FormGroupHelper }, { type: i0.Renderer2 }]; }, propDecorators: { placeholder: [{
|
4603
4659
|
type: Input
|
4604
|
-
}],
|
4660
|
+
}], decimals: [{
|
4605
4661
|
type: Input
|
4606
|
-
}],
|
4662
|
+
}], showPrecision: [{
|
4607
4663
|
type: Input
|
4608
|
-
}],
|
4664
|
+
}], maxPrecisionDigits: [{
|
4609
4665
|
type: Input
|
4610
|
-
}],
|
4666
|
+
}], max: [{
|
4611
4667
|
type: Input
|
4612
|
-
}],
|
4668
|
+
}], min: [{
|
4669
|
+
type: Input
|
4670
|
+
}], leftUnits: [{
|
4671
|
+
type: Input
|
4672
|
+
}], rightUnits: [{
|
4673
|
+
type: Input
|
4674
|
+
}], autoUpdateFormModel: [{
|
4675
|
+
type: Input
|
4676
|
+
}], textboxEl: [{
|
4613
4677
|
type: ViewChild,
|
4614
|
-
args: [
|
4615
|
-
}],
|
4616
|
-
type:
|
4617
|
-
args: ['
|
4618
|
-
}], onLeave: [{
|
4619
|
-
type: HostListener,
|
4620
|
-
args: ['mouseleave']
|
4678
|
+
args: [TextboxComponent, { read: ElementRef, static: true }]
|
4679
|
+
}], textboxInput: [{
|
4680
|
+
type: ViewChild,
|
4681
|
+
args: ['textbox', { static: true }]
|
4621
4682
|
}] } });
|
4622
4683
|
|
4623
4684
|
/**
|
@@ -4676,10 +4737,10 @@ class RadioButtonComponent extends FormControlBase {
|
|
4676
4737
|
}
|
4677
4738
|
}
|
4678
4739
|
RadioButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RadioButtonComponent, deps: [{ token: ValidationMessageService }, { token: FormGroupHelper }], target: i0.ɵɵFactoryTarget.Component });
|
4679
|
-
RadioButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: RadioButtonComponent, selector: "ec-radiobutton", inputs: { type: "type", options: "options", direction: "direction", name: "name" }, viewQueries: [{ propertyName: "inputElement", first: true, predicate: ["radioInput"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"control\"\r\n [class.control-label-bottom]=\"labelPosition === 'bottom'\">\r\n <label *ngIf=\"label\"\r\n ngPreserveWhitespaces>\r\n <span>{{label | translate}}</span>\r\n\r\n <span *ngIf=\"validationErrors.length > 0 && formModel.touched && formModel.invalid\">{{validationErrors | translate}}</span>\r\n </label>\r\n\r\n\r\n <div class=\"radio-group {{'toggle-options-' + options.length}}\"\r\n [ngClass]=\"currentClasses\"\r\n [class.is-disabled]=\"formModel.disabled\"\r\n [class.is-readonly]=\"readonly\">\r\n\r\n <!-- RadioButton type=\"toggle\"-->\r\n <!-- There are two ng-templates here due to the fact you can't have ngIf and ngFor on the same element -->\r\n <ng-container *ngIf=\"type === 'toggle'\">\r\n <ng-container *ngFor=\"let option of options; index as i; first as isFirst\">\r\n <!-- The input has two name attributes set, one is for the form model and one is for the broswer. With one set\r\n the tabbing did not work, and with the other the controls were all linked together. They both need set\r\n for the best of both worlds -->\r\n <input [attr.id]=\"inputId + i.toString()\"\r\n [formControl]=\"formModel\"\r\n type=\"radio\"\r\n tabindex=\"{{tabindex}}\"\r\n [value]=\"option.value\"\r\n #radioInput\r\n name=\"{{name}}\"\r\n attr.name=\"{{name}}\"\r\n [attr.cdkFocusInitial]=\"(autofocus && isFirst) || null\">\r\n <label [attr.for]=\"inputId + i.toString()\"\r\n title=\"{{ option.tooltip | translate}}\">\r\n <i class=\"ec-icon {{option.icon}}\" *ngIf=\"option.icon\"></i>\r\n <span id=\"{{inputId}}_label{{i.toString()}}\" *ngIf=\"option.label\">{{option.label | translate}}</span>\r\n </label>\r\n </ng-container>\r\n <a>\r\n <div class=\"toggle-handle\"></div>\r\n </a>\r\n <div class=\"toggle-focused\"></div>\r\n </ng-container>\r\n\r\n <!-- RadioButton type=\"radio\"-->\r\n <!-- There are two ng-templates here due to the fact you can't have ngIf and ngFor on the same element -->\r\n <ng-container *ngIf=\"type === 'radio'\">\r\n <ng-container *ngFor=\"let option of options; index as i; first as isFirst\">\r\n <label class='radio-button'\r\n title=\"{{ option.tooltip | translate}}\">\r\n <!-- The input has two name attributes set, one is for the form model and one is for the broswer. With one set\r\n the tabbing did not work, and with the other the controls were all linked together. They both need set\r\n for the best of both worlds -->\r\n <input [attr.id]=\"inputId + i.toString()\"\r\n class=\"input\"\r\n [formControl]=\"formModel\"\r\n type=\"radio\"\r\n value=\"{{option.value}}\"\r\n #radioInput\r\n tabindex=\"{{tabindex}}\"\r\n name=\"{{name}}\"\r\n attr.name=\"{{name}}\"\r\n [attr.cdkFocusInitial]=\"(autofocus && isFirst) || null\">\r\n <span class=\"indicator\"></span>\r\n <span id=\"{{inputId}}_label{{i.toString()}}\"\r\n class=\"label\"\r\n *ngIf=\"option.label\"\r\n [innerHtml]=\"option.label | translate\"></span>\r\n </label>\r\n </ng-container>\r\n </ng-container>\r\n\r\n </div>\r\n\r\n</div>\r\n", styles: [":host{color:var(--ec-form-control-color);font-size:var(--ec-form-control-font-size);display:block;margin-bottom:1rem;width:100%}:host :host-context(.form-condensed){margin-bottom:.5rem}:host .control{width:100%;display:flex;flex-direction:column}:host .control.control-label-bottom{flex-direction:column-reverse}:host .control.control-label-left{flex-direction:row}:host .control.control-label-left label{margin-right:.25rem}:host .control.control-label-right{flex-direction:row-reverse}:host .control.control-label-right label{margin-left:.25rem}:host .control.control-label-left,:host .control.control-label-right{align-items:center}:host .control.control-label-left label,:host .control.control-label-right label{flex:1 1;margin-top:0;margin-bottom:0}:host .control.control-label-left .control-input,:host .control.control-label-right .control-input{flex:2 2}:host .control.is-readonly input,:host .control.is-readonly select,:host .control.is-readonly textarea{border-color:var(--ec-form-control-border-color-readonly);background-color:var(--ec-form-control-background-color-readonly);background-clip:border-box;background-image:none;color:var(--ec-form-control-color-readonly);opacity:1;-webkit-user-select:none;user-select:none;pointer-events:none;overflow:hidden;white-space:nowrap}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid:focus,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid:focus{border-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-invalid{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-required,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-required{display:none}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button{background-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button:not(:focus){border-color:var(--ec-form-control-border-color-invalid)}:host .textbox-group{display:flex;position:relative}:host textarea:focus,:host input:focus,:host select:focus{outline:none}:host(.w-auto){width:auto}.control>label{color:var(--ec-form-control-label-color, var(--ec-color-secondary-dark));display:block;font-size:var(--ec-font-size-label);line-height:1;margin:calc(var(--ec-font-size-label) / 2) 0}.radio-group{display:flex;flex-wrap:wrap}.radio-group-column{flex-direction:column}.radio-group-column .radio-button{margin-right:auto}.radio-group.is-disabled .radio-button{cursor:default}.radio-group.is-readonly .radio-button{pointer-events:none}.radio-group.is-readonly .radio-button .input{opacity:0}.radio-group.is-readonly .radio-button .indicator{background-color:var(--ec-form-control-background-color-readonly);border-color:var(--ec-form-control-border-color-readonly)}.radio-group.is-readonly .radio-button .label,.radio-group.is-readonly .radio-button .indicator{opacity:1;color:var(--ec-form-control-color)}.radio-group.is-readonly.radio-group-toggle{border-color:var(--ec-form-control-border-color-readonly);background-color:var(--ec-form-control-background-color-readonly);background-clip:border-box;background-image:none;color:var(--ec-form-control-color-readonly);opacity:1;-webkit-user-select:none;user-select:none;pointer-events:none;overflow:hidden;white-space:nowrap}.radio-group.is-readonly.radio-group-toggle a,.radio-group.is-readonly.radio-group-toggle input:not(:checked),.radio-group.is-readonly.radio-group-toggle input:not(:checked)+label{display:none}.radio-group.is-readonly.radio-group-toggle input:checked+label{color:inherit;justify-content:flex-start}.radio-button{cursor:pointer;display:inline-flex;margin-bottom:0;position:relative}.radio-button:not(:last-child){margin-right:1rem}.input{margin-top:.5rem;opacity:0;position:absolute;z-index:-1}.input:not(:checked)+.indicator{color:var(--ec-form-control-border-color)}.input:not(:checked)+.indicator:before{display:none}.input:focus+.indicator{color:var(--ec-color-interactive);box-shadow:var(--ec-form-control-box-shadow-focus);border-color:var(--ec-form-control-border-color-focus)}.input:disabled+.indicator{color:var(--ec-form-control-color-disabled);background-color:var(--ec-form-control-background-color-disabled);border-color:var(--ec-form-control-border-color-disabled);opacity:var(--ec-form-control-opacity-disabled)}.input:disabled~.label{color:var(--ec-form-control-color-disabled);opacity:var(--ec-form-control-opacity-disabled)}.indicator{background-color:var(--ec-form-control-background-color);background-clip:padding-box;border:1px solid currentColor;color:var(--ec-color-interactive);margin-top:.5rem;flex:none;pointer-events:none;display:inline-flex;align-items:center;justify-content:center;height:1em;width:1em;border-radius:50%}.indicator:before{background-color:currentColor;content:\"\";display:block;width:.5em;height:.5em;border-radius:50%}.label{line-height:1.25rem;padding:.375rem 0;margin-left:.5rem;min-height:2rem;height:auto}.radio-group-toggle{font-size:var(--ec-form-control-font-size);background-color:var(--ec-border-color);border-radius:var(--ec-border-radius);border:1px solid var(--ec-border-color);min-height:2em;position:relative;color:var(--ec-color-secondary-dark);display:flex}.radio-group-toggle input{position:absolute;z-index:-1;opacity:0}.radio-group-toggle input:checked+label{color:var(--ec-color-interactive)}.radio-group-toggle input:checked:last-of-type~a{transform:translate(100%)}.radio-group-toggle input:focus~.toggle-focused{display:block}.radio-group-toggle .toggle-focused{position:absolute;inset:0;box-shadow:var(--ec-form-control-box-shadow-focus);border-radius:var(--ec-form-control-border-radius);display:none}.radio-group-toggle label{align-items:center;cursor:pointer;display:flex;flex:1 1 0%;justify-content:center;line-height:1.1em;margin-bottom:0;padding:.375rem .5rem;position:relative;text-align:center;transition:color .3s ease;z-index:2}.radio-group-toggle label .ec-icon{color:inherit}.radio-group-toggle a{border:.1875rem solid transparent;border-radius:calc(var(--ec-form-control-border-radius) * .75);display:block;height:100%;left:0;position:absolute;top:0;transition:transform .25s ease;width:50%;z-index:1}.radio-group-toggle a .toggle-handle{background-color:var(--ec-form-control-background-color);border-radius:calc(var(--ec-form-control-border-radius) * .75);height:100%}.radio-group-toggle.is-disabled{opacity:var(--ec-form-control-opacity-disabled);color:var(--ec-form-control-color-disabled)}.radio-group-toggle.is-disabled label{color:inherit!important;cursor:default}.toggle-options-3 a{width:33.3333333333%}.toggle-options-3 input:checked:last-of-type~a{transform:translate(200%)}.toggle-options-3 input:checked:nth-of-type(2)~a{transform:translate(100%)}.toggle-options-4 a{width:25%}.toggle-options-4 input:checked:last-of-type~a{transform:translate(300%)}.toggle-options-4 input:checked:nth-of-type(3)~a{transform:translate(200%)}.toggle-options-4 input:checked:nth-of-type(2)~a{transform:translate(100%)}.toggle-options-5 a{width:20%}.toggle-options-5 input:checked:last-of-type~a{transform:translate(400%)}.toggle-options-5 input:checked:nth-of-type(4)~a{transform:translate(300%)}.toggle-options-5 input:checked:nth-of-type(3)~a{transform:translate(200%)}.toggle-options-5 input:checked:nth-of-type(2)~a{transform:translate(100%)}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] });
|
4740
|
+
RadioButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: RadioButtonComponent, selector: "ec-radiobutton", inputs: { type: "type", options: "options", direction: "direction", name: "name" }, viewQueries: [{ propertyName: "inputElement", first: true, predicate: ["radioInput"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"control\"\r\n [class.control-label-bottom]=\"labelPosition === 'bottom'\">\r\n\r\n <label *ngIf=\"label\">\r\n <span>{{label | translate}}</span>\r\n <span *ngIf=\"validationErrors.length > 0 && formModel.touched && formModel.invalid\"> {{validationErrors | translate}}</span>\r\n <ec-help-popover id=\"{{id}}_helpPopover\"\r\n *ngIf=\"helpPopover\"\r\n class=\"d-inline-block my-n3 mx-n1\"\r\n text=\"{{helpPopover | translate}}\"\r\n contentPosition=\"{{helpPopoverPosition}}\">\r\n </ec-help-popover>\r\n </label>\r\n \r\n <div class=\"radio-group {{'toggle-options-' + options.length}}\"\r\n [ngClass]=\"currentClasses\"\r\n [class.is-disabled]=\"formModel.disabled\"\r\n [class.is-readonly]=\"readonly\">\r\n\r\n <!-- RadioButton type=\"toggle\"-->\r\n <!-- There are two ng-templates here due to the fact you can't have ngIf and ngFor on the same element -->\r\n <ng-container *ngIf=\"type === 'toggle'\">\r\n <ng-container *ngFor=\"let option of options; index as i; first as isFirst\">\r\n <!-- The input has two name attributes set, one is for the form model and one is for the broswer. With one set\r\n the tabbing did not work, and with the other the controls were all linked together. They both need set\r\n for the best of both worlds -->\r\n <input [attr.id]=\"inputId + i.toString()\"\r\n [formControl]=\"formModel\"\r\n type=\"radio\"\r\n tabindex=\"{{tabindex}}\"\r\n [value]=\"option.value\"\r\n #radioInput\r\n name=\"{{name}}\"\r\n attr.name=\"{{name}}\"\r\n [attr.cdkFocusInitial]=\"(autofocus && isFirst) || null\">\r\n <label [attr.for]=\"inputId + i.toString()\"\r\n title=\"{{ option.tooltip | translate}}\">\r\n <i class=\"ec-icon {{option.icon}}\"\r\n *ngIf=\"option.icon\"></i>\r\n <span id=\"{{inputId}}_label{{i.toString()}}\"\r\n *ngIf=\"option.label\">{{option.label | translate}}</span>\r\n </label>\r\n </ng-container>\r\n <a>\r\n <div class=\"toggle-handle\"></div>\r\n </a>\r\n <div class=\"toggle-focused\"></div>\r\n </ng-container>\r\n\r\n <!-- RadioButton type=\"radio\"-->\r\n <!-- There are two ng-templates here due to the fact you can't have ngIf and ngFor on the same element -->\r\n <ng-container *ngIf=\"type === 'radio'\">\r\n <ng-container *ngFor=\"let option of options; index as i; first as isFirst\">\r\n <label class='radio-button'\r\n title=\"{{ option.tooltip | translate}}\">\r\n <!-- The input has two name attributes set, one is for the form model and one is for the broswer. With one set\r\n the tabbing did not work, and with the other the controls were all linked together. They both need set\r\n for the best of both worlds -->\r\n <input [attr.id]=\"inputId + i.toString()\"\r\n class=\"input\"\r\n [formControl]=\"formModel\"\r\n type=\"radio\"\r\n value=\"{{option.value}}\"\r\n #radioInput\r\n tabindex=\"{{tabindex}}\"\r\n name=\"{{name}}\"\r\n attr.name=\"{{name}}\"\r\n [attr.cdkFocusInitial]=\"(autofocus && isFirst) || null\">\r\n <span class=\"indicator\"></span>\r\n <span id=\"{{inputId}}_label{{i.toString()}}\"\r\n class=\"label\"\r\n *ngIf=\"option.label\"\r\n [innerHtml]=\"option.label | translate\"></span>\r\n </label>\r\n </ng-container>\r\n </ng-container>\r\n\r\n </div>\r\n\r\n</div>", styles: [":host{color:var(--ec-form-control-color);font-size:var(--ec-form-control-font-size);display:block;margin-bottom:1rem;width:100%}:host :host-context(.form-condensed){margin-bottom:.5rem}:host .control{width:100%;display:flex;flex-direction:column}:host .control.control-label-bottom{flex-direction:column-reverse}:host .control.control-label-left{flex-direction:row}:host .control.control-label-left label{margin-right:.25rem}:host .control.control-label-right{flex-direction:row-reverse}:host .control.control-label-right label{margin-left:.25rem}:host .control.control-label-left,:host .control.control-label-right{align-items:center}:host .control.control-label-left label,:host .control.control-label-right label{flex:1 1;margin-top:0;margin-bottom:0}:host .control.control-label-left .control-input,:host .control.control-label-right .control-input{flex:2 2}:host .control.is-readonly input,:host .control.is-readonly select,:host .control.is-readonly textarea{border-color:var(--ec-form-control-border-color-readonly);background-color:var(--ec-form-control-background-color-readonly);background-clip:border-box;background-image:none;color:var(--ec-form-control-color-readonly);opacity:1;-webkit-user-select:none;user-select:none;pointer-events:none;overflow:hidden;white-space:nowrap}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid:focus,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid:focus{border-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-invalid{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-required,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-required{display:none}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button{background-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button:not(:focus){border-color:var(--ec-form-control-border-color-invalid)}:host .textbox-group{display:flex;position:relative}:host textarea:focus,:host input:focus,:host select:focus{outline:none}:host(.w-auto){width:auto}.control>label{color:var(--ec-form-control-label-color, var(--ec-color-secondary-dark));display:block;font-size:var(--ec-font-size-label);line-height:1;margin:calc(var(--ec-font-size-label) / 2) 0}.radio-group{display:flex;flex-wrap:wrap}.radio-group-column{flex-direction:column}.radio-group-column .radio-button{margin-right:auto}.radio-group.is-disabled .radio-button{cursor:default}.radio-group.is-readonly .radio-button{pointer-events:none}.radio-group.is-readonly .radio-button .input{opacity:0}.radio-group.is-readonly .radio-button .indicator{background-color:var(--ec-form-control-background-color-readonly);border-color:var(--ec-form-control-border-color-readonly)}.radio-group.is-readonly .radio-button .label,.radio-group.is-readonly .radio-button .indicator{opacity:1;color:var(--ec-form-control-color)}.radio-group.is-readonly.radio-group-toggle{border-color:var(--ec-form-control-border-color-readonly);background-color:var(--ec-form-control-background-color-readonly);background-clip:border-box;background-image:none;color:var(--ec-form-control-color-readonly);opacity:1;-webkit-user-select:none;user-select:none;pointer-events:none;overflow:hidden;white-space:nowrap}.radio-group.is-readonly.radio-group-toggle a,.radio-group.is-readonly.radio-group-toggle input:not(:checked),.radio-group.is-readonly.radio-group-toggle input:not(:checked)+label{display:none}.radio-group.is-readonly.radio-group-toggle input:checked+label{color:inherit;justify-content:flex-start}.radio-button{cursor:pointer;display:inline-flex;margin-bottom:0;position:relative}.radio-button:not(:last-child){margin-right:1rem}.input{margin-top:.5rem;opacity:0;position:absolute;z-index:-1}.input:not(:checked)+.indicator{color:var(--ec-form-control-border-color)}.input:not(:checked)+.indicator:before{display:none}.input:focus+.indicator{color:var(--ec-color-interactive);box-shadow:var(--ec-form-control-box-shadow-focus);border-color:var(--ec-form-control-border-color-focus)}.input:disabled+.indicator{color:var(--ec-form-control-color-disabled);background-color:var(--ec-form-control-background-color-disabled);border-color:var(--ec-form-control-border-color-disabled);opacity:var(--ec-form-control-opacity-disabled)}.input:disabled~.label{color:var(--ec-form-control-color-disabled);opacity:var(--ec-form-control-opacity-disabled)}.indicator{background-color:var(--ec-form-control-background-color);background-clip:padding-box;border:1px solid currentColor;color:var(--ec-color-interactive);margin-top:.5rem;flex:none;pointer-events:none;display:inline-flex;align-items:center;justify-content:center;height:1em;width:1em;border-radius:50%}.indicator:before{background-color:currentColor;content:\"\";display:block;width:.5em;height:.5em;border-radius:50%}.label{line-height:1.25rem;padding:.375rem 0;margin-left:.5rem;min-height:2rem;height:auto}.radio-group-toggle{font-size:var(--ec-form-control-font-size);background-color:var(--ec-border-color);border-radius:var(--ec-border-radius);border:1px solid var(--ec-border-color);min-height:2em;position:relative;color:var(--ec-color-secondary-dark);display:flex}.radio-group-toggle input{position:absolute;z-index:-1;opacity:0}.radio-group-toggle input:checked+label{color:var(--ec-color-interactive)}.radio-group-toggle input:checked:last-of-type~a{transform:translate(100%)}.radio-group-toggle input:focus~.toggle-focused{display:block}.radio-group-toggle .toggle-focused{position:absolute;inset:0;box-shadow:var(--ec-form-control-box-shadow-focus);border-radius:var(--ec-form-control-border-radius);display:none}.radio-group-toggle label{align-items:center;cursor:pointer;display:flex;flex:1 1 0%;justify-content:center;line-height:1.1em;margin-bottom:0;padding:.375rem .5rem;position:relative;text-align:center;transition:color .3s ease;z-index:2}.radio-group-toggle label .ec-icon{color:inherit}.radio-group-toggle a{border:.1875rem solid transparent;border-radius:calc(var(--ec-form-control-border-radius) * .75);display:block;height:100%;left:0;position:absolute;top:0;transition:transform .25s ease;width:50%;z-index:1}.radio-group-toggle a .toggle-handle{background-color:var(--ec-form-control-background-color);border-radius:calc(var(--ec-form-control-border-radius) * .75);height:100%}.radio-group-toggle.is-disabled{opacity:var(--ec-form-control-opacity-disabled);color:var(--ec-form-control-color-disabled)}.radio-group-toggle.is-disabled label{color:inherit!important;cursor:default}.toggle-options-3 a{width:33.3333333333%}.toggle-options-3 input:checked:last-of-type~a{transform:translate(200%)}.toggle-options-3 input:checked:nth-of-type(2)~a{transform:translate(100%)}.toggle-options-4 a{width:25%}.toggle-options-4 input:checked:last-of-type~a{transform:translate(300%)}.toggle-options-4 input:checked:nth-of-type(3)~a{transform:translate(200%)}.toggle-options-4 input:checked:nth-of-type(2)~a{transform:translate(100%)}.toggle-options-5 a{width:20%}.toggle-options-5 input:checked:last-of-type~a{transform:translate(400%)}.toggle-options-5 input:checked:nth-of-type(4)~a{transform:translate(300%)}.toggle-options-5 input:checked:nth-of-type(3)~a{transform:translate(200%)}.toggle-options-5 input:checked:nth-of-type(2)~a{transform:translate(100%)}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: HelpPopoverComponent, selector: "ec-help-popover", inputs: ["id", "text", "contentPosition", "maxWidth"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] });
|
4680
4741
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RadioButtonComponent, decorators: [{
|
4681
4742
|
type: Component,
|
4682
|
-
args: [{ selector: 'ec-radiobutton', template: "<div class=\"control\"\r\n [class.control-label-bottom]=\"labelPosition === 'bottom'\">\r\n <label *ngIf=\"label\"\r\n ngPreserveWhitespaces>\r\n <span>{{label | translate}}</span>\r\n\r\n <span *ngIf=\"validationErrors.length > 0 && formModel.touched && formModel.invalid\">{{validationErrors | translate}}</span>\r\n </label>\r\n\r\n\r\n <div class=\"radio-group {{'toggle-options-' + options.length}}\"\r\n [ngClass]=\"currentClasses\"\r\n [class.is-disabled]=\"formModel.disabled\"\r\n [class.is-readonly]=\"readonly\">\r\n\r\n <!-- RadioButton type=\"toggle\"-->\r\n <!-- There are two ng-templates here due to the fact you can't have ngIf and ngFor on the same element -->\r\n <ng-container *ngIf=\"type === 'toggle'\">\r\n <ng-container *ngFor=\"let option of options; index as i; first as isFirst\">\r\n <!-- The input has two name attributes set, one is for the form model and one is for the broswer. With one set\r\n the tabbing did not work, and with the other the controls were all linked together. They both need set\r\n for the best of both worlds -->\r\n <input [attr.id]=\"inputId + i.toString()\"\r\n [formControl]=\"formModel\"\r\n type=\"radio\"\r\n tabindex=\"{{tabindex}}\"\r\n [value]=\"option.value\"\r\n #radioInput\r\n name=\"{{name}}\"\r\n attr.name=\"{{name}}\"\r\n [attr.cdkFocusInitial]=\"(autofocus && isFirst) || null\">\r\n <label [attr.for]=\"inputId + i.toString()\"\r\n title=\"{{ option.tooltip | translate}}\">\r\n <i class=\"ec-icon {{option.icon}}\" *ngIf=\"option.icon\"></i>\r\n <span id=\"{{inputId}}_label{{i.toString()}}\" *ngIf=\"option.label\">{{option.label | translate}}</span>\r\n </label>\r\n </ng-container>\r\n <a>\r\n <div class=\"toggle-handle\"></div>\r\n </a>\r\n <div class=\"toggle-focused\"></div>\r\n </ng-container>\r\n\r\n <!-- RadioButton type=\"radio\"-->\r\n <!-- There are two ng-templates here due to the fact you can't have ngIf and ngFor on the same element -->\r\n <ng-container *ngIf=\"type === 'radio'\">\r\n <ng-container *ngFor=\"let option of options; index as i; first as isFirst\">\r\n <label class='radio-button'\r\n title=\"{{ option.tooltip | translate}}\">\r\n <!-- The input has two name attributes set, one is for the form model and one is for the broswer. With one set\r\n the tabbing did not work, and with the other the controls were all linked together. They both need set\r\n for the best of both worlds -->\r\n <input [attr.id]=\"inputId + i.toString()\"\r\n class=\"input\"\r\n [formControl]=\"formModel\"\r\n type=\"radio\"\r\n value=\"{{option.value}}\"\r\n #radioInput\r\n tabindex=\"{{tabindex}}\"\r\n name=\"{{name}}\"\r\n attr.name=\"{{name}}\"\r\n [attr.cdkFocusInitial]=\"(autofocus && isFirst) || null\">\r\n <span class=\"indicator\"></span>\r\n <span id=\"{{inputId}}_label{{i.toString()}}\"\r\n class=\"label\"\r\n *ngIf=\"option.label\"\r\n [innerHtml]=\"option.label | translate\"></span>\r\n </label>\r\n </ng-container>\r\n </ng-container>\r\n\r\n </div>\r\n\r\n</div>\r\n", styles: [":host{color:var(--ec-form-control-color);font-size:var(--ec-form-control-font-size);display:block;margin-bottom:1rem;width:100%}:host :host-context(.form-condensed){margin-bottom:.5rem}:host .control{width:100%;display:flex;flex-direction:column}:host .control.control-label-bottom{flex-direction:column-reverse}:host .control.control-label-left{flex-direction:row}:host .control.control-label-left label{margin-right:.25rem}:host .control.control-label-right{flex-direction:row-reverse}:host .control.control-label-right label{margin-left:.25rem}:host .control.control-label-left,:host .control.control-label-right{align-items:center}:host .control.control-label-left label,:host .control.control-label-right label{flex:1 1;margin-top:0;margin-bottom:0}:host .control.control-label-left .control-input,:host .control.control-label-right .control-input{flex:2 2}:host .control.is-readonly input,:host .control.is-readonly select,:host .control.is-readonly textarea{border-color:var(--ec-form-control-border-color-readonly);background-color:var(--ec-form-control-background-color-readonly);background-clip:border-box;background-image:none;color:var(--ec-form-control-color-readonly);opacity:1;-webkit-user-select:none;user-select:none;pointer-events:none;overflow:hidden;white-space:nowrap}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid:focus,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid:focus{border-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-invalid{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-required,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-required{display:none}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button{background-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button:not(:focus){border-color:var(--ec-form-control-border-color-invalid)}:host .textbox-group{display:flex;position:relative}:host textarea:focus,:host input:focus,:host select:focus{outline:none}:host(.w-auto){width:auto}.control>label{color:var(--ec-form-control-label-color, var(--ec-color-secondary-dark));display:block;font-size:var(--ec-font-size-label);line-height:1;margin:calc(var(--ec-font-size-label) / 2) 0}.radio-group{display:flex;flex-wrap:wrap}.radio-group-column{flex-direction:column}.radio-group-column .radio-button{margin-right:auto}.radio-group.is-disabled .radio-button{cursor:default}.radio-group.is-readonly .radio-button{pointer-events:none}.radio-group.is-readonly .radio-button .input{opacity:0}.radio-group.is-readonly .radio-button .indicator{background-color:var(--ec-form-control-background-color-readonly);border-color:var(--ec-form-control-border-color-readonly)}.radio-group.is-readonly .radio-button .label,.radio-group.is-readonly .radio-button .indicator{opacity:1;color:var(--ec-form-control-color)}.radio-group.is-readonly.radio-group-toggle{border-color:var(--ec-form-control-border-color-readonly);background-color:var(--ec-form-control-background-color-readonly);background-clip:border-box;background-image:none;color:var(--ec-form-control-color-readonly);opacity:1;-webkit-user-select:none;user-select:none;pointer-events:none;overflow:hidden;white-space:nowrap}.radio-group.is-readonly.radio-group-toggle a,.radio-group.is-readonly.radio-group-toggle input:not(:checked),.radio-group.is-readonly.radio-group-toggle input:not(:checked)+label{display:none}.radio-group.is-readonly.radio-group-toggle input:checked+label{color:inherit;justify-content:flex-start}.radio-button{cursor:pointer;display:inline-flex;margin-bottom:0;position:relative}.radio-button:not(:last-child){margin-right:1rem}.input{margin-top:.5rem;opacity:0;position:absolute;z-index:-1}.input:not(:checked)+.indicator{color:var(--ec-form-control-border-color)}.input:not(:checked)+.indicator:before{display:none}.input:focus+.indicator{color:var(--ec-color-interactive);box-shadow:var(--ec-form-control-box-shadow-focus);border-color:var(--ec-form-control-border-color-focus)}.input:disabled+.indicator{color:var(--ec-form-control-color-disabled);background-color:var(--ec-form-control-background-color-disabled);border-color:var(--ec-form-control-border-color-disabled);opacity:var(--ec-form-control-opacity-disabled)}.input:disabled~.label{color:var(--ec-form-control-color-disabled);opacity:var(--ec-form-control-opacity-disabled)}.indicator{background-color:var(--ec-form-control-background-color);background-clip:padding-box;border:1px solid currentColor;color:var(--ec-color-interactive);margin-top:.5rem;flex:none;pointer-events:none;display:inline-flex;align-items:center;justify-content:center;height:1em;width:1em;border-radius:50%}.indicator:before{background-color:currentColor;content:\"\";display:block;width:.5em;height:.5em;border-radius:50%}.label{line-height:1.25rem;padding:.375rem 0;margin-left:.5rem;min-height:2rem;height:auto}.radio-group-toggle{font-size:var(--ec-form-control-font-size);background-color:var(--ec-border-color);border-radius:var(--ec-border-radius);border:1px solid var(--ec-border-color);min-height:2em;position:relative;color:var(--ec-color-secondary-dark);display:flex}.radio-group-toggle input{position:absolute;z-index:-1;opacity:0}.radio-group-toggle input:checked+label{color:var(--ec-color-interactive)}.radio-group-toggle input:checked:last-of-type~a{transform:translate(100%)}.radio-group-toggle input:focus~.toggle-focused{display:block}.radio-group-toggle .toggle-focused{position:absolute;inset:0;box-shadow:var(--ec-form-control-box-shadow-focus);border-radius:var(--ec-form-control-border-radius);display:none}.radio-group-toggle label{align-items:center;cursor:pointer;display:flex;flex:1 1 0%;justify-content:center;line-height:1.1em;margin-bottom:0;padding:.375rem .5rem;position:relative;text-align:center;transition:color .3s ease;z-index:2}.radio-group-toggle label .ec-icon{color:inherit}.radio-group-toggle a{border:.1875rem solid transparent;border-radius:calc(var(--ec-form-control-border-radius) * .75);display:block;height:100%;left:0;position:absolute;top:0;transition:transform .25s ease;width:50%;z-index:1}.radio-group-toggle a .toggle-handle{background-color:var(--ec-form-control-background-color);border-radius:calc(var(--ec-form-control-border-radius) * .75);height:100%}.radio-group-toggle.is-disabled{opacity:var(--ec-form-control-opacity-disabled);color:var(--ec-form-control-color-disabled)}.radio-group-toggle.is-disabled label{color:inherit!important;cursor:default}.toggle-options-3 a{width:33.3333333333%}.toggle-options-3 input:checked:last-of-type~a{transform:translate(200%)}.toggle-options-3 input:checked:nth-of-type(2)~a{transform:translate(100%)}.toggle-options-4 a{width:25%}.toggle-options-4 input:checked:last-of-type~a{transform:translate(300%)}.toggle-options-4 input:checked:nth-of-type(3)~a{transform:translate(200%)}.toggle-options-4 input:checked:nth-of-type(2)~a{transform:translate(100%)}.toggle-options-5 a{width:20%}.toggle-options-5 input:checked:last-of-type~a{transform:translate(400%)}.toggle-options-5 input:checked:nth-of-type(4)~a{transform:translate(300%)}.toggle-options-5 input:checked:nth-of-type(3)~a{transform:translate(200%)}.toggle-options-5 input:checked:nth-of-type(2)~a{transform:translate(100%)}\n"] }]
|
4743
|
+
args: [{ selector: 'ec-radiobutton', template: "<div class=\"control\"\r\n [class.control-label-bottom]=\"labelPosition === 'bottom'\">\r\n\r\n <label *ngIf=\"label\">\r\n <span>{{label | translate}}</span>\r\n <span *ngIf=\"validationErrors.length > 0 && formModel.touched && formModel.invalid\"> {{validationErrors | translate}}</span>\r\n <ec-help-popover id=\"{{id}}_helpPopover\"\r\n *ngIf=\"helpPopover\"\r\n class=\"d-inline-block my-n3 mx-n1\"\r\n text=\"{{helpPopover | translate}}\"\r\n contentPosition=\"{{helpPopoverPosition}}\">\r\n </ec-help-popover>\r\n </label>\r\n \r\n <div class=\"radio-group {{'toggle-options-' + options.length}}\"\r\n [ngClass]=\"currentClasses\"\r\n [class.is-disabled]=\"formModel.disabled\"\r\n [class.is-readonly]=\"readonly\">\r\n\r\n <!-- RadioButton type=\"toggle\"-->\r\n <!-- There are two ng-templates here due to the fact you can't have ngIf and ngFor on the same element -->\r\n <ng-container *ngIf=\"type === 'toggle'\">\r\n <ng-container *ngFor=\"let option of options; index as i; first as isFirst\">\r\n <!-- The input has two name attributes set, one is for the form model and one is for the broswer. With one set\r\n the tabbing did not work, and with the other the controls were all linked together. They both need set\r\n for the best of both worlds -->\r\n <input [attr.id]=\"inputId + i.toString()\"\r\n [formControl]=\"formModel\"\r\n type=\"radio\"\r\n tabindex=\"{{tabindex}}\"\r\n [value]=\"option.value\"\r\n #radioInput\r\n name=\"{{name}}\"\r\n attr.name=\"{{name}}\"\r\n [attr.cdkFocusInitial]=\"(autofocus && isFirst) || null\">\r\n <label [attr.for]=\"inputId + i.toString()\"\r\n title=\"{{ option.tooltip | translate}}\">\r\n <i class=\"ec-icon {{option.icon}}\"\r\n *ngIf=\"option.icon\"></i>\r\n <span id=\"{{inputId}}_label{{i.toString()}}\"\r\n *ngIf=\"option.label\">{{option.label | translate}}</span>\r\n </label>\r\n </ng-container>\r\n <a>\r\n <div class=\"toggle-handle\"></div>\r\n </a>\r\n <div class=\"toggle-focused\"></div>\r\n </ng-container>\r\n\r\n <!-- RadioButton type=\"radio\"-->\r\n <!-- There are two ng-templates here due to the fact you can't have ngIf and ngFor on the same element -->\r\n <ng-container *ngIf=\"type === 'radio'\">\r\n <ng-container *ngFor=\"let option of options; index as i; first as isFirst\">\r\n <label class='radio-button'\r\n title=\"{{ option.tooltip | translate}}\">\r\n <!-- The input has two name attributes set, one is for the form model and one is for the broswer. With one set\r\n the tabbing did not work, and with the other the controls were all linked together. They both need set\r\n for the best of both worlds -->\r\n <input [attr.id]=\"inputId + i.toString()\"\r\n class=\"input\"\r\n [formControl]=\"formModel\"\r\n type=\"radio\"\r\n value=\"{{option.value}}\"\r\n #radioInput\r\n tabindex=\"{{tabindex}}\"\r\n name=\"{{name}}\"\r\n attr.name=\"{{name}}\"\r\n [attr.cdkFocusInitial]=\"(autofocus && isFirst) || null\">\r\n <span class=\"indicator\"></span>\r\n <span id=\"{{inputId}}_label{{i.toString()}}\"\r\n class=\"label\"\r\n *ngIf=\"option.label\"\r\n [innerHtml]=\"option.label | translate\"></span>\r\n </label>\r\n </ng-container>\r\n </ng-container>\r\n\r\n </div>\r\n\r\n</div>", styles: [":host{color:var(--ec-form-control-color);font-size:var(--ec-form-control-font-size);display:block;margin-bottom:1rem;width:100%}:host :host-context(.form-condensed){margin-bottom:.5rem}:host .control{width:100%;display:flex;flex-direction:column}:host .control.control-label-bottom{flex-direction:column-reverse}:host .control.control-label-left{flex-direction:row}:host .control.control-label-left label{margin-right:.25rem}:host .control.control-label-right{flex-direction:row-reverse}:host .control.control-label-right label{margin-left:.25rem}:host .control.control-label-left,:host .control.control-label-right{align-items:center}:host .control.control-label-left label,:host .control.control-label-right label{flex:1 1;margin-top:0;margin-bottom:0}:host .control.control-label-left .control-input,:host .control.control-label-right .control-input{flex:2 2}:host .control.is-readonly input,:host .control.is-readonly select,:host .control.is-readonly textarea{border-color:var(--ec-form-control-border-color-readonly);background-color:var(--ec-form-control-background-color-readonly);background-clip:border-box;background-image:none;color:var(--ec-form-control-color-readonly);opacity:1;-webkit-user-select:none;user-select:none;pointer-events:none;overflow:hidden;white-space:nowrap}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid:focus,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid:focus{border-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-invalid{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-required,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-required{display:none}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button{background-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button:not(:focus){border-color:var(--ec-form-control-border-color-invalid)}:host .textbox-group{display:flex;position:relative}:host textarea:focus,:host input:focus,:host select:focus{outline:none}:host(.w-auto){width:auto}.control>label{color:var(--ec-form-control-label-color, var(--ec-color-secondary-dark));display:block;font-size:var(--ec-font-size-label);line-height:1;margin:calc(var(--ec-font-size-label) / 2) 0}.radio-group{display:flex;flex-wrap:wrap}.radio-group-column{flex-direction:column}.radio-group-column .radio-button{margin-right:auto}.radio-group.is-disabled .radio-button{cursor:default}.radio-group.is-readonly .radio-button{pointer-events:none}.radio-group.is-readonly .radio-button .input{opacity:0}.radio-group.is-readonly .radio-button .indicator{background-color:var(--ec-form-control-background-color-readonly);border-color:var(--ec-form-control-border-color-readonly)}.radio-group.is-readonly .radio-button .label,.radio-group.is-readonly .radio-button .indicator{opacity:1;color:var(--ec-form-control-color)}.radio-group.is-readonly.radio-group-toggle{border-color:var(--ec-form-control-border-color-readonly);background-color:var(--ec-form-control-background-color-readonly);background-clip:border-box;background-image:none;color:var(--ec-form-control-color-readonly);opacity:1;-webkit-user-select:none;user-select:none;pointer-events:none;overflow:hidden;white-space:nowrap}.radio-group.is-readonly.radio-group-toggle a,.radio-group.is-readonly.radio-group-toggle input:not(:checked),.radio-group.is-readonly.radio-group-toggle input:not(:checked)+label{display:none}.radio-group.is-readonly.radio-group-toggle input:checked+label{color:inherit;justify-content:flex-start}.radio-button{cursor:pointer;display:inline-flex;margin-bottom:0;position:relative}.radio-button:not(:last-child){margin-right:1rem}.input{margin-top:.5rem;opacity:0;position:absolute;z-index:-1}.input:not(:checked)+.indicator{color:var(--ec-form-control-border-color)}.input:not(:checked)+.indicator:before{display:none}.input:focus+.indicator{color:var(--ec-color-interactive);box-shadow:var(--ec-form-control-box-shadow-focus);border-color:var(--ec-form-control-border-color-focus)}.input:disabled+.indicator{color:var(--ec-form-control-color-disabled);background-color:var(--ec-form-control-background-color-disabled);border-color:var(--ec-form-control-border-color-disabled);opacity:var(--ec-form-control-opacity-disabled)}.input:disabled~.label{color:var(--ec-form-control-color-disabled);opacity:var(--ec-form-control-opacity-disabled)}.indicator{background-color:var(--ec-form-control-background-color);background-clip:padding-box;border:1px solid currentColor;color:var(--ec-color-interactive);margin-top:.5rem;flex:none;pointer-events:none;display:inline-flex;align-items:center;justify-content:center;height:1em;width:1em;border-radius:50%}.indicator:before{background-color:currentColor;content:\"\";display:block;width:.5em;height:.5em;border-radius:50%}.label{line-height:1.25rem;padding:.375rem 0;margin-left:.5rem;min-height:2rem;height:auto}.radio-group-toggle{font-size:var(--ec-form-control-font-size);background-color:var(--ec-border-color);border-radius:var(--ec-border-radius);border:1px solid var(--ec-border-color);min-height:2em;position:relative;color:var(--ec-color-secondary-dark);display:flex}.radio-group-toggle input{position:absolute;z-index:-1;opacity:0}.radio-group-toggle input:checked+label{color:var(--ec-color-interactive)}.radio-group-toggle input:checked:last-of-type~a{transform:translate(100%)}.radio-group-toggle input:focus~.toggle-focused{display:block}.radio-group-toggle .toggle-focused{position:absolute;inset:0;box-shadow:var(--ec-form-control-box-shadow-focus);border-radius:var(--ec-form-control-border-radius);display:none}.radio-group-toggle label{align-items:center;cursor:pointer;display:flex;flex:1 1 0%;justify-content:center;line-height:1.1em;margin-bottom:0;padding:.375rem .5rem;position:relative;text-align:center;transition:color .3s ease;z-index:2}.radio-group-toggle label .ec-icon{color:inherit}.radio-group-toggle a{border:.1875rem solid transparent;border-radius:calc(var(--ec-form-control-border-radius) * .75);display:block;height:100%;left:0;position:absolute;top:0;transition:transform .25s ease;width:50%;z-index:1}.radio-group-toggle a .toggle-handle{background-color:var(--ec-form-control-background-color);border-radius:calc(var(--ec-form-control-border-radius) * .75);height:100%}.radio-group-toggle.is-disabled{opacity:var(--ec-form-control-opacity-disabled);color:var(--ec-form-control-color-disabled)}.radio-group-toggle.is-disabled label{color:inherit!important;cursor:default}.toggle-options-3 a{width:33.3333333333%}.toggle-options-3 input:checked:last-of-type~a{transform:translate(200%)}.toggle-options-3 input:checked:nth-of-type(2)~a{transform:translate(100%)}.toggle-options-4 a{width:25%}.toggle-options-4 input:checked:last-of-type~a{transform:translate(300%)}.toggle-options-4 input:checked:nth-of-type(3)~a{transform:translate(200%)}.toggle-options-4 input:checked:nth-of-type(2)~a{transform:translate(100%)}.toggle-options-5 a{width:20%}.toggle-options-5 input:checked:last-of-type~a{transform:translate(400%)}.toggle-options-5 input:checked:nth-of-type(4)~a{transform:translate(300%)}.toggle-options-5 input:checked:nth-of-type(3)~a{transform:translate(200%)}.toggle-options-5 input:checked:nth-of-type(2)~a{transform:translate(100%)}\n"] }]
|
4683
4744
|
}], ctorParameters: function () { return [{ type: ValidationMessageService }, { type: FormGroupHelper }]; }, propDecorators: { type: [{
|
4684
4745
|
type: Input
|
4685
4746
|
}], options: [{
|
@@ -4760,10 +4821,10 @@ class SelectComponent extends FormControlBase {
|
|
4760
4821
|
}
|
4761
4822
|
}
|
4762
4823
|
SelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SelectComponent, deps: [{ token: ValidationMessageService }, { token: FormGroupHelper }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
4763
|
-
SelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: SelectComponent, selector: "ec-select", inputs: { placeholder: "placeholder", options: "options", autoDefault: "autoDefault" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"control\"\r\n [ngClass]=\"{'is-readonly': readonly, 'is-disabled': formModel.disabled}\">\r\n
|
4824
|
+
SelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: SelectComponent, selector: "ec-select", inputs: { placeholder: "placeholder", options: "options", autoDefault: "autoDefault" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"control\"\r\n [ngClass]=\"{'is-readonly': readonly, 'is-disabled': formModel.disabled}\">\r\n\r\n <label *ngIf=\"label\"\r\n for=\"{{id}}_select\">\r\n <span>{{label | translate}}</span>\r\n <ec-help-popover id=\"{{id}}_helpPopover\"\r\n *ngIf=\"helpPopover\"\r\n class=\"d-inline-block my-n3 mx-n1\"\r\n text=\"{{helpPopover | translate}}\"\r\n contentPosition=\"{{helpPopoverPosition}}\">\r\n </ec-help-popover>\r\n </label>\r\n\r\n <select [attr.id]=\"inputId\"\r\n tabindex=\"{{tabindex}}\"\r\n [formControl]=\"formModel\"\r\n [attr.required]=\"required\"\r\n [attr.cdkFocusInitial]=\"autofocus || null\">\r\n <option *ngIf=\"!required\"\r\n [ngValue]=\"null\">{{placeholder}}</option>\r\n <option *ngFor=\"let option of options\"\r\n [ngValue]=\"option.value\">{{option.label}}</option>\r\n </select>\r\n <i class=\"ec-icon icon-caret-down\"></i>\r\n</div>", styles: [":host{color:var(--ec-form-control-color);font-size:var(--ec-form-control-font-size);display:block;margin-bottom:1rem;width:100%}:host :host-context(.form-condensed){margin-bottom:.5rem}:host .control{width:100%;display:flex;flex-direction:column}:host .control.control-label-bottom{flex-direction:column-reverse}:host .control.control-label-left{flex-direction:row}:host .control.control-label-left label{margin-right:.25rem}:host .control.control-label-right{flex-direction:row-reverse}:host .control.control-label-right label{margin-left:.25rem}:host .control.control-label-left,:host .control.control-label-right{align-items:center}:host .control.control-label-left label,:host .control.control-label-right label{flex:1 1;margin-top:0;margin-bottom:0}:host .control.control-label-left .control-input,:host .control.control-label-right .control-input{flex:2 2}:host .control.is-readonly input,:host .control.is-readonly select,:host .control.is-readonly textarea{border-color:var(--ec-form-control-border-color-readonly);background-color:var(--ec-form-control-background-color-readonly);background-clip:border-box;background-image:none;color:var(--ec-form-control-color-readonly);opacity:1;-webkit-user-select:none;user-select:none;pointer-events:none;overflow:hidden;white-space:nowrap}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid:focus,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid:focus{border-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-invalid{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-required,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-required{display:none}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button{background-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button:not(:focus){border-color:var(--ec-form-control-border-color-invalid)}:host .textbox-group{display:flex;position:relative}:host textarea:focus,:host input:focus,:host select:focus{outline:none}:host .control{position:relative}:host label{color:var(--ec-form-control-label-color, var(--ec-color-secondary-dark));display:block;font-size:var(--ec-font-size-label);line-height:1;margin:calc(var(--ec-font-size-label) / 2) 0}:host select{-webkit-appearance:none;appearance:none;background-color:var(--ec-form-control-background-color);border:1px solid var(--ec-form-control-border-color);border-radius:var(--ec-border-radius);background-image:none;background-clip:padding-box;width:100%;line-height:1.25rem;padding:.3125rem 1.5rem .3125rem .5rem;height:2rem}:host select::selection{background-color:var(--ec-form-control-background-color-selection);color:var(--ec-form-control-color-selection)}:host select::-webkit-input-placeholder{color:var(--ec-form-control-color-placeholder)}:host select::-moz-placeholder{color:var(--ec-form-control-color-placeholder);opacity:1}:host select:-ms-input-placeholder{color:var(--ec-form-control-color-placeholder)}:host select:-moz-placeholder{color:var(--ec-form-control-color-placeholder);opacity:1}:host select~.icon-required,:host select~.icon-invalid{color:var(--ec-form-control-border-color-invalid)}:host select:required.is-empty{background-image:none;background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem}:host select.ng-invalid.ng-touched{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-image:none;background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem}:host select.ng-invalid.ng-touched:focus{border-color:var(--ec-form-control-background-color-invalid)}:host select.is-pending.ng-valid,:host select.is-pending.ng-invalid,:host select.is-pending.ng-pending{background-image:\"\";background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem}:host select:focus,:host select:focus.is-empty{border-color:var(--ec-form-control-border-color-focus);box-shadow:var(--ec-form-control-box-shadow-focus);position:relative;z-index:1}:host select:disabled{background-color:var(--ec-form-control-background-color-disabled);border-color:var(--ec-form-control-border-color-disabled);color:var(--ec-form-control-color-disabled);opacity:var(--ec-form-control-opacity-disabled)}:host select:disabled:required,:host select:disabled:required.is-empty{background-image:none;padding-left:.5rem;background-color:var(--ec-form-control-background-color-disabled);border-color:var(--ec-form-control-border-color-disabled)}:host select:disabled:required+.icon-required,:host select:disabled:required.is-empty+.icon-required{display:none}:host select.is-uppercase:not(.is-empty){text-transform:uppercase}:host select:focus{position:static}:host .icon-caret-down{position:absolute;right:.5rem;bottom:.5625rem;z-index:1;pointer-events:none}:host select:disabled~.icon-caret-down{opacity:var(--ec-form-control-opacity-disabled)}:host .is-readonly .icon-caret-down{display:none}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i4.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: HelpPopoverComponent, selector: "ec-help-popover", inputs: ["id", "text", "contentPosition", "maxWidth"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] });
|
4764
4825
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SelectComponent, decorators: [{
|
4765
4826
|
type: Component,
|
4766
|
-
args: [{ selector: 'ec-select', template: "<div class=\"control\"\r\n [ngClass]=\"{'is-readonly': readonly, 'is-disabled': formModel.disabled}\">\r\n
|
4827
|
+
args: [{ selector: 'ec-select', template: "<div class=\"control\"\r\n [ngClass]=\"{'is-readonly': readonly, 'is-disabled': formModel.disabled}\">\r\n\r\n <label *ngIf=\"label\"\r\n for=\"{{id}}_select\">\r\n <span>{{label | translate}}</span>\r\n <ec-help-popover id=\"{{id}}_helpPopover\"\r\n *ngIf=\"helpPopover\"\r\n class=\"d-inline-block my-n3 mx-n1\"\r\n text=\"{{helpPopover | translate}}\"\r\n contentPosition=\"{{helpPopoverPosition}}\">\r\n </ec-help-popover>\r\n </label>\r\n\r\n <select [attr.id]=\"inputId\"\r\n tabindex=\"{{tabindex}}\"\r\n [formControl]=\"formModel\"\r\n [attr.required]=\"required\"\r\n [attr.cdkFocusInitial]=\"autofocus || null\">\r\n <option *ngIf=\"!required\"\r\n [ngValue]=\"null\">{{placeholder}}</option>\r\n <option *ngFor=\"let option of options\"\r\n [ngValue]=\"option.value\">{{option.label}}</option>\r\n </select>\r\n <i class=\"ec-icon icon-caret-down\"></i>\r\n</div>", styles: [":host{color:var(--ec-form-control-color);font-size:var(--ec-form-control-font-size);display:block;margin-bottom:1rem;width:100%}:host :host-context(.form-condensed){margin-bottom:.5rem}:host .control{width:100%;display:flex;flex-direction:column}:host .control.control-label-bottom{flex-direction:column-reverse}:host .control.control-label-left{flex-direction:row}:host .control.control-label-left label{margin-right:.25rem}:host .control.control-label-right{flex-direction:row-reverse}:host .control.control-label-right label{margin-left:.25rem}:host .control.control-label-left,:host .control.control-label-right{align-items:center}:host .control.control-label-left label,:host .control.control-label-right label{flex:1 1;margin-top:0;margin-bottom:0}:host .control.control-label-left .control-input,:host .control.control-label-right .control-input{flex:2 2}:host .control.is-readonly input,:host .control.is-readonly select,:host .control.is-readonly textarea{border-color:var(--ec-form-control-border-color-readonly);background-color:var(--ec-form-control-background-color-readonly);background-clip:border-box;background-image:none;color:var(--ec-form-control-color-readonly);opacity:1;-webkit-user-select:none;user-select:none;pointer-events:none;overflow:hidden;white-space:nowrap}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid:focus,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid:focus{border-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-invalid{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-required,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-required{display:none}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button{background-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button:not(:focus){border-color:var(--ec-form-control-border-color-invalid)}:host .textbox-group{display:flex;position:relative}:host textarea:focus,:host input:focus,:host select:focus{outline:none}:host .control{position:relative}:host label{color:var(--ec-form-control-label-color, var(--ec-color-secondary-dark));display:block;font-size:var(--ec-font-size-label);line-height:1;margin:calc(var(--ec-font-size-label) / 2) 0}:host select{-webkit-appearance:none;appearance:none;background-color:var(--ec-form-control-background-color);border:1px solid var(--ec-form-control-border-color);border-radius:var(--ec-border-radius);background-image:none;background-clip:padding-box;width:100%;line-height:1.25rem;padding:.3125rem 1.5rem .3125rem .5rem;height:2rem}:host select::selection{background-color:var(--ec-form-control-background-color-selection);color:var(--ec-form-control-color-selection)}:host select::-webkit-input-placeholder{color:var(--ec-form-control-color-placeholder)}:host select::-moz-placeholder{color:var(--ec-form-control-color-placeholder);opacity:1}:host select:-ms-input-placeholder{color:var(--ec-form-control-color-placeholder)}:host select:-moz-placeholder{color:var(--ec-form-control-color-placeholder);opacity:1}:host select~.icon-required,:host select~.icon-invalid{color:var(--ec-form-control-border-color-invalid)}:host select:required.is-empty{background-image:none;background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem}:host select.ng-invalid.ng-touched{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-image:none;background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem}:host select.ng-invalid.ng-touched:focus{border-color:var(--ec-form-control-background-color-invalid)}:host select.is-pending.ng-valid,:host select.is-pending.ng-invalid,:host select.is-pending.ng-pending{background-image:\"\";background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem}:host select:focus,:host select:focus.is-empty{border-color:var(--ec-form-control-border-color-focus);box-shadow:var(--ec-form-control-box-shadow-focus);position:relative;z-index:1}:host select:disabled{background-color:var(--ec-form-control-background-color-disabled);border-color:var(--ec-form-control-border-color-disabled);color:var(--ec-form-control-color-disabled);opacity:var(--ec-form-control-opacity-disabled)}:host select:disabled:required,:host select:disabled:required.is-empty{background-image:none;padding-left:.5rem;background-color:var(--ec-form-control-background-color-disabled);border-color:var(--ec-form-control-border-color-disabled)}:host select:disabled:required+.icon-required,:host select:disabled:required.is-empty+.icon-required{display:none}:host select.is-uppercase:not(.is-empty){text-transform:uppercase}:host select:focus{position:static}:host .icon-caret-down{position:absolute;right:.5rem;bottom:.5625rem;z-index:1;pointer-events:none}:host select:disabled~.icon-caret-down{opacity:var(--ec-form-control-opacity-disabled)}:host .is-readonly .icon-caret-down{display:none}\n"] }]
|
4767
4828
|
}], ctorParameters: function () { return [{ type: ValidationMessageService }, { type: FormGroupHelper }, { type: i0.ElementRef }]; }, propDecorators: { placeholder: [{
|
4768
4829
|
type: Input
|
4769
4830
|
}], options: [{
|
@@ -4836,7 +4897,7 @@ class TabsComponent {
|
|
4836
4897
|
}
|
4837
4898
|
}
|
4838
4899
|
TabsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TabsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
4839
|
-
TabsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: TabsComponent, selector: "ec-tabs", inputs: { id: "id", tabindex: "tabindex", tabStyle: "tabStyle", tabs: ["tabGroup", "tabs"] }, ngImport: i0, template: "<ul *ngIf=\"tabs?.items?.length\" class=\"{{tabStyle}}\">\r\n\r\n <li class=\"{{tab.classlist}}\" [ngClass]=\"{'icon-only': tab.icon && !tab.label}\" *ngFor=\"let tab of tabs?.items; index as i;\">\r\n\r\n <a *ngIf=\"tab.url && !tab.disabled\"\r\n tabindex=\"{{tabs?.selected === tab ? -1 : tabindex}}\"\r\n class=\"tab\"\r\n id=\"{{tab.id ? tab.id : id + '_item' + i}}\"\r\n routerLinkActive=\"active\"\r\n [routerLink]=\"tab.url\"\r\n [queryParams]=\"tab.queryParams || null\"\r\n [queryParamsHandling]=\"tab.queryParamsHandling || ''\"\r\n (keypress)=\"selectTab($event, tab)\"\r\n (click)=\"selectTab($event, tab)\">\r\n <i class=\"ec-icon {{tab.icon}}\" *ngIf=\"tab.icon\" [class.mr-1]=\"tab.label\"></i>\r\n <span class=\"text-truncate\">{{tab.label | translate}}</span>\r\n <span *ngIf=\"tab?.indicator\" class=\"indicator ml-1\" [style.background-color]=\"tab?.indicator === true ? '' : tab?.indicator\"></span>\r\n </a>\r\n\r\n <span *ngIf=\"!tab.url || tab.disabled\"\r\n tabindex=\"{{tabs?.selected === tab || tab.disabled ? -1 : tabindex}}\"\r\n id=\"{{tab.id ? tab.id : id + '_item' + i}}\"\r\n class=\"tab\"\r\n [ngClass]=\"{'active': tabs?.selected === tab, 'is-disabled': tab.disabled}\"\r\n (keypress)=\"selectTab($event, tab)\"\r\n (click)=\"selectTab($event, tab)\">\r\n <i class=\"ec-icon {{tab.icon}}\" *ngIf=\"tab.icon\" [class.mr-1]=\"tab.label\"></i>\r\n <span class=\"text-truncate\">{{tab.label | translate}}</span>\r\n <span *ngIf=\"tab?.indicator\" class=\"indicator ml-1\" [style.background-color]=\"tab?.indicator === true ? '' : tab?.indicator\"></span>\r\n </span>\r\n </li>\r\n</ul> ", styles: [":host{display:block}ul{padding:0;margin:0;list-style:none}a{text-decoration:none}.tabs{display:flex;border-bottom:1px solid var(--ec-tab-border-color, var(--ec-border-color))}.tabs li{display:block;min-width:0}.tabs li:not(:last-child){margin-right:1rem}.tabs .tab{padding-left:0;padding-right:0;border-bottom:2px solid transparent;margin-bottom:-1px;align-items:center;color:var(--ec-tab-color, var(--ec-color-secondary-dark));cursor:pointer;font-size:var(--ec-tab-font-size, var(--ec-font-size-label));display:flex;height:2rem;min-width:2rem;justify-content:center}.tabs .tab.active{color:var(--ec-tab-color-active, var(--ec-color-interactive));border-color:var(--ec-tab-border-color-active, var(--ec-border-color-focus))}.tabs .tab:hover,.tabs .tab:focus{outline:none;border-color:var(--ec-tab-border-color-active, var(--ec-border-color-focus))}.tabs .tab.is-disabled{opacity:var(--ec-form-control-opacity-disabled);cursor:default;pointer-events:none}.pills{display:flex}.pills li{display:block;min-width:0}.pills li:not(:first-child){margin-left:-1px}.pills li .tab{border-radius:0}.pills li:first-child .tab{border-top-left-radius:var(--ec-border-radius);border-bottom-left-radius:var(--ec-border-radius)}.pills li:last-child .tab{border-top-right-radius:var(--ec-border-radius);border-bottom-right-radius:var(--ec-border-radius)}.pills .tab{padding-left:.5rem;padding-right:.5rem;border-radius:var(--ec-border-radius);border:1px solid var(--ec-tab-border-color, var(--ec-border-color));align-items:center;color:var(--ec-tab-color, var(--ec-color-secondary-dark));cursor:pointer;font-size:var(--ec-tab-font-size, var(--ec-font-size-label));display:flex;height:1.75rem;min-width:1.75rem;justify-content:center}.pills .tab.active{color:var(--ec-tab-color-active, var(--ec-color-interactive));background-color:var(--ec-tab-background-color-active, var(--ec-background-color))}.pills .tab:hover,.pills .tab:focus{outline:none;border-color:var(--ec-tab-border-color-active, var(--ec-border-color-focus));box-shadow:0 0 0 1px var(--ec-tab-border-color-active, var(--ec-border-color-focus));position:relative;z-index:1}.pills .tab.is-disabled{opacity:var(--ec-form-control-opacity-disabled);cursor:default;pointer-events:none}.icon-only .tab{padding:0;justify-content:center}.icon-only .tab .ec-icon{color:inherit}.indicator{border:solid 2px rgb(111,28,138);background-color:#6f1c8a40;display:block;width:.625rem;height:.625rem;border-radius:50%}:host(.is-condensed) .pills li,:host(.is-condensed) .tabs li{margin-right:0}:host(.is-condensed) .tab{padding-left:.25rem;padding-right:.25rem}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$
|
4900
|
+
TabsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: TabsComponent, selector: "ec-tabs", inputs: { id: "id", tabindex: "tabindex", tabStyle: "tabStyle", tabs: ["tabGroup", "tabs"] }, ngImport: i0, template: "<ul *ngIf=\"tabs?.items?.length\" class=\"{{tabStyle}}\">\r\n\r\n <li class=\"{{tab.classlist}}\" [ngClass]=\"{'icon-only': tab.icon && !tab.label}\" *ngFor=\"let tab of tabs?.items; index as i;\">\r\n\r\n <a *ngIf=\"tab.url && !tab.disabled\"\r\n tabindex=\"{{tabs?.selected === tab ? -1 : tabindex}}\"\r\n class=\"tab\"\r\n id=\"{{tab.id ? tab.id : id + '_item' + i}}\"\r\n routerLinkActive=\"active\"\r\n [routerLink]=\"tab.url\"\r\n [queryParams]=\"tab.queryParams || null\"\r\n [queryParamsHandling]=\"tab.queryParamsHandling || ''\"\r\n (keypress)=\"selectTab($event, tab)\"\r\n (click)=\"selectTab($event, tab)\">\r\n <i class=\"ec-icon {{tab.icon}}\" *ngIf=\"tab.icon\" [class.mr-1]=\"tab.label\"></i>\r\n <span class=\"text-truncate\">{{tab.label | translate}}</span>\r\n <span *ngIf=\"tab?.indicator\" class=\"indicator ml-1\" [style.background-color]=\"tab?.indicator === true ? '' : tab?.indicator\"></span>\r\n </a>\r\n\r\n <span *ngIf=\"!tab.url || tab.disabled\"\r\n tabindex=\"{{tabs?.selected === tab || tab.disabled ? -1 : tabindex}}\"\r\n id=\"{{tab.id ? tab.id : id + '_item' + i}}\"\r\n class=\"tab\"\r\n [ngClass]=\"{'active': tabs?.selected === tab, 'is-disabled': tab.disabled}\"\r\n (keypress)=\"selectTab($event, tab)\"\r\n (click)=\"selectTab($event, tab)\">\r\n <i class=\"ec-icon {{tab.icon}}\" *ngIf=\"tab.icon\" [class.mr-1]=\"tab.label\"></i>\r\n <span class=\"text-truncate\">{{tab.label | translate}}</span>\r\n <span *ngIf=\"tab?.indicator\" class=\"indicator ml-1\" [style.background-color]=\"tab?.indicator === true ? '' : tab?.indicator\"></span>\r\n </span>\r\n </li>\r\n</ul> ", styles: [":host{display:block}ul{padding:0;margin:0;list-style:none}a{text-decoration:none}.tabs{display:flex;border-bottom:1px solid var(--ec-tab-border-color, var(--ec-border-color))}.tabs li{display:block;min-width:0}.tabs li:not(:last-child){margin-right:1rem}.tabs .tab{padding-left:0;padding-right:0;border-bottom:2px solid transparent;margin-bottom:-1px;align-items:center;color:var(--ec-tab-color, var(--ec-color-secondary-dark));cursor:pointer;font-size:var(--ec-tab-font-size, var(--ec-font-size-label));display:flex;height:2rem;min-width:2rem;justify-content:center}.tabs .tab.active{color:var(--ec-tab-color-active, var(--ec-color-interactive));border-color:var(--ec-tab-border-color-active, var(--ec-border-color-focus))}.tabs .tab:hover,.tabs .tab:focus{outline:none;border-color:var(--ec-tab-border-color-active, var(--ec-border-color-focus))}.tabs .tab.is-disabled{opacity:var(--ec-form-control-opacity-disabled);cursor:default;pointer-events:none}.pills{display:flex}.pills li{display:block;min-width:0}.pills li:not(:first-child){margin-left:-1px}.pills li .tab{border-radius:0}.pills li:first-child .tab{border-top-left-radius:var(--ec-border-radius);border-bottom-left-radius:var(--ec-border-radius)}.pills li:last-child .tab{border-top-right-radius:var(--ec-border-radius);border-bottom-right-radius:var(--ec-border-radius)}.pills .tab{padding-left:.5rem;padding-right:.5rem;border-radius:var(--ec-border-radius);border:1px solid var(--ec-tab-border-color, var(--ec-border-color));align-items:center;color:var(--ec-tab-color, var(--ec-color-secondary-dark));cursor:pointer;font-size:var(--ec-tab-font-size, var(--ec-font-size-label));display:flex;height:1.75rem;min-width:1.75rem;justify-content:center}.pills .tab.active{color:var(--ec-tab-color-active, var(--ec-color-interactive));background-color:var(--ec-tab-background-color-active, var(--ec-background-color))}.pills .tab:hover,.pills .tab:focus{outline:none;border-color:var(--ec-tab-border-color-active, var(--ec-border-color-focus));box-shadow:0 0 0 1px var(--ec-tab-border-color-active, var(--ec-border-color-focus));position:relative;z-index:1}.pills .tab.is-disabled{opacity:var(--ec-form-control-opacity-disabled);cursor:default;pointer-events:none}.icon-only .tab{padding:0;justify-content:center}.icon-only .tab .ec-icon{color:inherit}.indicator{border:solid 2px rgb(111,28,138);background-color:#6f1c8a40;display:block;width:.625rem;height:.625rem;border-radius:50%}:host(.is-condensed) .pills li,:host(.is-condensed) .tabs li{margin-right:0}:host(.is-condensed) .tab{padding-left:.25rem;padding-right:.25rem}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i1$2.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] });
|
4840
4901
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TabsComponent, decorators: [{
|
4841
4902
|
type: Component,
|
4842
4903
|
args: [{ selector: 'ec-tabs', template: "<ul *ngIf=\"tabs?.items?.length\" class=\"{{tabStyle}}\">\r\n\r\n <li class=\"{{tab.classlist}}\" [ngClass]=\"{'icon-only': tab.icon && !tab.label}\" *ngFor=\"let tab of tabs?.items; index as i;\">\r\n\r\n <a *ngIf=\"tab.url && !tab.disabled\"\r\n tabindex=\"{{tabs?.selected === tab ? -1 : tabindex}}\"\r\n class=\"tab\"\r\n id=\"{{tab.id ? tab.id : id + '_item' + i}}\"\r\n routerLinkActive=\"active\"\r\n [routerLink]=\"tab.url\"\r\n [queryParams]=\"tab.queryParams || null\"\r\n [queryParamsHandling]=\"tab.queryParamsHandling || ''\"\r\n (keypress)=\"selectTab($event, tab)\"\r\n (click)=\"selectTab($event, tab)\">\r\n <i class=\"ec-icon {{tab.icon}}\" *ngIf=\"tab.icon\" [class.mr-1]=\"tab.label\"></i>\r\n <span class=\"text-truncate\">{{tab.label | translate}}</span>\r\n <span *ngIf=\"tab?.indicator\" class=\"indicator ml-1\" [style.background-color]=\"tab?.indicator === true ? '' : tab?.indicator\"></span>\r\n </a>\r\n\r\n <span *ngIf=\"!tab.url || tab.disabled\"\r\n tabindex=\"{{tabs?.selected === tab || tab.disabled ? -1 : tabindex}}\"\r\n id=\"{{tab.id ? tab.id : id + '_item' + i}}\"\r\n class=\"tab\"\r\n [ngClass]=\"{'active': tabs?.selected === tab, 'is-disabled': tab.disabled}\"\r\n (keypress)=\"selectTab($event, tab)\"\r\n (click)=\"selectTab($event, tab)\">\r\n <i class=\"ec-icon {{tab.icon}}\" *ngIf=\"tab.icon\" [class.mr-1]=\"tab.label\"></i>\r\n <span class=\"text-truncate\">{{tab.label | translate}}</span>\r\n <span *ngIf=\"tab?.indicator\" class=\"indicator ml-1\" [style.background-color]=\"tab?.indicator === true ? '' : tab?.indicator\"></span>\r\n </span>\r\n </li>\r\n</ul> ", styles: [":host{display:block}ul{padding:0;margin:0;list-style:none}a{text-decoration:none}.tabs{display:flex;border-bottom:1px solid var(--ec-tab-border-color, var(--ec-border-color))}.tabs li{display:block;min-width:0}.tabs li:not(:last-child){margin-right:1rem}.tabs .tab{padding-left:0;padding-right:0;border-bottom:2px solid transparent;margin-bottom:-1px;align-items:center;color:var(--ec-tab-color, var(--ec-color-secondary-dark));cursor:pointer;font-size:var(--ec-tab-font-size, var(--ec-font-size-label));display:flex;height:2rem;min-width:2rem;justify-content:center}.tabs .tab.active{color:var(--ec-tab-color-active, var(--ec-color-interactive));border-color:var(--ec-tab-border-color-active, var(--ec-border-color-focus))}.tabs .tab:hover,.tabs .tab:focus{outline:none;border-color:var(--ec-tab-border-color-active, var(--ec-border-color-focus))}.tabs .tab.is-disabled{opacity:var(--ec-form-control-opacity-disabled);cursor:default;pointer-events:none}.pills{display:flex}.pills li{display:block;min-width:0}.pills li:not(:first-child){margin-left:-1px}.pills li .tab{border-radius:0}.pills li:first-child .tab{border-top-left-radius:var(--ec-border-radius);border-bottom-left-radius:var(--ec-border-radius)}.pills li:last-child .tab{border-top-right-radius:var(--ec-border-radius);border-bottom-right-radius:var(--ec-border-radius)}.pills .tab{padding-left:.5rem;padding-right:.5rem;border-radius:var(--ec-border-radius);border:1px solid var(--ec-tab-border-color, var(--ec-border-color));align-items:center;color:var(--ec-tab-color, var(--ec-color-secondary-dark));cursor:pointer;font-size:var(--ec-tab-font-size, var(--ec-font-size-label));display:flex;height:1.75rem;min-width:1.75rem;justify-content:center}.pills .tab.active{color:var(--ec-tab-color-active, var(--ec-color-interactive));background-color:var(--ec-tab-background-color-active, var(--ec-background-color))}.pills .tab:hover,.pills .tab:focus{outline:none;border-color:var(--ec-tab-border-color-active, var(--ec-border-color-focus));box-shadow:0 0 0 1px var(--ec-tab-border-color-active, var(--ec-border-color-focus));position:relative;z-index:1}.pills .tab.is-disabled{opacity:var(--ec-form-control-opacity-disabled);cursor:default;pointer-events:none}.icon-only .tab{padding:0;justify-content:center}.icon-only .tab .ec-icon{color:inherit}.indicator{border:solid 2px rgb(111,28,138);background-color:#6f1c8a40;display:block;width:.625rem;height:.625rem;border-radius:50%}:host(.is-condensed) .pills li,:host(.is-condensed) .tabs li{margin-right:0}:host(.is-condensed) .tab{padding-left:.25rem;padding-right:.25rem}\n"] }]
|
@@ -5801,7 +5862,7 @@ class HierarchyTreeComponent extends HierarchyBase {
|
|
5801
5862
|
}
|
5802
5863
|
}
|
5803
5864
|
HierarchyTreeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: HierarchyTreeComponent, deps: [{ token: ScrollService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
5804
|
-
HierarchyTreeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: HierarchyTreeComponent, selector: "ec-hierarchy-tree", inputs: { id: "id", hideRootNode: "hideRootNode", customItemTemplate: "customItemTemplate" }, outputs: { itemSelected: "itemSelected" }, usesInheritance: true, ngImport: i0, template: "<ul id=\"{{scrollContainerId}}\"\r\n class=\"flex-grow scroll-y py-1\">\r\n\r\n <li *ngIf=\"!hideRootNode && rootNode\">\r\n <div class=\"item-wrapper\"\r\n title=\"{{rootNode?.tooltip ?? rootNode?.label}}\"\r\n [ngClass]=\"{'is-heading': rootNode?.display === 'heading'}\"\r\n ecNavItemActive=\"is-selected\"\r\n [ecNavItemActiveUrl]=\"rootNode?.url\"\r\n [ecNavItemActiveExactMatch]='rootNode?.isActiveExactMatch'>\r\n <a id=\"rootNode_{{rootNode?.id}}_link\"\r\n class=\"item flex-grow d-flex align-items-center\"\r\n routerLink=\"{{rootNode?.url}}\"\r\n [queryParams]=\"rootNode?.queryParams\">\r\n <ng-container *ngTemplateOutlet=\"customItemTemplate || defaultItemTemplate; context: { $implicit: rootNode }\"></ng-container>\r\n </a>\r\n </div>\r\n </li>\r\n\r\n <ng-template #hierarchyView\r\n let-items>\r\n <li *ngFor=\"let item of items; index as index; first as isFirst\"\r\n [ngClass]=\"{'divider': item.display === 'divider'}\"\r\n id=\"treeItem_{{item.id}}\">\r\n <div class=\"item-wrapper\"\r\n title=\"{{item.tooltip ?? item.label}}\"\r\n [ngClass]=\"{'is-heading': item.display === 'heading'}\"\r\n ecNavItemActive=\"is-selected\"\r\n [ecNavItemActiveUrl]=\"item.url\"\r\n [ecNavItemActiveExactMatch]=\"item.isActiveExactMatch\"\r\n [ecNavItemActiveQueryParams]=\"item.queryParams\">\r\n\r\n <!-- This element provides the indentation for each level -->\r\n <span id=\"indent_{{item.id}}\"\r\n *ngIf=\"!item.noIndent\"\r\n class=\"d-block h-100\"\r\n [style.width.px]=\"(indent) * (item.level - 1) + (item.level * 4) + (item.hasChildren ? 0 : indent)\">\r\n </span>\r\n\r\n <!-- Toggle the button icon to be a spinner when item.status is pending -->\r\n <ec-collapsible-toggle id=\"toggle_{{item.id}}\"\r\n class=\"flex-shrink\"\r\n [style.width.px]=\"indent\"\r\n *ngIf=\"item.hasChildren && !item.hideToggle\"\r\n [hidden]=\"item.status === 'pending'\"\r\n [expanded]=\"item.expanded\"\r\n (expandedChange)=\"toggleItemClicked(item, $event)\">\r\n </ec-collapsible-toggle>\r\n\r\n <i class=\"ec-icon icon-loading my-1\"\r\n [hidden]=\"item.status !== 'pending'\"></i>\r\n\r\n <a id=\"treeItem_{{item.id}}_link\"\r\n class=\"item\"\r\n *ngIf=\"item.url\"\r\n (click)=\"selectItem(item)\"\r\n [routerLink]=\"item.url\"\r\n [queryParams]=\"item.queryParams\"\r\n [queryParamsHandling]=\"item.queryParamsHandling || ''\">\r\n <ng-container *ngTemplateOutlet=\"customItemTemplate || defaultItemTemplate; context: { $implicit: item }\"></ng-container>\r\n </a>\r\n <div id=\"treeItem_{{item.id}}_heading\"\r\n class=\"item\"\r\n *ngIf=\"!item.url\"\r\n (click)=\"selectItem(item)\">\r\n <ng-container *ngTemplateOutlet=\"customItemTemplate || defaultItemTemplate; context: { $implicit: item }\"></ng-container>\r\n </div>\r\n </div>\r\n\r\n\r\n <ul *ngIf=\"item.children.length > 0 && item.expanded\">\r\n <ng-container *ngTemplateOutlet=\"hierarchyView; context:{ $implicit: item.children }\"></ng-container>\r\n </ul>\r\n </li>\r\n </ng-template>\r\n\r\n <ng-container *ngTemplateOutlet=\"hierarchyView; context:{ $implicit: rootNode?.children }\"></ng-container>\r\n</ul>\r\n\r\n<ng-template #defaultItemTemplate\r\n let-item>\r\n <i class=\"ec-icon {{item.icon}} mx-1 flex-shrink\"\r\n *ngIf=\"item.icon\"></i>\r\n <span class=\"mx-1 text-truncate\">{{item.label}}</span>\r\n</ng-template>", styles: [":host{display:block;font-size:var(--ec-menu-font-size, var(--ec-font-size-action));background-color:var(--ec-menu-background-color, var(--ec-background-color))}ul{padding:0;margin:0;list-style:none;overflow-x:hidden}ul li{white-space:nowrap;padding:0}ul li.divider{border-bottom:1px solid var(--ec-border-color);padding-bottom:.25rem;margin-bottom:.25rem}ul .item-wrapper{display:flex;align-items:center;padding:0 .25rem;margin:0 .25rem;height:1.75rem;border-radius:var(--ec-border-radius)}ul .item-wrapper.is-heading{cursor:pointer;color:var(--ec-color-hint-dark);text-transform:uppercase;font-weight:var(--ec-font-weight-bold);font-size:var(--ec-font-size-label)}ul .item-wrapper:hover{background-color:var(--ec-background-color-hover)}ul .item-wrapper.is-selected{font-weight:700}ul .item-wrapper a{text-decoration:none}ul .item{color:inherit;display:flex;align-items:center;flex:1 1;min-height:0;min-width:0}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$
|
5865
|
+
HierarchyTreeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: HierarchyTreeComponent, selector: "ec-hierarchy-tree", inputs: { id: "id", hideRootNode: "hideRootNode", customItemTemplate: "customItemTemplate" }, outputs: { itemSelected: "itemSelected" }, usesInheritance: true, ngImport: i0, template: "<ul id=\"{{scrollContainerId}}\"\r\n class=\"flex-grow scroll-y py-1\">\r\n\r\n <li *ngIf=\"!hideRootNode && rootNode\">\r\n <div class=\"item-wrapper\"\r\n title=\"{{rootNode?.tooltip ?? rootNode?.label}}\"\r\n [ngClass]=\"{'is-heading': rootNode?.display === 'heading'}\"\r\n ecNavItemActive=\"is-selected\"\r\n [ecNavItemActiveUrl]=\"rootNode?.url\"\r\n [ecNavItemActiveExactMatch]='rootNode?.isActiveExactMatch'>\r\n <a id=\"rootNode_{{rootNode?.id}}_link\"\r\n class=\"item flex-grow d-flex align-items-center\"\r\n routerLink=\"{{rootNode?.url}}\"\r\n [queryParams]=\"rootNode?.queryParams\">\r\n <ng-container *ngTemplateOutlet=\"customItemTemplate || defaultItemTemplate; context: { $implicit: rootNode }\"></ng-container>\r\n </a>\r\n </div>\r\n </li>\r\n\r\n <ng-template #hierarchyView\r\n let-items>\r\n <li *ngFor=\"let item of items; index as index; first as isFirst\"\r\n [ngClass]=\"{'divider': item.display === 'divider'}\"\r\n id=\"treeItem_{{item.id}}\">\r\n <div class=\"item-wrapper\"\r\n title=\"{{item.tooltip ?? item.label}}\"\r\n [ngClass]=\"{'is-heading': item.display === 'heading'}\"\r\n ecNavItemActive=\"is-selected\"\r\n [ecNavItemActiveUrl]=\"item.url\"\r\n [ecNavItemActiveExactMatch]=\"item.isActiveExactMatch\"\r\n [ecNavItemActiveQueryParams]=\"item.queryParams\">\r\n\r\n <!-- This element provides the indentation for each level -->\r\n <span id=\"indent_{{item.id}}\"\r\n *ngIf=\"!item.noIndent\"\r\n class=\"d-block h-100\"\r\n [style.width.px]=\"(indent) * (item.level - 1) + (item.level * 4) + (item.hasChildren ? 0 : indent)\">\r\n </span>\r\n\r\n <!-- Toggle the button icon to be a spinner when item.status is pending -->\r\n <ec-collapsible-toggle id=\"toggle_{{item.id}}\"\r\n class=\"flex-shrink\"\r\n [style.width.px]=\"indent\"\r\n *ngIf=\"item.hasChildren && !item.hideToggle\"\r\n [hidden]=\"item.status === 'pending'\"\r\n [expanded]=\"item.expanded\"\r\n (expandedChange)=\"toggleItemClicked(item, $event)\">\r\n </ec-collapsible-toggle>\r\n\r\n <i class=\"ec-icon icon-loading my-1\"\r\n [hidden]=\"item.status !== 'pending'\"></i>\r\n\r\n <a id=\"treeItem_{{item.id}}_link\"\r\n class=\"item\"\r\n *ngIf=\"item.url\"\r\n (click)=\"selectItem(item)\"\r\n [routerLink]=\"item.url\"\r\n [queryParams]=\"item.queryParams\"\r\n [queryParamsHandling]=\"item.queryParamsHandling || ''\">\r\n <ng-container *ngTemplateOutlet=\"customItemTemplate || defaultItemTemplate; context: { $implicit: item }\"></ng-container>\r\n </a>\r\n <div id=\"treeItem_{{item.id}}_heading\"\r\n class=\"item\"\r\n *ngIf=\"!item.url\"\r\n (click)=\"selectItem(item)\">\r\n <ng-container *ngTemplateOutlet=\"customItemTemplate || defaultItemTemplate; context: { $implicit: item }\"></ng-container>\r\n </div>\r\n </div>\r\n\r\n\r\n <ul *ngIf=\"item.children.length > 0 && item.expanded\">\r\n <ng-container *ngTemplateOutlet=\"hierarchyView; context:{ $implicit: item.children }\"></ng-container>\r\n </ul>\r\n </li>\r\n </ng-template>\r\n\r\n <ng-container *ngTemplateOutlet=\"hierarchyView; context:{ $implicit: rootNode?.children }\"></ng-container>\r\n</ul>\r\n\r\n<ng-template #defaultItemTemplate\r\n let-item>\r\n <i class=\"ec-icon {{item.icon}} mx-1 flex-shrink\"\r\n *ngIf=\"item.icon\"></i>\r\n <span class=\"mx-1 text-truncate\">{{item.label}}</span>\r\n</ng-template>", styles: [":host{display:block;font-size:var(--ec-menu-font-size, var(--ec-font-size-action));background-color:var(--ec-menu-background-color, var(--ec-background-color))}ul{padding:0;margin:0;list-style:none;overflow-x:hidden}ul li{white-space:nowrap;padding:0}ul li.divider{border-bottom:1px solid var(--ec-border-color);padding-bottom:.25rem;margin-bottom:.25rem}ul .item-wrapper{display:flex;align-items:center;padding:0 .25rem;margin:0 .25rem;height:1.75rem;border-radius:var(--ec-border-radius)}ul .item-wrapper.is-heading{cursor:pointer;color:var(--ec-color-hint-dark);text-transform:uppercase;font-weight:var(--ec-font-weight-bold);font-size:var(--ec-font-size-label)}ul .item-wrapper:hover{background-color:var(--ec-background-color-hover)}ul .item-wrapper.is-selected{font-weight:700}ul .item-wrapper a{text-decoration:none}ul .item{color:inherit;display:flex;align-items:center;flex:1 1;min-height:0;min-width:0}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: NavItemActiveDirective, selector: "[ecNavItemActive]", inputs: ["ecNavItemActive", "ecNavItemActiveExactMatch", "ecNavItemActiveQueryParams", "ecNavItemActiveUrl"], outputs: ["routerLinkActivated"] }, { kind: "component", type: CollapsibleToggleComponent, selector: "ec-collapsible-toggle", inputs: ["id", "expanded", "tabindex"], outputs: ["expandedChange"] }] });
|
5805
5866
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: HierarchyTreeComponent, decorators: [{
|
5806
5867
|
type: Component,
|
5807
5868
|
args: [{ selector: 'ec-hierarchy-tree', template: "<ul id=\"{{scrollContainerId}}\"\r\n class=\"flex-grow scroll-y py-1\">\r\n\r\n <li *ngIf=\"!hideRootNode && rootNode\">\r\n <div class=\"item-wrapper\"\r\n title=\"{{rootNode?.tooltip ?? rootNode?.label}}\"\r\n [ngClass]=\"{'is-heading': rootNode?.display === 'heading'}\"\r\n ecNavItemActive=\"is-selected\"\r\n [ecNavItemActiveUrl]=\"rootNode?.url\"\r\n [ecNavItemActiveExactMatch]='rootNode?.isActiveExactMatch'>\r\n <a id=\"rootNode_{{rootNode?.id}}_link\"\r\n class=\"item flex-grow d-flex align-items-center\"\r\n routerLink=\"{{rootNode?.url}}\"\r\n [queryParams]=\"rootNode?.queryParams\">\r\n <ng-container *ngTemplateOutlet=\"customItemTemplate || defaultItemTemplate; context: { $implicit: rootNode }\"></ng-container>\r\n </a>\r\n </div>\r\n </li>\r\n\r\n <ng-template #hierarchyView\r\n let-items>\r\n <li *ngFor=\"let item of items; index as index; first as isFirst\"\r\n [ngClass]=\"{'divider': item.display === 'divider'}\"\r\n id=\"treeItem_{{item.id}}\">\r\n <div class=\"item-wrapper\"\r\n title=\"{{item.tooltip ?? item.label}}\"\r\n [ngClass]=\"{'is-heading': item.display === 'heading'}\"\r\n ecNavItemActive=\"is-selected\"\r\n [ecNavItemActiveUrl]=\"item.url\"\r\n [ecNavItemActiveExactMatch]=\"item.isActiveExactMatch\"\r\n [ecNavItemActiveQueryParams]=\"item.queryParams\">\r\n\r\n <!-- This element provides the indentation for each level -->\r\n <span id=\"indent_{{item.id}}\"\r\n *ngIf=\"!item.noIndent\"\r\n class=\"d-block h-100\"\r\n [style.width.px]=\"(indent) * (item.level - 1) + (item.level * 4) + (item.hasChildren ? 0 : indent)\">\r\n </span>\r\n\r\n <!-- Toggle the button icon to be a spinner when item.status is pending -->\r\n <ec-collapsible-toggle id=\"toggle_{{item.id}}\"\r\n class=\"flex-shrink\"\r\n [style.width.px]=\"indent\"\r\n *ngIf=\"item.hasChildren && !item.hideToggle\"\r\n [hidden]=\"item.status === 'pending'\"\r\n [expanded]=\"item.expanded\"\r\n (expandedChange)=\"toggleItemClicked(item, $event)\">\r\n </ec-collapsible-toggle>\r\n\r\n <i class=\"ec-icon icon-loading my-1\"\r\n [hidden]=\"item.status !== 'pending'\"></i>\r\n\r\n <a id=\"treeItem_{{item.id}}_link\"\r\n class=\"item\"\r\n *ngIf=\"item.url\"\r\n (click)=\"selectItem(item)\"\r\n [routerLink]=\"item.url\"\r\n [queryParams]=\"item.queryParams\"\r\n [queryParamsHandling]=\"item.queryParamsHandling || ''\">\r\n <ng-container *ngTemplateOutlet=\"customItemTemplate || defaultItemTemplate; context: { $implicit: item }\"></ng-container>\r\n </a>\r\n <div id=\"treeItem_{{item.id}}_heading\"\r\n class=\"item\"\r\n *ngIf=\"!item.url\"\r\n (click)=\"selectItem(item)\">\r\n <ng-container *ngTemplateOutlet=\"customItemTemplate || defaultItemTemplate; context: { $implicit: item }\"></ng-container>\r\n </div>\r\n </div>\r\n\r\n\r\n <ul *ngIf=\"item.children.length > 0 && item.expanded\">\r\n <ng-container *ngTemplateOutlet=\"hierarchyView; context:{ $implicit: item.children }\"></ng-container>\r\n </ul>\r\n </li>\r\n </ng-template>\r\n\r\n <ng-container *ngTemplateOutlet=\"hierarchyView; context:{ $implicit: rootNode?.children }\"></ng-container>\r\n</ul>\r\n\r\n<ng-template #defaultItemTemplate\r\n let-item>\r\n <i class=\"ec-icon {{item.icon}} mx-1 flex-shrink\"\r\n *ngIf=\"item.icon\"></i>\r\n <span class=\"mx-1 text-truncate\">{{item.label}}</span>\r\n</ng-template>", styles: [":host{display:block;font-size:var(--ec-menu-font-size, var(--ec-font-size-action));background-color:var(--ec-menu-background-color, var(--ec-background-color))}ul{padding:0;margin:0;list-style:none;overflow-x:hidden}ul li{white-space:nowrap;padding:0}ul li.divider{border-bottom:1px solid var(--ec-border-color);padding-bottom:.25rem;margin-bottom:.25rem}ul .item-wrapper{display:flex;align-items:center;padding:0 .25rem;margin:0 .25rem;height:1.75rem;border-radius:var(--ec-border-radius)}ul .item-wrapper.is-heading{cursor:pointer;color:var(--ec-color-hint-dark);text-transform:uppercase;font-weight:var(--ec-font-weight-bold);font-size:var(--ec-font-size-label)}ul .item-wrapper:hover{background-color:var(--ec-background-color-hover)}ul .item-wrapper.is-selected{font-weight:700}ul .item-wrapper a{text-decoration:none}ul .item{color:inherit;display:flex;align-items:center;flex:1 1;min-height:0;min-width:0}\n"] }]
|
@@ -5815,32 +5876,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
5815
5876
|
type: Output
|
5816
5877
|
}] } });
|
5817
5878
|
|
5818
|
-
class HelpPopoverComponent {
|
5819
|
-
constructor() {
|
5820
|
-
this.id = '';
|
5821
|
-
this.text = '';
|
5822
|
-
this.contentPosition = 'top-left';
|
5823
|
-
this.maxWidth = '15rem';
|
5824
|
-
}
|
5825
|
-
}
|
5826
|
-
HelpPopoverComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: HelpPopoverComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
5827
|
-
HelpPopoverComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: HelpPopoverComponent, selector: "ec-help-popover", inputs: { id: "id", text: "text", contentPosition: "contentPosition", maxWidth: "maxWidth" }, host: { properties: { "attr.id": "this.id" } }, ngImport: i0, template: "<ec-popover id=\"{{id}}_popover\"\r\n icon=\"icon-help-circle\"\r\n [contentPosition]=\"contentPosition\"\r\n iconHoverClass=\"font-color-primary-light\">\r\n <div id=\"{{id}}_popoverContent\"\r\n class=\"help-popover-content text-body-1\"\r\n [class.is-right]=\"contentPosition == 'top-right' || contentPosition == 'bottom-right'\"\r\n [style.max-width]=\"maxWidth\">\r\n <div *ngIf=\"text\"\r\n [innerHTML]=\"text | translate\"></div>\r\n <ng-content></ng-content>\r\n </div>\r\n</ec-popover>", styles: [".help-popover-content{--ec-color-link: var(--ec-color-link-light);background-color:#162f3b;color:var(--ec-color-primary-light);padding:.375rem .5rem .375rem 1.75rem}.help-popover-content.is-right{padding:.375rem 1.75rem .375rem .5rem}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: PopoverComponent, selector: "ec-popover", inputs: ["icon", "tag", "tagHoverType", "contentPosition", "iconHoverClass"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] });
|
5828
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: HelpPopoverComponent, decorators: [{
|
5829
|
-
type: Component,
|
5830
|
-
args: [{ selector: 'ec-help-popover', template: "<ec-popover id=\"{{id}}_popover\"\r\n icon=\"icon-help-circle\"\r\n [contentPosition]=\"contentPosition\"\r\n iconHoverClass=\"font-color-primary-light\">\r\n <div id=\"{{id}}_popoverContent\"\r\n class=\"help-popover-content text-body-1\"\r\n [class.is-right]=\"contentPosition == 'top-right' || contentPosition == 'bottom-right'\"\r\n [style.max-width]=\"maxWidth\">\r\n <div *ngIf=\"text\"\r\n [innerHTML]=\"text | translate\"></div>\r\n <ng-content></ng-content>\r\n </div>\r\n</ec-popover>", styles: [".help-popover-content{--ec-color-link: var(--ec-color-link-light);background-color:#162f3b;color:var(--ec-color-primary-light);padding:.375rem .5rem .375rem 1.75rem}.help-popover-content.is-right{padding:.375rem 1.75rem .375rem .5rem}\n"] }]
|
5831
|
-
}], ctorParameters: function () { return []; }, propDecorators: { id: [{
|
5832
|
-
type: Input
|
5833
|
-
}, {
|
5834
|
-
type: HostBinding,
|
5835
|
-
args: ['attr.id']
|
5836
|
-
}], text: [{
|
5837
|
-
type: Input
|
5838
|
-
}], contentPosition: [{
|
5839
|
-
type: Input
|
5840
|
-
}], maxWidth: [{
|
5841
|
-
type: Input
|
5842
|
-
}] } });
|
5843
|
-
|
5844
5879
|
class ItemDisplayComponent {
|
5845
5880
|
constructor() {
|
5846
5881
|
/** The value of the host element's id attribute */
|
@@ -5893,7 +5928,7 @@ class ItemDisplayComponent {
|
|
5893
5928
|
}
|
5894
5929
|
}
|
5895
5930
|
ItemDisplayComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ItemDisplayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
5896
|
-
ItemDisplayComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: ItemDisplayComponent, selector: "ec-item-display", inputs: { id: "id", label: "label", labelHelpPopover: "labelHelpPopover", value: "value", url: "url", condensed: "condensed", target: "target" }, host: { properties: { "attr.id": "this.id" } }, ngImport: i0, template: "<div id=\"{{id}}_label_0\"\r\n class=\"text-caption-1 d-flex align-items-center\">\r\n <span>{{label | translate}}</span>\r\n <ec-help-popover *ngIf=\"labelHelpPopover\"\r\n class=\"mx-n1 my-n2\"\r\n [text]=\"labelHelpPopover.text\"\r\n [contentPosition]=\"labelHelpPopover?.contentPosition ?? 'top-left'\"\r\n [maxWidth]=\"labelHelpPopover?.maxWidth ?? '15rem'\">\r\n </ec-help-popover>\r\n</div>\r\n\r\n<div id=\"{{id}}_value_0\" class=\"{{condensed ? 'text-body-2' : 'text-display-1'}} {{internalValue.classnames}}\"\r\n [class.font-color-hint]=\"!internalValue.value && internalValue.noValueText\"\r\n title=\"{{internalValue.tooltip}}\">\r\n\r\n <ng-container *ngIf=\"url else content\">\r\n <a *ngIf=\"!externalLink\"\r\n id=\"{{id}}_link\"\r\n routerLink=\"{{url}}\"\r\n target=\"{{target}}\">\r\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\r\n </a>\r\n <a *ngIf=\"externalLink\"\r\n id=\"{{id}}_link\"\r\n href=\"{{url}}\"\r\n target=\"{{target}}\">\r\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\r\n </a>\r\n </ng-container>\r\n</div>\r\n\r\n\r\n<ng-template #content>\r\n <i *ngIf=\"internalValue?.icon\" class=\"ec-icon {{internalValue?.icon}}\"></i>\r\n <span>{{(internalValue?.value || internalValue?.noValueText) | translate}}</span>\r\n <ng-content></ng-content>\r\n</ng-template>\r\n", styles: [":host{display:inline-block;margin-bottom:1rem;vertical-align:top}.ec-icon{font-size:1em;top:.125em;position:relative;margin-right:.25em}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$
|
5931
|
+
ItemDisplayComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: ItemDisplayComponent, selector: "ec-item-display", inputs: { id: "id", label: "label", labelHelpPopover: "labelHelpPopover", value: "value", url: "url", condensed: "condensed", target: "target" }, host: { properties: { "attr.id": "this.id" } }, ngImport: i0, template: "<div id=\"{{id}}_label_0\"\r\n class=\"text-caption-1 d-flex align-items-center\">\r\n <span>{{label | translate}}</span>\r\n <ec-help-popover *ngIf=\"labelHelpPopover\"\r\n class=\"mx-n1 my-n2\"\r\n [text]=\"labelHelpPopover.text\"\r\n [contentPosition]=\"labelHelpPopover?.contentPosition ?? 'top-left'\"\r\n [maxWidth]=\"labelHelpPopover?.maxWidth ?? '15rem'\">\r\n </ec-help-popover>\r\n</div>\r\n\r\n<div id=\"{{id}}_value_0\" class=\"{{condensed ? 'text-body-2' : 'text-display-1'}} {{internalValue.classnames}}\"\r\n [class.font-color-hint]=\"!internalValue.value && internalValue.noValueText\"\r\n title=\"{{internalValue.tooltip}}\">\r\n\r\n <ng-container *ngIf=\"url else content\">\r\n <a *ngIf=\"!externalLink\"\r\n id=\"{{id}}_link\"\r\n routerLink=\"{{url}}\"\r\n target=\"{{target}}\">\r\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\r\n </a>\r\n <a *ngIf=\"externalLink\"\r\n id=\"{{id}}_link\"\r\n href=\"{{url}}\"\r\n target=\"{{target}}\">\r\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\r\n </a>\r\n </ng-container>\r\n</div>\r\n\r\n\r\n<ng-template #content>\r\n <i *ngIf=\"internalValue?.icon\" class=\"ec-icon {{internalValue?.icon}}\"></i>\r\n <span>{{(internalValue?.value || internalValue?.noValueText) | translate}}</span>\r\n <ng-content></ng-content>\r\n</ng-template>\r\n", styles: [":host{display:inline-block;margin-bottom:1rem;vertical-align:top}.ec-icon{font-size:1em;top:.125em;position:relative;margin-right:.25em}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: HelpPopoverComponent, selector: "ec-help-popover", inputs: ["id", "text", "contentPosition", "maxWidth"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] });
|
5897
5932
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ItemDisplayComponent, decorators: [{
|
5898
5933
|
type: Component,
|
5899
5934
|
args: [{ selector: 'ec-item-display', template: "<div id=\"{{id}}_label_0\"\r\n class=\"text-caption-1 d-flex align-items-center\">\r\n <span>{{label | translate}}</span>\r\n <ec-help-popover *ngIf=\"labelHelpPopover\"\r\n class=\"mx-n1 my-n2\"\r\n [text]=\"labelHelpPopover.text\"\r\n [contentPosition]=\"labelHelpPopover?.contentPosition ?? 'top-left'\"\r\n [maxWidth]=\"labelHelpPopover?.maxWidth ?? '15rem'\">\r\n </ec-help-popover>\r\n</div>\r\n\r\n<div id=\"{{id}}_value_0\" class=\"{{condensed ? 'text-body-2' : 'text-display-1'}} {{internalValue.classnames}}\"\r\n [class.font-color-hint]=\"!internalValue.value && internalValue.noValueText\"\r\n title=\"{{internalValue.tooltip}}\">\r\n\r\n <ng-container *ngIf=\"url else content\">\r\n <a *ngIf=\"!externalLink\"\r\n id=\"{{id}}_link\"\r\n routerLink=\"{{url}}\"\r\n target=\"{{target}}\">\r\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\r\n </a>\r\n <a *ngIf=\"externalLink\"\r\n id=\"{{id}}_link\"\r\n href=\"{{url}}\"\r\n target=\"{{target}}\">\r\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\r\n </a>\r\n </ng-container>\r\n</div>\r\n\r\n\r\n<ng-template #content>\r\n <i *ngIf=\"internalValue?.icon\" class=\"ec-icon {{internalValue?.icon}}\"></i>\r\n <span>{{(internalValue?.value || internalValue?.noValueText) | translate}}</span>\r\n <ng-content></ng-content>\r\n</ng-template>\r\n", styles: [":host{display:inline-block;margin-bottom:1rem;vertical-align:top}.ec-icon{font-size:1em;top:.125em;position:relative;margin-right:.25em}\n"] }]
|
@@ -8339,7 +8374,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
8339
8374
|
class PageTitleComponent {
|
8340
8375
|
}
|
8341
8376
|
PageTitleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PageTitleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
8342
|
-
PageTitleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: PageTitleComponent, selector: "app-page-title", inputs: { title: "title", titleIcon: "titleIcon", subTitle: "subTitle", subTitleUrl: "subTitleUrl" }, host: { classAttribute: "d-flex" }, ngImport: i0, template: "<i *ngIf=\"titleIcon\"\r\n class=\"flex-shrink mr-1 my-1 ec-icon ec-icon-md {{titleIcon}}\"></i>\r\n<div class=\"text-truncate\">\r\n <h1 *ngIf=\"title\"\r\n class=\"text-title-1 mb-0 py-1 text-truncate\"\r\n title=\"{{title}}\">{{title}}</h1>\r\n <p *ngIf=\"subTitle && !subTitleUrl\"\r\n class=\"text-caption-1 mb-0 mt-n1 text-truncate\">{{subTitle}}</p>\r\n <a *ngIf=\"subTitle && subTitleUrl\"\r\n id=\"subTitle_link\"\r\n class=\"d-block text-truncate mb-0 mt-n1 font-size-small\"\r\n routerLink=\"{{subTitleUrl}}\"\r\n target=\"_self\">\r\n {{subTitle}}\r\n </a>\r\n</div>", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$
|
8377
|
+
PageTitleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: PageTitleComponent, selector: "app-page-title", inputs: { title: "title", titleIcon: "titleIcon", subTitle: "subTitle", subTitleUrl: "subTitleUrl" }, host: { classAttribute: "d-flex" }, ngImport: i0, template: "<i *ngIf=\"titleIcon\"\r\n class=\"flex-shrink mr-1 my-1 ec-icon ec-icon-md {{titleIcon}}\"></i>\r\n<div class=\"text-truncate\">\r\n <h1 *ngIf=\"title\"\r\n class=\"text-title-1 mb-0 py-1 text-truncate\"\r\n title=\"{{title}}\">{{title}}</h1>\r\n <p *ngIf=\"subTitle && !subTitleUrl\"\r\n class=\"text-caption-1 mb-0 mt-n1 text-truncate\">{{subTitle}}</p>\r\n <a *ngIf=\"subTitle && subTitleUrl\"\r\n id=\"subTitle_link\"\r\n class=\"d-block text-truncate mb-0 mt-n1 font-size-small\"\r\n routerLink=\"{{subTitleUrl}}\"\r\n target=\"_self\">\r\n {{subTitle}}\r\n </a>\r\n</div>", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }] });
|
8343
8378
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PageTitleComponent, decorators: [{
|
8344
8379
|
type: Component,
|
8345
8380
|
args: [{ selector: 'app-page-title', host: {
|
@@ -8422,7 +8457,7 @@ class PageViewComponent {
|
|
8422
8457
|
}
|
8423
8458
|
}
|
8424
8459
|
PageViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PageViewComponent, deps: [{ token: DialogService }], target: i0.ɵɵFactoryTarget.Component });
|
8425
|
-
PageViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: PageViewComponent, selector: "ec-page-view", inputs: { isDialog: "isDialog", readonly: "readonly", status: "status", showHeader: "showHeader", errors: "errors", breadcrumbs: "breadcrumbs", title: "title", titleIcon: "titleIcon", subTitle: "subTitle", subTitleUrl: "subTitleUrl", moreActionsLabel: "moreActionsLabel", moreActions: "moreActions", secondaryActionLabel: "secondaryActionLabel", hideSecondaryAction: "hideSecondaryAction", hideCloseOnPending: "hideCloseOnPending", primaryActionLabel: "primaryActionLabel", hidePrimaryAction: "hidePrimaryAction", customTitleTemplate: "customTitleTemplate", customActionsTemplate: "customActionsTemplate", customHeaderTemplate: "customHeaderTemplate", footerTemplate: "footerTemplate", customErrorBannerTemplate: "customErrorBannerTemplate", stickyFooter: "stickyFooter", fitContent: "fitContent", disablePrimaryAction: "disablePrimaryAction", bgContent: "bgContent" }, outputs: { onPrimaryAction: "onPrimaryAction", onSecondaryAction: "onSecondaryAction" }, host: { properties: { "class.bg-content": "this.bgContent" }, classAttribute: "flex-grow" }, ngImport: i0, template: "<div ecOverlay\r\n [status]=\"status?.status\"\r\n [message]=\"status?.message\"\r\n [displayAsMask]=\"true\"\r\n class=\"flex-grow d-flex\"\r\n [ngClass]=\"{'bg-body': !bgContent, 'bg-content': bgContent}\">\r\n <div id=\"PageViewScrollContainer\"\r\n class=\"d-flex flex-column flex-grow scroll-y\"\r\n [class.is-dialog]=\"isDialog\"\r\n [class.fit-content]=\"fitContent\"\r\n [class.sticky-footer]=\"stickyFooter && !!footerTemplate\"\r\n [class.overlay-visible]=\"status?.status !== 'hasData'\"\r\n [class.footer-visible]=\"!!footerTemplate\">\r\n <section>\r\n <ng-content></ng-content>\r\n </section>\r\n\r\n <footer *ngIf=\"footerTemplate\">\r\n <ng-container *ngTemplateOutlet=\"footerTemplate\"></ng-container>\r\n </footer>\r\n\r\n <header *ngIf=\"showHeader\">\r\n <ol id=\"breadcrumbs\"\r\n *ngIf=\"breadcrumbs?.length && !isDialog\">\r\n <li *ngFor=\"let crumb of breadcrumbs; last as isLast\">\r\n <a *ngIf=\"crumb.url; else label\"\r\n [routerLink]=\"crumb.url\">\r\n <ng-container *ngTemplateOutlet=\"label\"></ng-container>\r\n </a>\r\n <ng-template #label>{{crumb.label}}</ng-template>\r\n </li>\r\n </ol>\r\n\r\n <div class=\"titlebar\">\r\n <app-page-title *ngIf=\"!customTitleTemplate; else customTitle\"\r\n [title]=\"title\"\r\n [subTitle]=\"subTitle\"\r\n [subTitleUrl]=\"subTitleUrl\"\r\n [titleIcon]=\"titleIcon\"\r\n class=\"title text-truncate\">\r\n </app-page-title>\r\n\r\n <ng-template #customTitle>\r\n <div class=\"title\">\r\n <ng-container *ngTemplateOutlet=\"customTitleTemplate\"></ng-container>\r\n </div>\r\n </ng-template>\r\n\r\n <div class=\"actions\">\r\n <ec-button id=\"primaryAction\"\r\n class=\"ml-2\"\r\n *ngIf=\"!hidePrimaryAction && onPrimaryAction.observers?.length && !readonly\"\r\n [disabled]=\"status?.status === 'pending' || disablePrimaryAction\"\r\n type=\"primary\"\r\n [label]=\"primaryActionLabel\"\r\n (clicked)=\"primaryAction($event)\">\r\n </ec-button>\r\n <ec-button id=\"secondaryAction\"\r\n class=\"ml-2\"\r\n *ngIf=\"!hideSecondaryAction && onSecondaryAction.observers?.length\"\r\n type=\"secondary\"\r\n [label]=\"readonly ? 'Close' : secondaryActionLabel\"\r\n (clicked)=\"secondaryAction($event)\">\r\n </ec-button>\r\n <ec-dropdown id=\"moreActions\"\r\n *ngIf=\"moreActions?.length && !readonly\"\r\n [disabled]=\"status?.status === 'pending'\"\r\n class=\"ml-2\"\r\n buttonType=\"text\"\r\n [label]=\"moreActionsLabel\"\r\n [items]=\"moreActions\">\r\n </ec-dropdown>\r\n <ng-container *ngTemplateOutlet=\"customActionsTemplate\"></ng-container>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"customHeaderTemplate\"\r\n class=\"page-header\">\r\n <ng-container *ngTemplateOutlet=\"customHeaderTemplate\"></ng-container>\r\n </div>\r\n\r\n <ec-banner *ngIf=\"!customErrorBannerTemplate && errors; else customErrorBannerOutlet\"\r\n id=\"pageViewErrors\"\r\n [class.border-bottom-0]=\"!isDialog\">\r\n <div [innerHtml]=\"errors\"></div>\r\n </ec-banner>\r\n\r\n <ng-template #customErrorBannerOutlet>\r\n <ec-banner *ngIf=\"errors\"\r\n id=\"pageViewErrors\"\r\n [class.border-bottom-0]=\"!isDialog\">\r\n <ng-container *ngTemplateOutlet=\"customErrorBannerTemplate\"></ng-container>\r\n </ec-banner>\r\n </ng-template>\r\n </header>\r\n </div>\r\n\r\n <ec-button *ngIf=\"isDialog && ( (status?.status === 'pending' && !hideCloseOnPending) || status?.status === 'error')\"\r\n id=\"pageViewDialogClose\"\r\n type=\"icon\"\r\n icon=\"icon-cancel\"\r\n (clicked)=\"closeDialog()\">\r\n </ec-button>\r\n</div>", styles: [":host{flex:1 1;min-height:0;display:flex}header{background-color:var(--ec-background-color-body);position:sticky;top:0;order:1;padding:1rem 1.5rem .5rem;flex:none;z-index:var(--ec-z-index-sticky-page-header)}ol{font-size:var(--ec-font-size-label);line-height:1rem;grid-column:1/3;grid-row:1/2;list-style:none;padding:0;margin:0 0 .25rem}ol li{display:inline}ol li:not(:last-child):after{content:\" / \";display:inline;color:var(--ec-color-secondary-dark)}div[ecOverlay]{position:relative}.titlebar{display:grid;grid-template-columns:auto max-content;grid-template-rows:max-content max-content;gap:0 1rem}.title{grid-column:1/2;grid-row:2/3;align-self:center}.actions{grid-column:2/3;grid-row:2/3;display:flex;flex-direction:row-reverse}ec-banner{margin-top:1rem}section{padding:var(--ec-page-view-padding-section, .5rem 1.5rem 2rem);order:2;flex:1 0 auto;min-height:0}:not(.is-dialog)>section{z-index:0}footer{background-color:var(--ec-background-color-body);order:3;padding:0 1.5rem;height:4.5rem;flex:none;display:flex;align-items:center}.is-dialog header{padding:0}.is-dialog .titlebar{background-color:var(--ec-background-color);padding:1rem}.is-dialog ec-banner{margin:0}.is-dialog section{padding:var(--ec-page-view-padding-section, 1rem 1rem 1.5rem)}.sticky-footer section{padding-bottom:4.5rem}.sticky-footer footer{position:sticky;bottom:0;z-index:var(--ec-z-index-sticky-page-header)}.fit-content>section{flex:1 1;display:flex}.footer-visible section{padding-bottom:0}.overlay-visible header{z-index:var(--ec-z-index-overlay)1}.overlay-visible ec-banner{display:none}:host(.bg-content) header{background-color:var(--ec-background-color)}:host(.bg-content) section{background-color:var(--ec-background-color)}:host(.bg-content) footer{background-color:var(--ec-background-color)}#pageViewDialogClose{position:absolute;top:1rem;right:1rem;z-index:calc(var(--ec-z-index-overlay) + 1)}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: ButtonComponent, selector: "ec-button", inputs: ["id", "disabled", "icon", "label", "badge", "tabindex", "type", "pending", "pendingIcon", "customTemplate", "isSubmit", "autofocus"], outputs: ["clicked"] }, { kind: "component", type: ViewOverlayComponent, selector: "[ecOverlay]", inputs: ["status", "message", "action", "noDataTemplate", "displayAsMask", "overlayClassList"] }, { kind: "component", type: BannerComponent, selector: "ec-banner", inputs: ["hidden", "id", "type", "bannerStyle", "title", "text", "list", "showCloseBtn", "autoHideOnClose", "customIcon", "rememberClosed"], outputs: ["closed"] }, { kind: "component", type: DropdownComponent, selector: "ec-dropdown", inputs: ["id", "autofocus", "status", "disabled", "label", "icon", "buttonType", "buttonAlignment", "buttonTitle", "tabindex", "showArrow", "items", "menuTemplateType", "menuTitle", "menuHeight", "menuWidth", "menuMinWidth", "menuPosition", "menuFooter", "popupFixed", "buttonCustomTemplate", "pending"], outputs: ["itemSelected", "popupOpened"] }, { kind: "component", type: PageTitleComponent, selector: "app-page-title", inputs: ["title", "titleIcon", "subTitle", "subTitleUrl"] }] });
|
8460
|
+
PageViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: PageViewComponent, selector: "ec-page-view", inputs: { isDialog: "isDialog", readonly: "readonly", status: "status", showHeader: "showHeader", errors: "errors", breadcrumbs: "breadcrumbs", title: "title", titleIcon: "titleIcon", subTitle: "subTitle", subTitleUrl: "subTitleUrl", moreActionsLabel: "moreActionsLabel", moreActions: "moreActions", secondaryActionLabel: "secondaryActionLabel", hideSecondaryAction: "hideSecondaryAction", hideCloseOnPending: "hideCloseOnPending", primaryActionLabel: "primaryActionLabel", hidePrimaryAction: "hidePrimaryAction", customTitleTemplate: "customTitleTemplate", customActionsTemplate: "customActionsTemplate", customHeaderTemplate: "customHeaderTemplate", footerTemplate: "footerTemplate", customErrorBannerTemplate: "customErrorBannerTemplate", stickyFooter: "stickyFooter", fitContent: "fitContent", disablePrimaryAction: "disablePrimaryAction", bgContent: "bgContent" }, outputs: { onPrimaryAction: "onPrimaryAction", onSecondaryAction: "onSecondaryAction" }, host: { properties: { "class.bg-content": "this.bgContent" }, classAttribute: "flex-grow" }, ngImport: i0, template: "<div ecOverlay\r\n [status]=\"status?.status\"\r\n [message]=\"status?.message\"\r\n [displayAsMask]=\"true\"\r\n class=\"flex-grow d-flex\"\r\n [ngClass]=\"{'bg-body': !bgContent, 'bg-content': bgContent}\">\r\n <div id=\"PageViewScrollContainer\"\r\n class=\"d-flex flex-column flex-grow scroll-y\"\r\n [class.is-dialog]=\"isDialog\"\r\n [class.fit-content]=\"fitContent\"\r\n [class.sticky-footer]=\"stickyFooter && !!footerTemplate\"\r\n [class.overlay-visible]=\"status?.status !== 'hasData'\"\r\n [class.footer-visible]=\"!!footerTemplate\">\r\n <section>\r\n <ng-content></ng-content>\r\n </section>\r\n\r\n <footer *ngIf=\"footerTemplate\">\r\n <ng-container *ngTemplateOutlet=\"footerTemplate\"></ng-container>\r\n </footer>\r\n\r\n <header *ngIf=\"showHeader\">\r\n <ol id=\"breadcrumbs\"\r\n *ngIf=\"breadcrumbs?.length && !isDialog\">\r\n <li *ngFor=\"let crumb of breadcrumbs; last as isLast\">\r\n <a *ngIf=\"crumb.url; else label\"\r\n [routerLink]=\"crumb.url\">\r\n <ng-container *ngTemplateOutlet=\"label\"></ng-container>\r\n </a>\r\n <ng-template #label>{{crumb.label}}</ng-template>\r\n </li>\r\n </ol>\r\n\r\n <div class=\"titlebar\">\r\n <app-page-title *ngIf=\"!customTitleTemplate; else customTitle\"\r\n [title]=\"title\"\r\n [subTitle]=\"subTitle\"\r\n [subTitleUrl]=\"subTitleUrl\"\r\n [titleIcon]=\"titleIcon\"\r\n class=\"title text-truncate\">\r\n </app-page-title>\r\n\r\n <ng-template #customTitle>\r\n <div class=\"title\">\r\n <ng-container *ngTemplateOutlet=\"customTitleTemplate\"></ng-container>\r\n </div>\r\n </ng-template>\r\n\r\n <div class=\"actions\">\r\n <ec-button id=\"primaryAction\"\r\n class=\"ml-2\"\r\n *ngIf=\"!hidePrimaryAction && onPrimaryAction.observers?.length && !readonly\"\r\n [disabled]=\"status?.status === 'pending' || disablePrimaryAction\"\r\n type=\"primary\"\r\n [label]=\"primaryActionLabel\"\r\n (clicked)=\"primaryAction($event)\">\r\n </ec-button>\r\n <ec-button id=\"secondaryAction\"\r\n class=\"ml-2\"\r\n *ngIf=\"!hideSecondaryAction && onSecondaryAction.observers?.length\"\r\n type=\"secondary\"\r\n [label]=\"readonly ? 'Close' : secondaryActionLabel\"\r\n (clicked)=\"secondaryAction($event)\">\r\n </ec-button>\r\n <ec-dropdown id=\"moreActions\"\r\n *ngIf=\"moreActions?.length && !readonly\"\r\n [disabled]=\"status?.status === 'pending'\"\r\n class=\"ml-2\"\r\n buttonType=\"text\"\r\n [label]=\"moreActionsLabel\"\r\n [items]=\"moreActions\">\r\n </ec-dropdown>\r\n <ng-container *ngTemplateOutlet=\"customActionsTemplate\"></ng-container>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"customHeaderTemplate\"\r\n class=\"page-header\">\r\n <ng-container *ngTemplateOutlet=\"customHeaderTemplate\"></ng-container>\r\n </div>\r\n\r\n <ec-banner *ngIf=\"!customErrorBannerTemplate && errors; else customErrorBannerOutlet\"\r\n id=\"pageViewErrors\"\r\n [class.border-bottom-0]=\"!isDialog\">\r\n <div [innerHtml]=\"errors\"></div>\r\n </ec-banner>\r\n\r\n <ng-template #customErrorBannerOutlet>\r\n <ec-banner *ngIf=\"errors\"\r\n id=\"pageViewErrors\"\r\n [class.border-bottom-0]=\"!isDialog\">\r\n <ng-container *ngTemplateOutlet=\"customErrorBannerTemplate\"></ng-container>\r\n </ec-banner>\r\n </ng-template>\r\n </header>\r\n </div>\r\n\r\n <ec-button *ngIf=\"isDialog && ( (status?.status === 'pending' && !hideCloseOnPending) || status?.status === 'error')\"\r\n id=\"pageViewDialogClose\"\r\n type=\"icon\"\r\n icon=\"icon-cancel\"\r\n (clicked)=\"closeDialog()\">\r\n </ec-button>\r\n</div>", styles: [":host{flex:1 1;min-height:0;display:flex}header{background-color:var(--ec-background-color-body);position:sticky;top:0;order:1;padding:1rem 1.5rem .5rem;flex:none;z-index:var(--ec-z-index-sticky-page-header)}ol{font-size:var(--ec-font-size-label);line-height:1rem;grid-column:1/3;grid-row:1/2;list-style:none;padding:0;margin:0 0 .25rem}ol li{display:inline}ol li:not(:last-child):after{content:\" / \";display:inline;color:var(--ec-color-secondary-dark)}div[ecOverlay]{position:relative}.titlebar{display:grid;grid-template-columns:auto max-content;grid-template-rows:max-content max-content;gap:0 1rem}.title{grid-column:1/2;grid-row:2/3;align-self:center}.actions{grid-column:2/3;grid-row:2/3;display:flex;flex-direction:row-reverse}ec-banner{margin-top:1rem}section{padding:var(--ec-page-view-padding-section, .5rem 1.5rem 2rem);order:2;flex:1 0 auto;min-height:0}:not(.is-dialog)>section{z-index:0}footer{background-color:var(--ec-background-color-body);order:3;padding:0 1.5rem;height:4.5rem;flex:none;display:flex;align-items:center}.is-dialog header{padding:0}.is-dialog .titlebar{background-color:var(--ec-background-color);padding:1rem}.is-dialog ec-banner{margin:0}.is-dialog section{padding:var(--ec-page-view-padding-section, 1rem 1rem 1.5rem)}.sticky-footer section{padding-bottom:4.5rem}.sticky-footer footer{position:sticky;bottom:0;z-index:var(--ec-z-index-sticky-page-header)}.fit-content>section{flex:1 1;display:flex}.footer-visible section{padding-bottom:0}.overlay-visible header{z-index:var(--ec-z-index-overlay)1}.overlay-visible ec-banner{display:none}:host(.bg-content) header{background-color:var(--ec-background-color)}:host(.bg-content) section{background-color:var(--ec-background-color)}:host(.bg-content) footer{background-color:var(--ec-background-color)}#pageViewDialogClose{position:absolute;top:1rem;right:1rem;z-index:calc(var(--ec-z-index-overlay) + 1)}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: ButtonComponent, selector: "ec-button", inputs: ["id", "disabled", "icon", "label", "badge", "tabindex", "type", "pending", "pendingIcon", "customTemplate", "isSubmit", "autofocus"], outputs: ["clicked"] }, { kind: "component", type: ViewOverlayComponent, selector: "[ecOverlay]", inputs: ["status", "message", "action", "noDataTemplate", "displayAsMask", "overlayClassList"] }, { kind: "component", type: BannerComponent, selector: "ec-banner", inputs: ["hidden", "id", "type", "bannerStyle", "title", "text", "list", "showCloseBtn", "autoHideOnClose", "customIcon", "rememberClosed"], outputs: ["closed"] }, { kind: "component", type: DropdownComponent, selector: "ec-dropdown", inputs: ["id", "autofocus", "status", "disabled", "label", "icon", "buttonType", "buttonAlignment", "buttonTitle", "tabindex", "showArrow", "items", "menuTemplateType", "menuTitle", "menuHeight", "menuWidth", "menuMinWidth", "menuPosition", "menuFooter", "popupFixed", "buttonCustomTemplate", "pending"], outputs: ["itemSelected", "popupOpened"] }, { kind: "component", type: PageTitleComponent, selector: "app-page-title", inputs: ["title", "titleIcon", "subTitle", "subTitleUrl"] }] });
|
8426
8461
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PageViewComponent, decorators: [{
|
8427
8462
|
type: Component,
|
8428
8463
|
args: [{ selector: 'ec-page-view', host: {
|