@energycap/components 0.25.1 → 0.26.0

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.
@@ -5661,9 +5661,13 @@
5661
5661
  this.el = el;
5662
5662
  /**
5663
5663
  * Number of the current page.
5664
- * Initial value is 1, can be overriden to change the starting page number.
5664
+ * Initial value is 1, can be overridden to change the starting page number.
5665
5665
  */
5666
5666
  this.pageNumber = 1;
5667
+ /**
5668
+ * Maximum number of page tabs to show
5669
+ */
5670
+ this.maxTabs = 10;
5667
5671
  /**
5668
5672
  * Emits when the page changes.
5669
5673
  *
@@ -5763,14 +5767,15 @@
5763
5767
  //keep building menu items of the form 1-10, 11-20, 21-30, etc until
5764
5768
  //end >= lastPage, which means we've found the range that contains the last page.
5765
5769
  var start = 1;
5766
- var end = 10;
5770
+ var maxTabs = this.maxTabs || 10;
5771
+ var end = maxTabs;
5767
5772
  while (end < lastPage) {
5768
5773
  this.dropdownItems.push({
5769
5774
  label: start + "-" + end,
5770
5775
  value: { firstPage: start, lastPage: end }
5771
5776
  });
5772
- start = start + 10;
5773
- end = end + 10;
5777
+ start = start + maxTabs;
5778
+ end = end + maxTabs;
5774
5779
  }
5775
5780
  //add the menu item that contains the last page.
5776
5781
  this.dropdownItems.push({
@@ -5797,6 +5802,7 @@
5797
5802
  totalItems: [{ type: i0.Input }],
5798
5803
  pageSize: [{ type: i0.Input }],
5799
5804
  pageNumber: [{ type: i0.Input }],
5805
+ maxTabs: [{ type: i0.Input }],
5800
5806
  pageChanged: [{ type: i0.Output }]
5801
5807
  };
5802
5808
 
@@ -5922,6 +5928,10 @@
5922
5928
  }
5923
5929
  */
5924
5930
  this.pageable = false;
5931
+ /**
5932
+ * Maximum number of page tabs to show
5933
+ */
5934
+ this.maxTabs = 10;
5925
5935
  /**
5926
5936
  * Makes the searchbox readonly if true.
5927
5937
  */
@@ -6077,7 +6087,7 @@
6077
6087
  SearchableTableComponent.decorators = [
6078
6088
  { type: i0.Component, args: [{
6079
6089
  selector: 'ec-searchable-table',
6080
- 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=\"card m-0 d-flex flex-column bg-content\"\r\n [class.is-translucent]=\"status.status !== 'error'\"\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 <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 [selectionContext]=\"selectionContext\"\r\n [selectionToolbarTemplate]=\"selectionToolbarTemplate\"\r\n [resizableColumns]=\"resizableColumns\">\r\n <ng-content></ng-content>\r\n </ec-table>\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!\" class=\"d-flex flex-shrink align-items-center border-top\">\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 [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 [class.has-results]=\"searchResults?.items?.length\">\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>",
6090
+ 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=\"card m-0 d-flex flex-column bg-content\"\r\n [class.is-translucent]=\"status.status !== 'error'\"\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 <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 [selectionContext]=\"selectionContext\"\r\n [selectionToolbarTemplate]=\"selectionToolbarTemplate\"\r\n [resizableColumns]=\"resizableColumns\">\r\n <ng-content></ng-content>\r\n </ec-table>\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!\" class=\"d-flex flex-shrink align-items-center border-top\">\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 [class.has-results]=\"searchResults?.items?.length\">\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>",
6081
6091
  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}footer{font-size:.75rem;line-height:1rem}footer.has-results{border-top:1px solid rgba(26,26,35,.18);color:rgba(26,26,35,.38);text-align:right}"]
6082
6092
  },] }
6083
6093
  ];
@@ -6113,6 +6123,7 @@
6113
6123
  hideFooter: [{ type: i0.Input }],
6114
6124
  pageable: [{ type: i0.Input }],
6115
6125
  pageSize: [{ type: i0.Input }],
6126
+ maxTabs: [{ type: i0.Input }],
6116
6127
  searchboxReadonly: [{ type: i0.Input }],
6117
6128
  selectionContext: [{ type: i0.Input }],
6118
6129
  selectionToolbarTemplate: [{ type: i0.Input }],
@@ -7560,6 +7571,7 @@
7560
7571
  function ToastComponent(toastService) {
7561
7572
  this.toastService = toastService;
7562
7573
  this.open = false;
7574
+ this.TOAST_ANIMATION_DURATION = 250;
7563
7575
  this.closed = new i0.EventEmitter();
7564
7576
  this.TIMED_TOAST_DURATION = 4000;
7565
7577
  this.destroyed = new rxjs.Subject();
@@ -7586,8 +7598,11 @@
7586
7598
  this.destroyed.complete();
7587
7599
  };
