@energycap/components 0.26.6 → 0.26.7-email-css-improvements.20211124-1106

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.
@@ -725,6 +725,29 @@
725
725
  resizableColumns: [{ type: i0.Input }]
726
726
  };
727
727
 
728
+ var ResizableColumnComponent = /** @class */ (function () {
729
+ function ResizableColumnComponent(el) {
730
+ this.el = el;
731
+ this.onResize = new i0.EventEmitter();
732
+ }
733
+ ResizableColumnComponent.prototype.emitWidth = function (width) {
734
+ this.onResize.emit(width);
735
+ };
736
+ return ResizableColumnComponent;
737
+ }());
738
+ ResizableColumnComponent.decorators = [
739
+ { type: i0.Component, args: [{
740
+ selector: 'th.is-resizable',
741
+ template: "<div class=\"content-wrapper\">\r\n <div class=\"content\">\r\n <ng-content></ng-content>\r\n </div>\r\n</div>\r\n<div class=\"handle\"></div>\r\n"
742
+ },] }
743
+ ];
744
+ ResizableColumnComponent.ctorParameters = function () { return [
745
+ { type: i0.ElementRef }
746
+ ]; };
747
+ ResizableColumnComponent.propDecorators = {
748
+ onResize: [{ type: i0.Output }]
749
+ };
750
+
728
751
  var TableMasterRowComponent = /** @class */ (function () {
729
752
  function TableMasterRowComponent(renderer, el) {
730
753
  this.renderer = renderer;
@@ -868,29 +891,6 @@
868
891
  detailRowTemplate: [{ type: i0.ViewChild, args: ['detailRow', { read: i0.TemplateRef, static: true },] }]
869
892
  };
870
893
 
871
- var ResizableColumnComponent = /** @class */ (function () {
872
- function ResizableColumnComponent(el) {
873
- this.el = el;
874
- this.onResize = new i0.EventEmitter();
875
- }
876
- ResizableColumnComponent.prototype.emitWidth = function (width) {
877
- this.onResize.emit(width);
878
- };
879
- return ResizableColumnComponent;
880
- }());
881
- ResizableColumnComponent.decorators = [
882
- { type: i0.Component, args: [{
883
- selector: 'th.is-resizable',
884
- template: "<div class=\"content-wrapper\">\r\n <div class=\"content\">\r\n <ng-content></ng-content>\r\n </div>\r\n</div>\r\n<div class=\"handle\"></div>\r\n"
885
- },] }
886
- ];
887
- ResizableColumnComponent.ctorParameters = function () { return [
888
- { type: i0.ElementRef }
889
- ]; };
890
- ResizableColumnComponent.propDecorators = {
891
- onResize: [{ type: i0.Output }]
892
- };
893
-
894
894
  var TableComponent = /** @class */ (function () {
895
895
  function TableComponent(renderer, el) {
896
896
  this.renderer = renderer;
@@ -965,11 +965,6 @@
965
965
  }
966
966
  }
967
967
  };
968
- TableComponent.prototype.ngOnInit = function () {
969
- if (this.selectionContext) {
970
- this.selectable = true;
971
- }
972
- };
973
968
  TableComponent.prototype.ngAfterContentInit = function () {
974
969
  var _this = this;
975
970
  this.hasMasterDetailRows = !!this.masterRows.length;
@@ -1093,7 +1088,7 @@
1093
1088
  sortable: [{ type: i0.HostBinding, args: ['class.is-sortable',] }, { type: i0.Input }],
1094
1089
  selectionContext: [{ type: i0.Input }],
1095
1090
  selectionToolbarTemplate: [{ type: i0.Input }],
1096
- selectable: [{ type: i0.HostBinding, args: ['class.is-selectable',] }],
1091
+ selectable: [{ type: i0.HostBinding, args: ['class.is-selectable',] }, { type: i0.Input }],
1097
1092
  isForm: [{ type: i0.HostBinding, args: ['class.is-form-table',] }, { type: i0.Input }],
1098
1093
  sort: [{ type: i0.Input }],
1099
1094
  sortChange: [{ type: i0.Output }],
@@ -5867,8 +5862,7 @@
5867
5862
  this.sortable = false;
5868
5863
  this.autofocus = false;
5869
5864
  /**Set to a space-separated set of strings that should be added to the ec-table class attribute
5870
- * this allows finer control over styling, including the ability to turn on selectable highlights
5871
- * by including is-selectable
5865
+ * this allows finer control over styling.
5872
5866
  */
5873
5867
  this.tableClasses = '';
5874
5868
  /** Emits when table sort has changed */
@@ -5943,6 +5937,8 @@
5943
5937
  this.searchboxReadonly = false;
5944
5938
  /** Optional text to add to the results count in the table footer. This text will be added after the count and objectType. */
5945
5939
  this.additionalCountText = '';
5940
+ /** Enables table row selection and row highlighting styles when true */
5941
+ this.selectable = false;
5946
5942
  /**
5947
5943
  * Text displayed in the footer.
5948
5944
  * Sometimes `noDataMessage`, sometimes `noSearchResultsMessage`
@@ -6092,7 +6088,7 @@
6092
6088
  SearchableTableComponent.decorators = [
6093
6089
  { type: i0.Component, args: [{
6094
6090
  selector: 'ec-searchable-table',
6095
- 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>",
6091
+ 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 [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\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>",
6096
6092
  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}"]
6097
6093
  },] }
6098
6094
  ];
@@ -6133,7 +6129,8 @@
6133
6129
  selectionContext: [{ type: i0.Input }],
6134
6130
  selectionToolbarTemplate: [{ type: i0.Input }],
6135
6131
  resizableColumns: [{ type: i0.ContentChildren, args: [ResizableColumnComponent, { descendants: true },] }],
6136
- additionalCountText: [{ type: i0.Input }]
6132
+ additionalCountText: [{ type: i0.Input }],
6133
+ selectable: [{ type: i0.Input }]
6137
6134
  };
6138
6135
 
6139
6136
  /**
@@ -6796,6 +6793,7 @@
6796
6793
  function TableSelectableRowComponent() {
6797
6794
  /**The ID root to use for the checkbox and table cell */
6798
6795
  this.id = '';
6796
+ this._enabled = true;
6799
6797
  /*Required for all rows. The row index this component represents, to allow it to know how to handle shift+clicks.
6800
6798
  Defaults to -1 which will cause the directive to behave as a header row*/
6801
6799
  this.rowIndex = -1;
@@ -6814,6 +6812,13 @@
6814
6812
  /**Sends an event when the component is destroyed so that it can unsubscribe from any observables */
6815
6813
  this.destroyed = new rxjs.Subject();
6816
6814
  }
6815
+ Object.defineProperty(TableSelectableRowComponent.prototype, "enabled", {
6816
+ get: function () { return this._enabled; },
6817
+ /** Disables the selection functionality when false */
6818
+ set: function (value) { this._enabled = value !== false; },
6819
+ enumerable: false,
6820
+ configurable: true
6821
+ });
6817
6822
  /**Validate and populate the context as the table is dynamically built. Because the context is shared between the
6818
6823
  * header and each of the rows, changes to it can be used to determine what is happening and hook up the correct
6819
6824
  * subscriptions for selectAll. The user can provide an existing formArray for the rows and form control for the header,
@@ -6839,10 +6844,14 @@
6839
6844
  * recreated from scratch. Re-capture the correct form control to keep everything in sync
6840
6845
  */
6841
6846
  TableSelectableRowComponent.prototype.ngOnChanges = function (changes) {
6847
+ var _a;
6842
6848
  if (changes.rowIndex && !this.isHeader) {
6843
6849
  this.formControl = this.context.rowCheckboxes.at(this.rowIndex);
6844
6850
  this.checkboxAttributeID = this.id + "_row" + this.rowIndex + "_ecCheckbox";
6845
6851
  }
6852
+ if (changes.enabled && !this.enabled && ((_a = this.formControl) === null || _a === void 0 ? void 0 : _a.value) === true) {
6853
+ this.formControl.setValue(false);
6854
+ }
6846
6855
  };
6847
6856
  /** Tell the header checkbox to refresh the selectAll subscription because a row was removed*/
6848
6857
  TableSelectableRowComponent.prototype.ngOnDestroy = function () {
@@ -6862,7 +6871,7 @@
6862
6871
  */
6863
6872
  TableSelectableRowComponent.prototype.rowClicked = function (event) {
6864
6873
  var _a, _b, _c;
6865
- if (!this.isHeader) {
6874
+ if (!this.isHeader && this.enabled) {
6866
6875
  var targetEl = event === null || event === void 0 ? void 0 : event.target;
6867
6876
  var isCheckboxClick = (_c = (_b = (_a = targetEl === null || targetEl === void 0 ? void 0 : targetEl.classList) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === null || _c === void 0 ? void 0 : _c.includes('row-checkbox');
6868
6877
  //normally clicking on a row checks only that row and unchecks everything else.
@@ -6938,12 +6947,13 @@
6938
6947
  TableSelectableRowComponent.decorators = [
6939
6948
  { type: i0.Component, args: [{
6940
6949
  selector: '[ecTableSelectableRow]',
6941
- template: "<!-- any elements of the existing table row that must go before the row selection checkbox can be marked with a class of before-checkbox -->\r\n<ng-content select=\".before-checkbox\"></ng-content>\r\n<th *ngIf=\"isHeader\"\r\n class=\"checkbox\"\r\n [ecTableLockedColumn]=\"lockedColOptions\">\r\n <ec-checkbox id=\"{{id}}_selectAll\"\r\n class=\"m-0\"\r\n *ngIf=\"context?.selectAllCheckbox\"\r\n [formModel]=\"context?.selectAllCheckbox\"\r\n [dependentCheckboxesGroup]=\"dependentCheckboxesReference\">\r\n </ec-checkbox>\r\n</th>\r\n<td *ngIf=\"!isHeader && formControl\" \r\n class=\"checkbox\"\r\n [ecTableLockedColumn]=\"lockedColOptions\">\r\n <ec-checkbox id=\"{{id}}_row{{rowIndex}}_checkbox\"\r\n [attr.id]=\"checkboxAttributeID\"\r\n class=\"m-0 row-checkbox\"\r\n [formModel]=\"formControl\">\r\n </ec-checkbox>\r\n</td>\r\n<!-- The rest of the table row -->\r\n<ng-content></ng-content>\r\n",
6942
- styles: [":host:not(.is-header){cursor:pointer}:host .checkbox{padding-left:1px;padding-right:1px;width:1.125rem}:host .checkbox:first-child{padding-left:.5rem;width:1.5625rem}td.checkbox ec-checkbox ::ng-deep *{pointer-events:none}"]
6950
+ template: "<!-- any elements of the existing table row that must go before the row selection checkbox can be marked with a class of before-checkbox -->\r\n<ng-content select=\".before-checkbox\"></ng-content>\r\n<ng-container *ngIf=\"enabled\">\r\n <th *ngIf=\"isHeader\"\r\n class=\"checkbox\"\r\n [ecTableLockedColumn]=\"lockedColOptions\">\r\n <ec-checkbox id=\"{{id}}_selectAll\"\r\n class=\"m-0\"\r\n *ngIf=\"context?.selectAllCheckbox\"\r\n [formModel]=\"context?.selectAllCheckbox\"\r\n [dependentCheckboxesGroup]=\"dependentCheckboxesReference\">\r\n </ec-checkbox>\r\n </th>\r\n <td *ngIf=\"!isHeader && formControl\"\r\n class=\"checkbox\"\r\n [ecTableLockedColumn]=\"lockedColOptions\">\r\n <ec-checkbox id=\"{{id}}_row{{rowIndex}}_checkbox\"\r\n [attr.id]=\"checkboxAttributeID\"\r\n class=\"m-0 row-checkbox\"\r\n [formModel]=\"formControl\">\r\n </ec-checkbox>\r\n </td>\r\n</ng-container>\r\n<!-- The rest of the table row -->\r\n<ng-content></ng-content>",
6951
+ styles: [":host.is-enabled:not(.is-header){cursor:pointer}:host .checkbox{padding-left:1px;padding-right:1px;width:1.125rem}:host .checkbox:first-child{padding-left:.5rem;width:1.5625rem}td.checkbox ec-checkbox ::ng-deep *{pointer-events:none}"]
6943
6952
  },] }
6944
6953
  ];
6945
6954
  TableSelectableRowComponent.propDecorators = {
6946
6955
  id: [{ type: i0.HostBinding, args: ['attr.id',] }, { type: i0.Input }],
6956
+ enabled: [{ type: i0.HostBinding, args: ['class.is-enabled',] }, { type: i0.Input, args: ['ecTableSelectableRow',] }],
6947
6957
  context: [{ type: i0.Input, args: ['selectionContext',] }],
6948
6958
  rowIndex: [{ type: i0.Input }],
6949
6959
  lockedColOptions: [{ type: i0.Input }],
@@ -7627,7 +7637,7 @@
7627
7637
  ToastComponent.decorators = [
7628
7638
  { type: i0.Component, args: [{
7629
7639
  selector: 'ec-toast',
7630
- 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)=\"closeClicked()\">\r\n <div class=\"d-flex\">\r\n <p id=\"{{toastItem?.id}}_message\"\r\n class=\"mb-0\">{{toastItem?.message | translate}}</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>",
7640
+ 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)=\"closeClicked()\">\r\n <div class=\"d-flex\">\r\n <div id=\"{{toastItem?.id}}_message\"\r\n [innerHTML]=\"toastItem?.message | translate\"></div>\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>",
7631
7641
  styles: [":host{bottom:0;display:block;left:50%;position:fixed;transform:translate(-50%,150%);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)}"]
7632
7642
  },] }
7633
7643
  ];