@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.
- package/bundles/energycap-components.umd.js +47 -37
- package/bundles/energycap-components.umd.js.map +1 -1
- package/bundles/energycap-components.umd.min.js +1 -1
- package/bundles/energycap-components.umd.min.js.map +1 -1
- package/energycap-components.metadata.json +1 -1
- package/energycap-email.min.css +1 -1
- package/esm2015/lib/display/table/searchable-table.component.js +7 -5
- package/esm2015/lib/display/table/table-selectable-row.component.js +13 -4
- package/esm2015/lib/display/table/table.component.js +6 -11
- package/esm2015/lib/display/toast/toast/toast.component.js +2 -2
- package/fesm2015/energycap-components.js +42 -36
- package/fesm2015/energycap-components.js.map +1 -1
- package/lib/display/table/searchable-table.component.d.ts +3 -2
- package/lib/display/table/table-selectable-row.component.d.ts +4 -0
- package/lib/display/table/table.component.d.ts +2 -3
- package/package.json +1 -1
- package/src/assets/images/email-icon.png +0 -0
- package/src/assets/images/email-logo.png +0 -0
- package/src/styles/email/_email-base.scss +50 -49
- package/src/styles/email/email.scss +27 -44
|
@@ -402,6 +402,28 @@ ResizableTableDirective.propDecorators = {
|
|
|
402
402
|
resizableColumns: [{ type: Input }]
|
|
403
403
|
};
|
|
404
404
|
|
|
405
|
+
class ResizableColumnComponent {
|
|
406
|
+
constructor(el) {
|
|
407
|
+
this.el = el;
|
|
408
|
+
this.onResize = new EventEmitter();
|
|
409
|
+
}
|
|
410
|
+
emitWidth(width) {
|
|
411
|
+
this.onResize.emit(width);
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
ResizableColumnComponent.decorators = [
|
|
415
|
+
{ type: Component, args: [{
|
|
416
|
+
selector: 'th.is-resizable',
|
|
417
|
+
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"
|
|
418
|
+
},] }
|
|
419
|
+
];
|
|
420
|
+
ResizableColumnComponent.ctorParameters = () => [
|
|
421
|
+
{ type: ElementRef }
|
|
422
|
+
];
|
|
423
|
+
ResizableColumnComponent.propDecorators = {
|
|
424
|
+
onResize: [{ type: Output }]
|
|
425
|
+
};
|
|
426
|
+
|
|
405
427
|
class TableMasterRowComponent {
|
|
406
428
|
constructor(renderer, el) {
|
|
407
429
|
this.renderer = renderer;
|
|
@@ -572,6 +594,7 @@ class TableSelectableRowComponent {
|
|
|
572
594
|
constructor() {
|
|
573
595
|
/**The ID root to use for the checkbox and table cell */
|
|
574
596
|
this.id = '';
|
|
597
|
+
this._enabled = true;
|
|
575
598
|
/*Required for all rows. The row index this component represents, to allow it to know how to handle shift+clicks.
|
|
576
599
|
Defaults to -1 which will cause the directive to behave as a header row*/
|
|
577
600
|
this.rowIndex = -1;
|
|
@@ -590,6 +613,9 @@ class TableSelectableRowComponent {
|
|
|
590
613
|
/**Sends an event when the component is destroyed so that it can unsubscribe from any observables */
|
|
591
614
|
this.destroyed = new Subject();
|
|
592
615
|
}
|
|
616
|
+
/** Disables the selection functionality when false */
|
|
617
|
+
set enabled(value) { this._enabled = value !== false; }
|
|
618
|
+
get enabled() { return this._enabled; }
|
|
593
619
|
/**Validate and populate the context as the table is dynamically built. Because the context is shared between the
|
|
594
620
|
* header and each of the rows, changes to it can be used to determine what is happening and hook up the correct
|
|
595
621
|
* subscriptions for selectAll. The user can provide an existing formArray for the rows and form control for the header,
|
|
@@ -615,10 +641,14 @@ class TableSelectableRowComponent {
|
|
|
615
641
|
* recreated from scratch. Re-capture the correct form control to keep everything in sync
|
|
616
642
|
*/
|
|
617
643
|
ngOnChanges(changes) {
|
|
644
|
+
var _a;
|
|
618
645
|
if (changes.rowIndex && !this.isHeader) {
|
|
619
646
|
this.formControl = this.context.rowCheckboxes.at(this.rowIndex);
|
|
620
647
|
this.checkboxAttributeID = `${this.id}_row${this.rowIndex}_ecCheckbox`;
|
|
621
648
|
}
|
|
649
|
+
if (changes.enabled && !this.enabled && ((_a = this.formControl) === null || _a === void 0 ? void 0 : _a.value) === true) {
|
|
650
|
+
this.formControl.setValue(false);
|
|
651
|
+
}
|
|
622
652
|
}
|
|
623
653
|
/** Tell the header checkbox to refresh the selectAll subscription because a row was removed*/
|
|
624
654
|
ngOnDestroy() {
|
|
@@ -637,7 +667,7 @@ class TableSelectableRowComponent {
|
|
|
637
667
|
*/
|
|
638
668
|
rowClicked(event) {
|
|
639
669
|
var _a, _b, _c;
|
|
640
|
-
if (!this.isHeader) {
|
|
670
|
+
if (!this.isHeader && this.enabled) {
|
|
641
671
|
let targetEl = event === null || event === void 0 ? void 0 : event.target;
|
|
642
672
|
let 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');
|
|
643
673
|
//normally clicking on a row checks only that row and unchecks everything else.
|
|
@@ -711,12 +741,13 @@ class TableSelectableRowComponent {
|
|
|
711
741
|
TableSelectableRowComponent.decorators = [
|
|
712
742
|
{ type: Component, args: [{
|
|
713
743
|
selector: '[ecTableSelectableRow]',
|
|
714
|
-
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
|
|
715
|
-
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}"]
|
|
744
|
+
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>",
|
|
745
|
+
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}"]
|
|
716
746
|
},] }
|
|
717
747
|
];
|
|
718
748
|
TableSelectableRowComponent.propDecorators = {
|
|
719
749
|
id: [{ type: HostBinding, args: ['attr.id',] }, { type: Input }],
|
|
750
|
+
enabled: [{ type: HostBinding, args: ['class.is-enabled',] }, { type: Input, args: ['ecTableSelectableRow',] }],
|
|
720
751
|
context: [{ type: Input, args: ['selectionContext',] }],
|
|
721
752
|
rowIndex: [{ type: Input }],
|
|
722
753
|
lockedColOptions: [{ type: Input }],
|
|
@@ -725,28 +756,6 @@ TableSelectableRowComponent.propDecorators = {
|
|
|
725
756
|
rowClicked: [{ type: HostListener, args: ['click', ['$event'],] }]
|
|
726
757
|
};
|
|
727
758
|
|
|
728
|
-
class ResizableColumnComponent {
|
|
729
|
-
constructor(el) {
|
|
730
|
-
this.el = el;
|
|
731
|
-
this.onResize = new EventEmitter();
|
|
732
|
-
}
|
|
733
|
-
emitWidth(width) {
|
|
734
|
-
this.onResize.emit(width);
|
|
735
|
-
}
|
|
736
|
-
}
|
|
737
|
-
ResizableColumnComponent.decorators = [
|
|
738
|
-
{ type: Component, args: [{
|
|
739
|
-
selector: 'th.is-resizable',
|
|
740
|
-
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"
|
|
741
|
-
},] }
|
|
742
|
-
];
|
|
743
|
-
ResizableColumnComponent.ctorParameters = () => [
|
|
744
|
-
{ type: ElementRef }
|
|
745
|
-
];
|
|
746
|
-
ResizableColumnComponent.propDecorators = {
|
|
747
|
-
onResize: [{ type: Output }]
|
|
748
|
-
};
|
|
749
|
-
|
|
750
759
|
class TableComponent {
|
|
751
760
|
constructor(renderer, el) {
|
|
752
761
|
this.renderer = renderer;
|
|
@@ -821,11 +830,6 @@ class TableComponent {
|
|
|
821
830
|
}
|
|
822
831
|
}
|
|
823
832
|
}
|
|
824
|
-
ngOnInit() {
|
|
825
|
-
if (this.selectionContext) {
|
|
826
|
-
this.selectable = true;
|
|
827
|
-
}
|
|
828
|
-
}
|
|
829
833
|
ngAfterContentInit() {
|
|
830
834
|
this.hasMasterDetailRows = !!this.masterRows.length;
|
|
831
835
|
this.masterRows.changes.pipe(takeUntil(this.destroyed)).subscribe(() => {
|
|
@@ -945,7 +949,7 @@ TableComponent.propDecorators = {
|
|
|
945
949
|
sortable: [{ type: HostBinding, args: ['class.is-sortable',] }, { type: Input }],
|
|
946
950
|
selectionContext: [{ type: Input }],
|
|
947
951
|
selectionToolbarTemplate: [{ type: Input }],
|
|
948
|
-
selectable: [{ type: HostBinding, args: ['class.is-selectable',] }],
|
|
952
|
+
selectable: [{ type: HostBinding, args: ['class.is-selectable',] }, { type: Input }],
|
|
949
953
|
isForm: [{ type: HostBinding, args: ['class.is-form-table',] }, { type: Input }],
|
|
950
954
|
sort: [{ type: Input }],
|
|
951
955
|
sortChange: [{ type: Output }],
|
|
@@ -5523,8 +5527,7 @@ class SearchableTableComponent {
|
|
|
5523
5527
|
this.sortable = false;
|
|
5524
5528
|
this.autofocus = false;
|
|
5525
5529
|
/**Set to a space-separated set of strings that should be added to the ec-table class attribute
|
|
5526
|
-
* this allows finer control over styling
|
|
5527
|
-
* by including is-selectable
|
|
5530
|
+
* this allows finer control over styling.
|
|
5528
5531
|
*/
|
|
5529
5532
|
this.tableClasses = '';
|
|
5530
5533
|
/** Emits when table sort has changed */
|
|
@@ -5599,6 +5602,8 @@ class SearchableTableComponent {
|
|
|
5599
5602
|
this.searchboxReadonly = false;
|
|
5600
5603
|
/** Optional text to add to the results count in the table footer. This text will be added after the count and objectType. */
|
|
5601
5604
|
this.additionalCountText = '';
|
|
5605
|
+
/** Enables table row selection and row highlighting styles when true */
|
|
5606
|
+
this.selectable = false;
|
|
5602
5607
|
/**
|
|
5603
5608
|
* Text displayed in the footer.
|
|
5604
5609
|
* Sometimes `noDataMessage`, sometimes `noSearchResultsMessage`
|
|
@@ -5740,7 +5745,7 @@ class SearchableTableComponent {
|
|
|
5740
5745
|
SearchableTableComponent.decorators = [
|
|
5741
5746
|
{ type: Component, args: [{
|
|
5742
5747
|
selector: 'ec-searchable-table',
|
|
5743
|
-
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>",
|
|
5748
|
+
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>",
|
|
5744
5749
|
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}"]
|
|
5745
5750
|
},] }
|
|
5746
5751
|
];
|
|
@@ -5781,7 +5786,8 @@ SearchableTableComponent.propDecorators = {
|
|
|
5781
5786
|
selectionContext: [{ type: Input }],
|
|
5782
5787
|
selectionToolbarTemplate: [{ type: Input }],
|
|
5783
5788
|
resizableColumns: [{ type: ContentChildren, args: [ResizableColumnComponent, { descendants: true },] }],
|
|
5784
|
-
additionalCountText: [{ type: Input }]
|
|
5789
|
+
additionalCountText: [{ type: Input }],
|
|
5790
|
+
selectable: [{ type: Input }]
|
|
5785
5791
|
};
|
|
5786
5792
|
|
|
5787
5793
|
/**
|
|
@@ -6994,7 +7000,7 @@ class ToastComponent {
|
|
|
6994
7000
|
ToastComponent.decorators = [
|
|
6995
7001
|
{ type: Component, args: [{
|
|
6996
7002
|
selector: 'ec-toast',
|
|
6997
|
-
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 <
|
|
7003
|
+
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>",
|
|
6998
7004
|
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)}"]
|
|
6999
7005
|
},] }
|
|
7000
7006
|
];
|