@energycap/components 0.27.4 → 0.27.7

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.
@@ -869,6 +869,9 @@
869
869
  case 'passwordInvalid':
870
870
  translationObservables.push(this.translate.get('PasswordInvalidValidationMessage_LC'));
871
871
  break;
872
+ case 'domain':
873
+ translationObservables.push(this.translate.get('DomainValidationMessage_SC'));
874
+ break;
872
875
  default:
873
876
  break;
874
877
  }
@@ -2653,6 +2656,12 @@
2653
2656
  * Item currently highlighted by keyboard navigation
2654
2657
  */
2655
2658
  this.highlightedItem = null;
2659
+ /**
2660
+ * Tells the menu to maintain the selected/lastSelected item. Turning this off is useful for
2661
+ * action type menus that are displayed on the screen at all times and you do not
2662
+ * want the item to be selected when clicked.
2663
+ */
2664
+ this.maintainSelectedItem = true;
2656
2665
  /**
2657
2666
  * Emitted when `selected` is changed. Emits the referenced object.
2658
2667
  *
@@ -2755,8 +2764,14 @@
2755
2764
  else {
2756
2765
  this.onSelection(item);
2757
2766
  }
2758
- this.selected = item;
2759
- this.lastSelected = item;
2767
+ if (this.maintainSelectedItem) {
2768
+ this.selected = item;
2769
+ this.lastSelected = item;
2770
+ }
2771
+ else {
2772
+ this.selected = null;
2773
+ this.lastSelected = null;
2774
+ }
2760
2775
  }
2761
2776
  };
2762
2777
  /**
@@ -3000,6 +3015,7 @@
3000
3015
  noDataText: [{ type: i0.Input }],
3001
3016
  enableKeyNav: [{ type: i0.Input }],
3002
3017
  highlightedItem: [{ type: i0.Input }],
3018
+ maintainSelectedItem: [{ type: i0.Input }],
3003
3019
  selectedChanged: [{ type: i0.Output }],
3004
3020
  menuClosed: [{ type: i0.Output }],
3005
3021
  labelTemplate: [{ type: i0.ViewChild, args: ['label', { static: true },] }],
@@ -3849,6 +3865,8 @@
3849
3865
  * invalidate if just a minus sign is entered in the input, any digit `0-9` is allowed
3850
3866
  */
3851
3867
  var integerPattern = new RegExp("^(-)?([\\d]+)?$");