7588
7600
  ToastComponent.prototype.close = function () {
7601
+ var _this = this;
7589
7602
  this.open = false;
7590
- this.closed.emit(this.toastItem);
7603
+ rxjs.timer(this.TOAST_ANIMATION_DURATION).subscribe(function () {
7604
+ _this.closed.emit(_this.toastItem);
7605
+ });
7591
7606
  };
7592
7607
  ToastComponent.prototype.closeAfterTimer = function () {
7593
7608
  var _this = this;
@@ -7601,7 +7616,7 @@
7601
7616
  { type: i0.Component, args: [{
7602
7617
  selector: 'ec-toast',
7603
7618
  template: "<ec-banner id=\"{{toastItem?.id}}_banner\"\r\n [type]=\"toastItem?.type\"\r\n bannerStyle=\"toast\"\r\n [customIcon]=\"toastItem?.icon\"\r\n [showCloseBtn]=\"toastItem?.dismissible\"\r\n [autoHideOnClose]=\"false\"\r\n (closed)=\"close()\">\r\n <div class=\"d-flex\">\r\n <p id=\"{{toastItem?.id}}_message\"\r\n class=\"mb-0\">{{toastItem?.message}}</p>\r\n <a id=\"{{toastItem?.id}}_action\"\r\n *ngIf=\"toastItem?.action && toastItem?.actionLabel\"\r\n class=\"text-link ml-2\"\r\n (click)=\"toastItem!.action!()\">{{toastItem?.actionLabel | translate}}</a>\r\n </div>\r\n</ec-banner>",
7604
- styles: [":host{bottom:-100%;display:block;left:50%;position:fixed;transform:translateX(-50%);z-index:1000}:host.open{bottom:calc(var(--toast-bottom, 0rem) + 1.5rem)}"]
7619
+ styles: [":host{bottom:0;display:block;left:50%;position:fixed;transform:translate(-50%,100%);transition:transform var(--toast-animation-duration,.25s);transition-timing-function:ease-in;z-index:70}:host.is-open{transform:translate(-50%,calc(var(--toast-bottom, 0rem)*-1 - 1.5rem));transition-timing-function:cubic-bezier(.18,.89,.32,1.28)}"]
7605
7620
  },] }
7606
7621
  ];
7607
7622
  ToastComponent.ctorParameters = function () { return [
@@ -7610,7 +7625,8 @@
7610
7625
  ToastComponent.propDecorators = {
7611
7626
  toastItem: [{ type: i0.Input }],
7612
7627
  id: [{ type: i0.HostBinding, args: ['attr.id',] }],
7613
- open: [{ type: i0.HostBinding, args: ['class.open',] }],
7628
+ open: [{ type: i0.HostBinding, args: ['class.is-open',] }],
7629
+ TOAST_ANIMATION_DURATION: [{ type: i0.HostBinding, args: ['style.--toast-animation-duration.ms',] }],
7614
7630
  closed: [{ type: i0.Output }]
7615
7631
  };
7616
7632
 
@@ -7683,7 +7699,7 @@
7683
7699
  */
7684
7700
  ToasterComponent.prototype.updateDismissibleToastBottom = function () {
7685
7701
  if (this.currentTimedToast && this.timedToastEl) {
7686
- this.dismissibleToastBottom = this.timedToastEl.nativeElement.offsetHeight + 8;
7702
+ this.dismissibleToastBottom = (this.timedToastEl.nativeElement.offsetHeight + 8) / 16;
7687
7703
  }
7688
7704
  else {
7689
7705
  this.dismissibleToastBottom = 0;
@@ -7694,7 +7710,7 @@
7694
7710
  ToasterComponent.decorators = [
7695
7711
  { type: i0.Component, args: [{
7696
7712
  selector: 'ec-toaster',
7697
- template: "<ec-toast [toastItem]=\"currentDismissibleToast\"\r\n [style.--toast-bottom.px]=\"dismissibleToastBottom\"\r\n (closed)=\"updateVisibleToast($event)\">\r\n</ec-toast>\r\n\r\n<ec-toast #timedToast\r\n [toastItem]=\"currentTimedToast\"\r\n (closed)=\"updateVisibleToast($event)\">\r\n</ec-toast>\r\n"
7713
+ template: "<ec-toast [toastItem]=\"currentDismissibleToast\"\r\n [style.--toast-bottom.rem]=\"dismissibleToastBottom\"\r\n (closed)=\"updateVisibleToast($event)\">\r\n</ec-toast>\r\n\r\n<ec-toast #timedToast\r\n [toastItem]=\"currentTimedToast\"\r\n (closed)=\"updateVisibleToast($event)\">\r\n</ec-toast>"
7698
7714
  },] }
7699
7715
  ];
7700
7716
  ToasterComponent.ctorParameters = function () { return [