@energycap/components 0.28.6 → 0.28.7-ECAP-11994-Wizard-Updates.20220428-1313

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.
@@ -7923,6 +7923,7 @@ class WizardButtonsComponent {
7923
7923
  this.nextLabel = 'Next_TC';
7924
7924
  this.backLabel = 'Back_TC';
7925
7925
  this.cancelLabel = 'Cancel';
7926
+ this.saveLabel = 'Save';
7926
7927
  this.cancelId = 'cancelWizardDialog';
7927
7928
  this.saveId = 'saveWizardDialog';
7928
7929
  this.tabindex = 0;
@@ -7947,7 +7948,7 @@ class WizardButtonsComponent {
7947
7948
  WizardButtonsComponent.decorators = [
7948
7949
  { type: Component, args: [{
7949
7950
  selector: 'ec-wizard-buttons',
7950
- template: "<ec-button id=\"{{saveId}}\"\r\n class=\"ml-2\"\r\n *ngIf=\"!hideNextSaveButton\"\r\n type=\"primary\"\r\n [label]=\"(!showSave ? nextLabel : 'Save')\"\r\n [tabindex]=\"!tabindex ? 0 : tabindex\"\r\n (clicked)=\"!showSave ? onNextTab() : onSave($event)\"\r\n [disabled]=\"status?.status === 'pending' || status?.status === 'error'\">\r\n</ec-button>\r\n<ec-button id=\"previousTab\"\r\n class=\"ml-2\"\r\n *ngIf=\"showBack\"\r\n type=\"secondary\"\r\n [label]=\"backLabel\"\r\n [tabindex]=\"!tabindex ? 0 : tabindex+1\"\r\n (clicked)=\"onPreviousTab()\">\r\n</ec-button>\r\n<ec-button id=\"{{cancelId}}\"\r\n type=\"secondary\"\r\n [label]=\"cancelLabel\"\r\n [tabindex]=\"!tabindex ? 0 : tabindex+2\"\r\n (clicked)=\"onCancel()\">\r\n</ec-button>\r\n",
7951
+ template: "<ec-button id=\"{{saveId}}\"\r\n class=\"ml-2\"\r\n *ngIf=\"!hideNextSaveButton\"\r\n type=\"primary\"\r\n [label]=\"(!showSave ? nextLabel : saveLabel)\"\r\n [tabindex]=\"!tabindex ? 0 : tabindex\"\r\n (clicked)=\"!showSave ? onNextTab() : onSave($event)\"\r\n [disabled]=\"status?.status === 'pending' || status?.status === 'error'\">\r\n</ec-button>\r\n<ec-button id=\"previousTab\"\r\n class=\"ml-2\"\r\n *ngIf=\"showBack\"\r\n type=\"secondary\"\r\n [label]=\"backLabel\"\r\n [tabindex]=\"!tabindex ? 0 : tabindex+1\"\r\n (clicked)=\"onPreviousTab()\">\r\n</ec-button>\r\n<ec-button id=\"{{cancelId}}\"\r\n type=\"secondary\"\r\n [label]=\"cancelLabel\"\r\n [tabindex]=\"!tabindex ? 0 : tabindex+2\"\r\n (clicked)=\"onCancel()\">\r\n</ec-button>\r\n",
7951
7952
  styles: [":host{display:flex;flex-direction:row-reverse}:host-context(ec-page-view .titlebar>.actions){flex-direction:row}"]
7952
7953
  },] }
7953
7954
  ];
@@ -7956,6 +7957,7 @@ WizardButtonsComponent.propDecorators = {
7956
7957
  nextLabel: [{ type: Input }],
7957
7958
  backLabel: [{ type: Input }],
7958
7959
  cancelLabel: [{ type: Input }],
7960
+ saveLabel: [{ type: Input }],
7959
7961
  cancelId: [{ type: Input }],
7960
7962
  saveId: [{ type: Input }],
7961
7963
  tabindex: [{ type: Input }],
@@ -7975,8 +7977,8 @@ class WizardProgressComponent {
7975
7977
  WizardProgressComponent.decorators = [
7976
7978
  { type: Component, args: [{
7977
7979
  selector: 'ec-wizard-progress',
7978
- template: "<div *ngFor=\"let tab of tabGroup?.items; index as index\"\r\n class=\"progress-tab font-color-secondary mx-3\"\r\n [class.is-active]=\"currentTab?.id === tab.id\">\r\n <i class=\"ec-icon icon-circle-o mr-1\"\r\n *ngIf=\"!tab.completed\"></i>\r\n <i class=\"ec-icon icon-check-circle mr-1\"\r\n *ngIf=\"tab.completed\"></i>\r\n <span>{{index+1}}. {{tab.label | translate}}</span>\r\n</div>",
7979
- styles: [".progress-tab,:host{align-items:center;display:flex}.progress-tab.is-active{font-weight:700}.progress-tab:not(.is-active)>i{opacity:.4}"]
7980
+ template: "<div *ngFor=\"let tab of tabGroup?.items; index as index; last as isLast\"\r\n class=\"progress-tab ml-2\"\r\n [class.is-active]=\"currentTab?.id === tab.id\">\r\n\r\n <i *ngIf=\"tab.completed\"\r\n class=\"ec-icon icon-check-circle mr-1 font-color-success\"></i>\r\n <span *ngIf=\"!tab.completed\">{{index+1}}.&nbsp;</span>\r\n <span>{{tab.label | translate}}</span>\r\n <i *ngIf=\"!isLast\" class=\"ec-icon icon-angle-down rotate-270 ml-2\"></i>\r\n</div>",
7981
+ styles: [":host{padding:0 1rem}.progress-tab,:host{align-items:center;display:flex}.progress-tab.is-active{font-weight:700}"]
7980
7982
  },] }
7981
7983
  ];
7982
7984
  WizardProgressComponent.ctorParameters = () => [];
@@ -7985,6 +7987,137 @@ WizardProgressComponent.propDecorators = {
7985
7987
  currentTab: [{ type: Input }]
7986
7988
  };
7987
7989
 
7990
+ class FormControlLabelComponent {
7991
+ constructor(validationMessageService, translateService) {
7992
+ this.validationMessageService = validationMessageService;
7993
+ this.translateService = translateService;
7994
+ /**
7995
+ * The form control label
7996
+ */
7997
+ this.label = '';
7998
+ /**
7999
+ * The position of the form control label (top|bottom|left)
8000
+ */
8001
+ this.labelPosition = "top";
8002
+ /**An optional string to show if any of the underlying controls has an error. If falsy, one of the
8003
+ * errors from the underlying controls will be used.
8004
+ */
8005
+ this.overrideValidationError = "";
8006
+ /**An optional flag to hide the validation messages.
8007
+ */
8008
+ this.hideValidationMessage = false;
8009
+ /**
8010
+ * All current validation errors
8011
+ *
8012
+ * @type {string}
8013
+ * @memberof FormControlBase
8014
+ */
8015
+ this.validationErrors = "";
8016
+ this.allControlsTouched = false;
8017
+ this.componentDestroyed = new Subject();
8018
+ }
8019
+ ngOnInit() {
8020
+ return __awaiter(this, void 0, void 0, function* () {
8021
+ // subscribe to statusChanges Observable to take any errors and translate them
8022
+ if (this.control) {
8023
+ this.control.statusChanges
8024
+ .pipe(takeUntil(this.componentDestroyed))
8025
+ .subscribe(() => {
8026
+ this.translateValidationMessages(this.getErrors(this.control));
8027
+ });
8028
+ // (re)set validation messages
8029
+ this.translateValidationMessages(this.getErrors(this.control));
8030
+ }
8031
+ if (this.id) {
8032
+ this.attrId = this.id;
8033
+ }
8034
+ });
8035
+ }
8036
+ /**
8037
+ * Angular onDestroy lifecyle hook.
8038
+ * Unsubscribe from any observables
8039
+ *
8040
+ * @see https://angular.io/guide/lifecycle-hooks
8041
+ * @memberof FormControlBase
8042
+ */
8043
+ ngOnDestroy() {
8044
+ this.componentDestroyed.next();
8045
+ this.componentDestroyed.unsubscribe();
8046
+ }
8047
+ getErrors(control) {
8048
+ control.markAsUntouched();
8049
+ let errors = null;
8050
+ let allTouched = true;
8051
+ let controlFound = false;
8052
+ forEachFormControl(control, (control) => {
8053
+ errors = this.assignErrors(control, errors);
8054
+ if (control.untouched) {
8055
+ allTouched = false;
8056
+ }
8057
+ controlFound = true;
8058
+ });
8059
+ if (control.errors) {
8060
+ errors = Object.assign(errors || {}, control.errors);
8061
+ }
8062
+ if (allTouched && controlFound) {
8063
+ control.markAsTouched();
8064
+ }
8065
+ return errors;
8066
+ }
8067
+ assignErrors(control, errors) {
8068
+ if (control.errors) {
8069
+ errors = Object.assign(errors || {}, control.errors);
8070
+ }
8071
+ return errors;
8072
+ }
8073
+ /**
8074
+ * Function that subscribes to the controls valueChanges Observable
8075
+ * to take any erros and translate them
8076
+ *
8077
+ * @param {*} [data]
8078
+ * @returns
8079
+ * @memberof FormControlBase
8080
+ */
8081
+ translateValidationMessages(errors) {
8082
+ return __awaiter(this, void 0, void 0, function* () {
8083
+ if (errors) {
8084
+ if (this.overrideValidationError) {
8085
+ this.validationErrors = this.translateService.instant(this.overrideValidationError);
8086
+ }
8087
+ else {
8088
+ let messages = yield this.validationMessageService.getErrorMessages(errors);
8089
+ if (messages) {
8090
+ this.validationErrors = messages.join('; ');
8091
+ }
8092
+ }
8093
+ }
8094
+ else {
8095
+ this.validationErrors = '';
8096
+ }
8097
+ });
8098
+ }
8099
+ }
8100
+ FormControlLabelComponent.decorators = [
8101
+ { type: Component, args: [{
8102
+ selector: 'ec-form-control-label',
8103
+ template: "<div class=\"control control-label-{{labelPosition}}\" [class.ec-untouched]=\"control?.untouched\">\r\n <label *ngIf=\"label\" ngPreserveWhitespaces>\r\n\r\n <span id=\"{{id}}_label\">{{label | translate}}</span>\r\n\r\n <span *ngIf=\"!hideValidationMessage && validationErrors && control?.touched && control?.invalid\">{{validationErrors | translate}}</span>\r\n </label>\r\n</div>",
8104
+ styles: ["@-webkit-keyframes spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}:host{color:#1a1a23;display:block;font-family:Roboto,-apple-system,BlinkMacSystemFont,Segoe UI,Oxygen,Ubuntu,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-size:1rem;margin-bottom:1rem;width:100%}:host :host-context(.form-condensed){margin-bottom:.5rem}:host .control{display:flex;flex-direction:column;width:100%}: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-bottom:0;margin-top: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{-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;background-clip:border-box;background-color:rgba(26,26,35,.12);background-image:none;border-color:transparent;color:#1a1a23;opacity:1;overflow:hidden;pointer-events:none;user-select:none;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:#fff8cc;background-image:url('data:image/svg+xml;charset=utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 32 32\"><path fill=\"rgba(26, 26, 35, 0.66)\" d=\"M20.21 20.21h-8.42L10.95 0h10.1l-.84 20.21zm-8.42 3.37h8.42V32h-8.42z\"/></svg>');background-position:.25em;background-repeat:no-repeat;background-size:1em 1em;padding-left:1.5em}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid:not(:focus),:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid:not(:focus){border-color:#ffe433}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button{background-color:#fff8cc}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button:not(:focus){border-color:#ffe433}:host .textbox-group{display:flex;position:relative}:host input:focus,:host select:focus,:host textarea:focus{outline:none}label{color:rgba(26,26,35,.66);display:block;font-size:.75rem;line-height:1;margin:.375rem 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-color:#fff;background-image:url('data:image/svg+xml;charset=utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 32 32\"><path fill=\"%23ffe433\" d=\"M31.32 21.69l-.09.18-2.48 4.35c-.36.54-.77.62-1.25.27-.12 0-.2 0-.2-.09L19.53 22v9.37a1.26 1.26 0 0 1-.72.67h-5.26c-.59 0-.83-.3-.83-.89 0-.12.15-.21.15-.27V22l-8 4.71h-.12c-.42.66-.8.21-1.16-.27L1 21.82a.82.82 0 0 1 .35-1.26l.18-.1L9 16 .87 11.47v-.09c0-.36-.39-.74-.09-1.16l2.75-4.35v-.09c0-.42.82-.54 1.29-.36l8 4.62V.89c0-.59.18-.89.77-.89h5c.65 0 .91.3.91.89V10l7.94-4.53c.48-.29.72-.21 1.08.27l2.32 4.35v.09c.66.48.45.89-.08 1.25L23 16l7.91 4.53v.09c-.04.18.53.54.41 1.07z\"/></svg>');background-position:.25em;background-repeat:no-repeat;background-size:1em 1em;border-color:#d2d7d9;padding-left:1.5em}.control.ec-untouched ::ng-deep input:required:not(:disabled).is-empty:focus{border-color:#0084a9;box-shadow:0 0 0 1px #0084a9;position:relative;z-index:1}.control-label-left{display:flex}"]
8105
+ },] }
8106
+ ];
8107
+ FormControlLabelComponent.ctorParameters = () => [
8108
+ { type: ValidationMessageService },
8109
+ { type: TranslateService }
8110
+ ];
8111
+ FormControlLabelComponent.propDecorators = {
8112
+ id: [{ type: Input }],
8113
+ attrId: [{ type: HostBinding, args: ['attr.id',] }],
8114
+ label: [{ type: Input }],
8115
+ control: [{ type: Input }],
8116
+ labelPosition: [{ type: Input }],
8117
+ overrideValidationError: [{ type: Input }],
8118
+ hideValidationMessage: [{ type: Input }]
8119
+ };
8120
+
7988
8121
  class ComponentsModule {
7989
8122
  /**
7990
8123
  * Providing services through the forRoot pattern here ensures that the components module and the importing
@@ -8062,7 +8195,8 @@ ComponentsModule.decorators = [
8062
8195
  TreeComponent,
8063
8196
  RelativeDatePipe,
8064
8197
  ResizableComponent,
8065
- HighlightTextPipe
8198
+ HighlightTextPipe,
8199
+ FormControlLabelComponent
8066
8200
  ],
8067
8201
  imports: [
8068
8202
  CommonModule,
@@ -8137,7 +8271,8 @@ ComponentsModule.decorators = [
8137
8271
  TreeComponent,
8138
8272
  RelativeDatePipe,
8139
8273
  ResizableComponent,
8140
- HighlightTextPipe
8274
+ HighlightTextPipe,
8275
+ FormControlLabelComponent
8141
8276
  ]
8142
8277
  },] }
8143
8278
  ];
@@ -9112,5 +9247,5 @@ class HierarchyBaseTestInjectorFactory {
9112
9247
  * Generated bundle index. Do not edit.
9113
9248
  */
9114
9249
 
9115
- export { AppBarComponent, AvatarComponent, BannerComponent, ButtonComponent, CacheService, CheckboxComponent, ClickAreaForDirective, CollapsibleToggleComponent, ComboboxComponent, ComponentsModule, ConfirmComponent, ConfirmDialogContext, CopyButtonDirective, CustomValidators, DateDisplayPipe, DateTimeHelper, DialogCloseDuration, DialogCloseEvent, DialogCloseLatestEvent, DialogComponent, DialogEvent, DialogGroupComponent, DialogOpenDuration, DialogOpenEndEvent, DialogOpenStartEvent, DialogResult, DialogService, DropdownComponent, ErrorService, FileTypeExtensions, FileUploadComponent, FormControlBase, FormControlComponent, FormGroupComponent, FormGroupHelper, HierarchyBase, HierarchyBaseTestInjectorFactory, HierarchyItem, HierarchyMocks, HierarchyTreeComponent, HighlightTextPipe, IfViewportWidthDirective, ItemDisplayComponent, JsonDisplayComponent, JsonHelper, MenuComponent, MockActivatedRoute, MockDateDisplayPipe, MockDialog, MockDialogContent, MockTranslateService, MockTranslationHelperService, NavGroup, NavItemActiveDirective, NumericboxComponent, Overlay, PageBaseComponent, PageBaseComponentTestHelper, PageBaseComponentTestInjectorFactory, PageInitResult, PageStatus, PageStatuses, PageTitleComponent, PageViewComponent, PanelCloseDuration, PanelOpenDuration, PopoverComponent, PopupContainerDirective, RadioButtonComponent, RadioButtonOption, RelativeDatePipe, ResizableBase, ResizableColumnComponent, ResizableComponent, RowCountPipe, ScrollService, SearchableTableComponent, SelectComponent, SpinnerComponent, SplashComponent, SplashService, SpyFactory, TableComponent, TableLockedColumnComponent, TableMasterHeaderRowComponent, TableMasterRowComponent, TablePaginationComponent, TableSelectableRowComponent, TableSelectableRowContext, TabsComponent, Tag, TagsComponent, TelemetryService, TelemetryTrackerService, TextboxComponent, TimeDisplayPipe, ToastComponent, ToastEvent, ToastService, ToasterComponent, TreeComponent, UnicodeStrings, UserPreferenceService, ValidationMessageService, ViewOverlayComponent, WindowService, WizardBaseComponent, WizardButtonsComponent, WizardProgressComponent, canadianPostalCodeRegex, clickEvent, dateInputFormatRegex, domainPattern, findAllSpacesPattern, forEachFormControl, getApiError, getControlValue, getDecimalPattern, integerPattern, isApiError, menuAnimationSpeed, mockRouterFactory, numericboxValidation, orderByIgnoreCase, otherZipCodeRegex, phoneNumberValidationPattern, sortByIgnoreCase, textboxValidation, unitedStatesZipCodeRegex, urlValidationPattern, validateFormGroupValuesAreUnique, ResizableTableDirective as ɵa, AvatarService as ɵb, TableDetailRowComponent as ɵc };
9250
+ export { AppBarComponent, AvatarComponent, BannerComponent, ButtonComponent, CacheService, CheckboxComponent, ClickAreaForDirective, CollapsibleToggleComponent, ComboboxComponent, ComponentsModule, ConfirmComponent, ConfirmDialogContext, CopyButtonDirective, CustomValidators, DateDisplayPipe, DateTimeHelper, DialogCloseDuration, DialogCloseEvent, DialogCloseLatestEvent, DialogComponent, DialogEvent, DialogGroupComponent, DialogOpenDuration, DialogOpenEndEvent, DialogOpenStartEvent, DialogResult, DialogService, DropdownComponent, ErrorService, FileTypeExtensions, FileUploadComponent, FormControlBase, FormControlComponent, FormControlLabelComponent, FormGroupComponent, FormGroupHelper, HierarchyBase, HierarchyBaseTestInjectorFactory, HierarchyItem, HierarchyMocks, HierarchyTreeComponent, HighlightTextPipe, IfViewportWidthDirective, ItemDisplayComponent, JsonDisplayComponent, JsonHelper, MenuComponent, MockActivatedRoute, MockDateDisplayPipe, MockDialog, MockDialogContent, MockTranslateService, MockTranslationHelperService, NavGroup, NavItemActiveDirective, NumericboxComponent, Overlay, PageBaseComponent, PageBaseComponentTestHelper, PageBaseComponentTestInjectorFactory, PageInitResult, PageStatus, PageStatuses, PageTitleComponent, PageViewComponent, PanelCloseDuration, PanelOpenDuration, PopoverComponent, PopupContainerDirective, RadioButtonComponent, RadioButtonOption, RelativeDatePipe, ResizableBase, ResizableColumnComponent, ResizableComponent, RowCountPipe, ScrollService, SearchableTableComponent, SelectComponent, SpinnerComponent, SplashComponent, SplashService, SpyFactory, TableComponent, TableLockedColumnComponent, TableMasterHeaderRowComponent, TableMasterRowComponent, TablePaginationComponent, TableSelectableRowComponent, TableSelectableRowContext, TabsComponent, Tag, TagsComponent, TelemetryService, TelemetryTrackerService, TextboxComponent, TimeDisplayPipe, ToastComponent, ToastEvent, ToastService, ToasterComponent, TreeComponent, UnicodeStrings, UserPreferenceService, ValidationMessageService, ViewOverlayComponent, WindowService, WizardBaseComponent, WizardButtonsComponent, WizardProgressComponent, canadianPostalCodeRegex, clickEvent, dateInputFormatRegex, domainPattern, findAllSpacesPattern, forEachFormControl, getApiError, getControlValue, getDecimalPattern, integerPattern, isApiError, menuAnimationSpeed, mockRouterFactory, numericboxValidation, orderByIgnoreCase, otherZipCodeRegex, phoneNumberValidationPattern, sortByIgnoreCase, textboxValidation, unitedStatesZipCodeRegex, urlValidationPattern, validateFormGroupValuesAreUnique, ResizableTableDirective as ɵa, AvatarService as ɵb, TableDetailRowComponent as ɵc };
9116
9251
  //# sourceMappingURL=energycap-components.js.map