3868
+ /** Pattern to validate most public domains */
3869
+ var domainPattern = /^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$/;
3852
3870
  /**
3853
3871
  * Function to return a decimal RegExp. Takes in the number of decimals to validate
3854
3872
  * against
@@ -6957,7 +6975,7 @@
6957
6975
  SearchableTableComponent.decorators = [
6958
6976
  { type: i0.Component, args: [{
6959
6977
  selector: 'ec-searchable-table',
6960
- template: "<header *ngIf=\"!hideHeader\"\r\n class=\"d-flex flex-shrink align-items-center mb-3\">\r\n <ec-textbox id=\"{{id}}_searchbox\"\r\n *ngIf=\"!hideSearchControl\"\r\n class=\"mb-0 flex-grow mr-2\"\r\n [autofocus]=\"autofocus\"\r\n [formModel]=\"searchModel\"\r\n [tabindex]=\"searchboxTabIndex\"\r\n [placeholder]=\"searchboxPlaceholder\"\r\n [readonly]=\"searchboxReadonly\"></ec-textbox>\r\n <div class=\"flex-grow\">\r\n <ng-content select=\".searchable-table-controls\"></ng-content>\r\n </div>\r\n</header>\r\n<section id=\"{{id}}_card\"\r\n class=\"d-flex flex-column flex-grow\"\r\n [ngClass]=\"{'is-translucent': status.status !== 'error', 'has-mask': status.status !== 'hasData', 'card m-0 bg-content': !customContentTemplate, 'bg-body': customContentTemplate}\"\r\n ecOverlay\r\n [status]=\"status.status\"\r\n [message]=\"status.message\"\r\n [displayAsMask]=\"true\">\r\n <ng-content select=\".card-header\"></ng-content>\r\n <ng-container *ngTemplateOutlet=\"customContentTemplate || defaultContentTemplate\">\r\n </ng-container>\r\n\r\n <!-- the default template is an ec-table with proxied-over searchable table inputs. \r\n If that doesn't work for you then you can specify a customContentTemplate to use instead\r\n and still retain all the event handling, header, footer pagination, etc support -->\r\n <ng-template #defaultContentTemplate>\r\n <ec-table id=\"{{id}}_table\"\r\n class=\"flex-shrink-max {{tableClasses}}\"\r\n [class.is-fixed]=\"tableLayoutFixed\"\r\n [sortable]=\"sortable\"\r\n [sort]=\"sort\"\r\n (sortChange)=\"onSortChange($event)\"\r\n [resizable]=\"resizable\"\r\n [scrollable]=\"true\"\r\n [selectable]=\"selectable\"\r\n [selectionContext]=\"selectionContext\"\r\n [selectionToolbarTemplate]=\"selectionToolbarTemplate\"\r\n [resizableColumns]=\"resizableColumns\">\r\n <ng-content></ng-content>\r\n </ec-table>\r\n </ng-template>\r\n\r\n <!-- pagination footer visible if table is page-able and there are more than one page of results -->\r\n <footer *ngIf=\"!hideFooter && pageable && searchResults.totalItemsBeforePaging! > pageSize!\"\r\n class=\"d-flex flex-shrink align-items-center\"\r\n [class.border-top]=\"!customContentTemplate\">\r\n <ec-table-pagination id=\"{{id}}_pager\"\r\n class=\"font-color-primary\"\r\n [totalItems]=\"searchResults.totalItemsBeforePaging\"\r\n [pageSize]=\"pageSize\"\r\n [maxTabs]=\"maxTabs\"\r\n [pageNumber]=\"pageInfo?.pageNumber\"\r\n (pageChanged)=\"onPageChange($event)\">\r\n </ec-table-pagination>\r\n <div id=\"resultsCount\"\r\n *ngIf=\"searchResults?.items?.length\"\r\n class=\"ml-auto mr-2 font-color-hint text-truncate\" \r\n title=\"{{resultsCount}} {{additionalCountText}}\">{{resultsCount}} {{additionalCountText}}</div>\r\n </footer>\r\n\r\n <!-- default footer: visible if hideFooter is false and table is not page-able or there are only one page of results (always shows if there is a caption to indicate no results) -->\r\n <footer *ngIf=\"(!hideFooter && (!pageable || searchResults.totalItemsBeforePaging! <= pageSize!)) || tableCaption\"\r\n class=\"p-2 d-flex\"\r\n [ngClass]=\"{'has-results': searchResults?.items?.length, 'border-top': searchResults?.items?.length && !customContentTemplate}\">\r\n <ng-content *ngIf=\"!tableCaption\"\r\n select=\".searchable-table-footer\"></ng-content>\r\n <div id=\"tableCaption\"\r\n *ngIf=\"tableCaption\"\r\n [innerHTML]=\"tableCaption\"></div>\r\n <div id=\"resultsCount\"\r\n *ngIf=\"searchResults?.items?.length\"\r\n class=\"ml-auto text-truncate\"\r\n title=\"{{resultsCount}} {{additionalCountText}}\">{{resultsCount}} {{additionalCountText}}</div>\r\n </footer>\r\n</section>",
6978
+ template: "<header *ngIf=\"!hideHeader\"\r\n class=\"d-flex flex-shrink align-items-center mb-3\">\r\n <ec-textbox id=\"{{id}}_searchbox\"\r\n *ngIf=\"!hideSearchControl\"\r\n class=\"mb-0 flex-grow mr-2\"\r\n [autofocus]=\"autofocus\"\r\n [formModel]=\"searchModel\"\r\n [tabindex]=\"searchboxTabIndex\"\r\n [placeholder]=\"searchboxPlaceholder\"\r\n [readonly]=\"searchboxReadonly\"></ec-textbox>\r\n <div class=\"flex-grow\">\r\n <ng-content select=\".searchable-table-controls\"></ng-content>\r\n </div>\r\n</header>\r\n<section id=\"{{id}}_card\"\r\n class=\"d-flex flex-column flex-shrink-max\"\r\n [ngClass]=\"{'is-translucent': status.status !== 'error', 'has-mask': status.status !== 'hasData', 'card m-0 bg-content': !customContentTemplate, 'bg-body': customContentTemplate}\"\r\n ecOverlay\r\n [status]=\"status.status\"\r\n [message]=\"status.message\"\r\n [displayAsMask]=\"true\">\r\n <ng-content select=\".card-header\"></ng-content>\r\n <ng-container *ngTemplateOutlet=\"customContentTemplate || defaultContentTemplate\">\r\n </ng-container>\r\n\r\n <!-- the default template is an ec-table with proxied-over searchable table inputs. \r\n If that doesn't work for you then you can specify a customContentTemplate to use instead\r\n and still retain all the event handling, header, footer pagination, etc support -->\r\n <ng-template #defaultContentTemplate>\r\n <ec-table id=\"{{id}}_table\"\r\n class=\"flex-shrink-max {{tableClasses}}\"\r\n [class.is-fixed]=\"tableLayoutFixed\"\r\n [sortable]=\"sortable\"\r\n [sort]=\"sort\"\r\n (sortChange)=\"onSortChange($event)\"\r\n [resizable]=\"resizable\"\r\n [scrollable]=\"true\"\r\n [selectable]=\"selectable\"\r\n [selectionContext]=\"selectionContext\"\r\n [selectionToolbarTemplate]=\"selectionToolbarTemplate\"\r\n [resizableColumns]=\"resizableColumns\">\r\n <ng-content></ng-content>\r\n </ec-table>\r\n </ng-template>\r\n\r\n <!-- pagination footer visible if table is page-able and there are more than one page of results -->\r\n <footer *ngIf=\"!hideFooter && pageable && searchResults.totalItemsBeforePaging! > pageSize!\"\r\n class=\"d-flex flex-shrink align-items-center\"\r\n [class.border-top]=\"!customContentTemplate\">\r\n <ec-table-pagination id=\"{{id}}_pager\"\r\n class=\"font-color-primary\"\r\n [totalItems]=\"searchResults.totalItemsBeforePaging\"\r\n [pageSize]=\"pageSize\"\r\n [maxTabs]=\"maxTabs\"\r\n [pageNumber]=\"pageInfo?.pageNumber\"\r\n (pageChanged)=\"onPageChange($event)\">\r\n </ec-table-pagination>\r\n <div id=\"resultsCount\"\r\n *ngIf=\"searchResults?.items?.length\"\r\n class=\"ml-auto mr-2 font-color-hint text-truncate\" \r\n title=\"{{resultsCount}} {{additionalCountText}}\">{{resultsCount}} {{additionalCountText}}</div>\r\n </footer>\r\n\r\n <!-- default footer: visible if hideFooter is false and table is not page-able or there are only one page of results (always shows if there is a caption to indicate no results) -->\r\n <footer *ngIf=\"(!hideFooter && (!pageable || searchResults.totalItemsBeforePaging! <= pageSize!)) || tableCaption\"\r\n class=\"p-2 d-flex\"\r\n [ngClass]=\"{'has-results': searchResults?.items?.length, 'border-top': searchResults?.items?.length && !customContentTemplate}\">\r\n <ng-content *ngIf=\"!tableCaption\"\r\n select=\".searchable-table-footer\"></ng-content>\r\n <div id=\"tableCaption\"\r\n *ngIf=\"tableCaption\"\r\n [innerHTML]=\"tableCaption\"></div>\r\n <div id=\"resultsCount\"\r\n *ngIf=\"searchResults?.items?.length\"\r\n class=\"ml-auto text-truncate\"\r\n title=\"{{resultsCount}} {{additionalCountText}}\">{{resultsCount}} {{additionalCountText}}</div>\r\n </footer>\r\n</section>",
6961
6979
  styles: ["@-webkit-keyframes spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}:host{display:flex;flex:1 1;flex-direction:column;min-height:0}:host ::ng-deep .card-header+ec-table.is-selectable th{height:2.5rem;padding-bottom:.9375rem}:host ::ng-deep .card-header+ec-table.is-selectable th.is-resizable .handle{padding-top:.5rem}:host ::ng-deep .card-header+ec-table.is-selectable th.is-resizable .handle:before{top:.5rem}:host ::ng-deep .card-header+ec-table.is-selectable .selectable-table-toolbar{height:2.5rem;padding-bottom:.5rem}footer{font-size:.75rem;line-height:1rem}footer.has-results{color:rgba(26,26,35,.38);text-align:right}.card.has-mask{min-height:15rem}"]
6962
6980
  },] }
6963
6981
  ];
@@ -8154,6 +8172,34 @@
8154
8172
  width: [{ type: i0.Input, args: ['ecIfViewportWidth',] }]
8155
8173
  };
8156
8174
 
8175
+ var HighlightTextPipe = /** @class */ (function () {
8176
+ function HighlightTextPipe() {
8177
+ }
8178
+ HighlightTextPipe.prototype.transform = function (value, searchText) {
8179
+ var transformedValue = '';
8180
+ if (value && searchText) {
8181
+ var regex = new RegExp(this.escapeRegex(searchText), 'gi');
8182
+ transformedValue = value.replace(regex, this.strongWrap);
8183
+ }
8184
+ else {
8185
+ transformedValue = value;
8186
+ }
8187
+ return transformedValue;
8188
+ };
8189
+ HighlightTextPipe.prototype.strongWrap = function (match) {
8190
+ return "<strong class=\"text-highlight\">" + match + "</strong>";
8191
+ };
8192
+ HighlightTextPipe.prototype.escapeRegex = function (value) {
8193
+ return value.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
8194
+ };
8195
+ return HighlightTextPipe;
8196
+ }());
8197
+ HighlightTextPipe.decorators = [
8198
+ { type: i0.Pipe, args: [{
8199
+ name: 'highlightText'
8200
+ },] }
8201
+ ];
8202
+
8157
8203
  /**
8158
8204
  * Format a time to the user's preference for display
8159
8205
  */
@@ -8637,7 +8683,8 @@
8637
8683
  HierarchyTreeComponent,
8638
8684
  TreeComponent,
8639
8685
  RelativeDatePipe,
8640
- ResizableComponent
8686
+ ResizableComponent,
8687
+ HighlightTextPipe
8641
8688
  ],
8642
8689
  imports: [
8643
8690
  common.CommonModule,
@@ -8655,7 +8702,8 @@
8655
8702
  TimeDisplayPipe,
8656
8703
  MockDateDisplayPipe,
8657
8704
  RowCountPipe,
8658
- RelativeDatePipe
8705
+ RelativeDatePipe,
8706
+ HighlightTextPipe
8659
8707
  ],
8660
8708
  exports: [
8661
8709
  ButtonComponent,
@@ -8710,7 +8758,8 @@
8710
8758
  HierarchyTreeComponent,
8711
8759
  TreeComponent,
8712
8760
  RelativeDatePipe,
8713
- ResizableComponent
8761
+ ResizableComponent,
8762
+ HighlightTextPipe
8714
8763
  ]
8715
8764
  },] }
8716
8765
  ];
@@ -8817,6 +8866,12 @@
8817
8866
  */
8818
8867
  CustomValidators.json = function (control) {
8819
8868
  return (control.value && JsonHelper.tryParseJSON(control.value) === undefined) ? { json: true } : null;
8869
+ };
8870
+ /**
8871
+ * Returns a validation error if the control's value is not a valid domain.
8872
+ */
8873
+ CustomValidators.domain = function (control) {
8874
+ return (control.value && domainPattern.test(control.value) === false) ? { domain: true } : null;
8820
8875
  };
8821
8876
 
8822
8877
  (function (PageStatus) {
@@ -9854,6 +9909,7 @@
9854
9909
  exports.HierarchyBaseTestInjectorFactory = HierarchyBaseTestInjectorFactory;
9855
9910
  exports.HierarchyItem = HierarchyItem;
9856
9911
  exports.HierarchyTreeComponent = HierarchyTreeComponent;
9912
+ exports.HighlightTextPipe = HighlightTextPipe;
9857
9913
  exports.IfViewportWidthDirective = IfViewportWidthDirective;
9858
9914
  exports.ItemDisplayComponent = ItemDisplayComponent;
9859
9915
  exports.JsonDisplayComponent = JsonDisplayComponent;
@@ -9924,6 +9980,7 @@
9924
9980
  exports.canadianPostalCodeRegex = canadianPostalCodeRegex;
9925
9981
  exports.clickEvent = clickEvent;
9926
9982
  exports.dateInputFormatRegex = dateInputFormatRegex;
9983
+ exports.domainPattern = domainPattern;
9927
9984
  exports.findAllSpacesPattern = findAllSpacesPattern;
9928
9985
  exports.forEachFormControl = forEachFormControl;
9929
9986
  exports.getApiError = getApiError;