@energycap/components 0.26.1 → 0.26.3-ECAP-11517-disable-selectable-table-rows.20211111-0918
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 +166 -45
- 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.d.ts +1 -0
- package/energycap-components.metadata.json +1 -1
- package/esm2015/energycap-components.js +2 -1
- package/esm2015/lib/components.module.js +19 -1
- package/esm2015/lib/controls/banner/banner.component.js +1 -1
- package/esm2015/lib/core/telemetry-base.service.js +3 -0
- package/esm2015/lib/core/telemetry.service.js +15 -0
- package/esm2015/lib/display/table/searchable-table.component.js +7 -5
- package/esm2015/lib/display/table/table-selectable-row.component.js +11 -3
- package/esm2015/lib/display/table/table.component.js +6 -11
- package/esm2015/lib/display/toast/toast/toast.component.js +13 -6
- package/esm2015/lib/display/toast/toaster/toaster.component.js +30 -5
- package/esm2015/lib/shared/display/pipes/time-display.pipe.js +40 -0
- package/esm2015/public-api.js +3 -1
- package/fesm2015/energycap-components.js +149 -45
- package/fesm2015/energycap-components.js.map +1 -1
- package/lib/components.module.d.ts +11 -0
- package/lib/core/telemetry-base.service.d.ts +25 -0
- package/lib/core/telemetry.service.d.ts +11 -0
- 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/lib/display/toast/toast/toast.component.d.ts +4 -3
- package/lib/display/toast/toaster/toaster.component.d.ts +6 -3
- package/lib/shared/display/pipes/time-display.pipe.d.ts +15 -0
- package/package.json +1 -1
- package/public-api.d.ts +2 -0
|
@@ -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 }],
|
|
@@ -1159,7 +1154,7 @@
|
|
|
1159
1154
|
{ type: i0.Component, args: [{
|
|
1160
1155
|
selector: 'ec-banner',
|
|
1161
1156
|
template: "<div class=\"banner {{type}} {{bannerStyle}}\">\r\n <ec-button id=\"banner{{id}}_close\"\r\n *ngIf=\"showCloseBtn\"\r\n type=\"icon\"\r\n icon=\"ec-icon-sm icon-cancel\"\r\n (clicked)=\"close()\">\r\n </ec-button>\r\n <div class=\"banner-content d-flex text-body-1 font-color-secondary\">\r\n <i class=\"ec-icon {{icon}}\"></i>\r\n <div class=\"ml-2\">\r\n <p class=\"title mb-0\" *ngIf=\"title\">\r\n {{title}}\r\n </p>\r\n <p class=\"text mb-0\" *ngIf=\"text\">{{text}}</p>\r\n \r\n <ul class=\"list mb-0\" *ngIf=\"list?.length\">\r\n <li *ngFor=\"let item of list\">{{item}}</li>\r\n </ul>\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n\r\n</div>\r\n",
|
|
1162
|
-
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}:host(.border-bottom-0) .banner{border-bottom:0}.banner{display:flex;flex:1 1;flex-direction:column;min-height:2.5rem;overflow-y:auto;position:relative}.banner-content{flex:none;margin:auto 0;padding:.5rem 1rem}ec-button{position:absolute;right:.25rem;top:.25rem}ec-button+.banner-content{padding-right:2.75rem}.title{font-weight:700}.list{margin:0;padding-left:
|
|
1157
|
+
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}:host(.border-bottom-0) .banner{border-bottom:0}.banner{display:flex;flex:1 1;flex-direction:column;min-height:2.5rem;overflow-y:auto;position:relative}.banner-content{flex:none;margin:auto 0;padding:.5rem 1rem}.banner-content ::ng-deep p{line-height:inherit}.ec-icon{font-size:1.125rem}ec-button{position:absolute;right:.25rem;top:.25rem}ec-button+.banner-content{padding-right:2.75rem}.title{font-weight:700}.list{margin:0;padding-left:2em}.text+.list{margin-top:1em}.info{background-color:#dae4e9}.info .banner-content>.ec-icon{color:#2d9ab8}.warning{background-color:#fff8cc}.warning .banner-content>.ec-icon{color:#fa7b2e}.success{background-color:#dff0d8}.success .banner-content>.ec-icon{color:#3c763d}.error{background-color:#ecc4c5}.error .banner-content>.ec-icon{color:#cd1d20}.pinned{border-bottom:1px solid rgba(26,26,35,.08)}.toast{border:1px solid rgba(26,26,35,.08);box-shadow:0 .125rem .625rem 0 rgba(26,26,35,.18)}.toast ec-button{right:.1875rem;top:.1875rem}"]
|
|
1163
1158
|
},] }
|
|
1164
1159
|
];
|
|
1165
1160
|
BannerComponent.propDecorators = {
|
|
@@ -5862,8 +5857,7 @@
|
|
|
5862
5857
|
this.sortable = false;
|
|
5863
5858
|
this.autofocus = false;
|
|
5864
5859
|
/**Set to a space-separated set of strings that should be added to the ec-table class attribute
|
|
5865
|
-
* this allows finer control over styling
|
|
5866
|
-
* by including is-selectable
|
|
5860
|
+
* this allows finer control over styling.
|
|
5867
5861
|
*/
|
|
5868
5862
|
this.tableClasses = '';
|
|
5869
5863
|
/** Emits when table sort has changed */
|
|
@@ -5938,6 +5932,8 @@
|
|
|
5938
5932
|
this.searchboxReadonly = false;
|
|
5939
5933
|
/** Optional text to add to the results count in the table footer. This text will be added after the count and objectType. */
|
|
5940
5934
|
this.additionalCountText = '';
|
|
5935
|
+
/** Enables table row selection and row highlighting styles when true */
|
|
5936
|
+
this.selectable = false;
|
|
5941
5937
|
/**
|
|
5942
5938
|
* Text displayed in the footer.
|
|
5943
5939
|
* Sometimes `noDataMessage`, sometimes `noSearchResultsMessage`
|
|
@@ -6087,7 +6083,7 @@
|
|
|
6087
6083
|
SearchableTableComponent.decorators = [
|
|
6088
6084
|
{ type: i0.Component, args: [{
|
|
6089
6085
|
selector: 'ec-searchable-table',
|
|
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>",
|
|
6086
|
+
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>",
|
|
6091
6087
|
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}"]
|
|
6092
6088
|
},] }
|
|
6093
6089
|
];
|
|
@@ -6128,7 +6124,8 @@
|
|
|
6128
6124
|
selectionContext: [{ type: i0.Input }],
|
|
6129
6125
|
selectionToolbarTemplate: [{ type: i0.Input }],
|
|
6130
6126
|
resizableColumns: [{ type: i0.ContentChildren, args: [ResizableColumnComponent, { descendants: true },] }],
|
|
6131
|
-
additionalCountText: [{ type: i0.Input }]
|
|
6127
|
+
additionalCountText: [{ type: i0.Input }],
|
|
6128
|
+
selectable: [{ type: i0.Input }]
|
|
6132
6129
|
};
|
|
6133
6130
|
|
|
6134
6131
|
/**
|
|
@@ -6791,6 +6788,7 @@
|
|
|
6791
6788
|
function TableSelectableRowComponent() {
|
|
6792
6789
|
/**The ID root to use for the checkbox and table cell */
|
|
6793
6790
|
this.id = '';
|
|
6791
|
+
this._enabled = true;
|
|
6794
6792
|
/*Required for all rows. The row index this component represents, to allow it to know how to handle shift+clicks.
|
|
6795
6793
|
Defaults to -1 which will cause the directive to behave as a header row*/
|
|
6796
6794
|
this.rowIndex = -1;
|
|
@@ -6809,6 +6807,13 @@
|
|
|
6809
6807
|
/**Sends an event when the component is destroyed so that it can unsubscribe from any observables */
|
|
6810
6808
|
this.destroyed = new rxjs.Subject();
|
|
6811
6809
|
}
|
|
6810
|
+
Object.defineProperty(TableSelectableRowComponent.prototype, "enabled", {
|
|
6811
|
+
get: function () { return this._enabled; },
|
|
6812
|
+
/** Disables the selection functionality when false */
|
|
6813
|
+
set: function (value) { this._enabled = value !== false; },
|
|
6814
|
+
enumerable: false,
|
|
6815
|
+
configurable: true
|
|
6816
|
+
});
|
|
6812
6817
|
/**Validate and populate the context as the table is dynamically built. Because the context is shared between the
|
|
6813
6818
|
* header and each of the rows, changes to it can be used to determine what is happening and hook up the correct
|
|
6814
6819
|
* subscriptions for selectAll. The user can provide an existing formArray for the rows and form control for the header,
|
|
@@ -6838,6 +6843,9 @@
|
|
|
6838
6843
|
this.formControl = this.context.rowCheckboxes.at(this.rowIndex);
|
|
6839
6844
|
this.checkboxAttributeID = this.id + "_row" + this.rowIndex + "_ecCheckbox";
|
|
6840
6845
|
}
|
|
6846
|
+
if (changes.enabled && !this.enabled) {
|
|
6847
|
+
this.formControl.setValue(false);
|
|
6848
|
+
}
|
|
6841
6849
|
};
|
|
6842
6850
|
/** Tell the header checkbox to refresh the selectAll subscription because a row was removed*/
|
|
6843
6851
|
TableSelectableRowComponent.prototype.ngOnDestroy = function () {
|
|
@@ -6857,7 +6865,7 @@
|
|
|
6857
6865
|
*/
|
|
6858
6866
|
TableSelectableRowComponent.prototype.rowClicked = function (event) {
|
|
6859
6867
|
var _a, _b, _c;
|
|
6860
|
-
if (!this.isHeader) {
|
|
6868
|
+
if (!this.isHeader && this.enabled) {
|
|
6861
6869
|
var targetEl = event === null || event === void 0 ? void 0 : event.target;
|
|
6862
6870
|
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');
|
|
6863
6871
|
//normally clicking on a row checks only that row and unchecks everything else.
|
|
@@ -6933,12 +6941,13 @@
|
|
|
6933
6941
|
TableSelectableRowComponent.decorators = [
|
|
6934
6942
|
{ type: i0.Component, args: [{
|
|
6935
6943
|
selector: '[ecTableSelectableRow]',
|
|
6936
|
-
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
|
|
6944
|
+
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>",
|
|
6937
6945
|
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}"]
|
|
6938
6946
|
},] }
|
|
6939
6947
|
];
|
|
6940
6948
|
TableSelectableRowComponent.propDecorators = {
|
|
6941
6949
|
id: [{ type: i0.HostBinding, args: ['attr.id',] }, { type: i0.Input }],
|
|
6950
|
+
enabled: [{ type: i0.Input, args: ['ecTableSelectableRow',] }],
|
|
6942
6951
|
context: [{ type: i0.Input, args: ['selectionContext',] }],
|
|
6943
6952
|
rowIndex: [{ type: i0.Input }],
|
|
6944
6953
|
lockedColOptions: [{ type: i0.Input }],
|
|
@@ -7580,7 +7589,7 @@
|
|
|
7580
7589
|
var _this = this;
|
|
7581
7590
|
this.toastService.events.pipe(operators.takeUntil(this.destroyed)).subscribe(function (event) {
|
|
7582
7591
|
if (event.action == 'remove' && event.toast === _this.toastItem) {
|
|
7583
|
-
_this.close();
|
|
7592
|
+
_this.close(event);
|
|
7584
7593
|
}
|
|
7585
7594
|
});
|
|
7586
7595
|
};
|
|
@@ -7597,17 +7606,24 @@
|
|
|
7597
7606
|
this.destroyed.next();
|
|
7598
7607
|
this.destroyed.complete();
|
|
7599
7608
|
};
|
|
7600
|
-
ToastComponent.prototype.
|
|
7609
|
+
ToastComponent.prototype.closeClicked = function () {
|
|
7610
|
+
if (this.toastItem) {
|
|
7611
|
+
this.toastService.dismissToast(this.toastItem, 'user');
|
|
7612
|
+
}
|
|
7613
|
+
};
|
|
7614
|
+
ToastComponent.prototype.close = function (event) {
|
|
7601
7615
|
var _this = this;
|
|
7602
7616
|
this.open = false;
|
|
7603
7617
|
rxjs.timer(this.TOAST_ANIMATION_DURATION).subscribe(function () {
|
|
7604
|
-
_this.closed.emit(
|
|
7618
|
+
_this.closed.emit(event);
|
|
7605
7619
|
});
|
|
7606
7620
|
};
|
|
7607
7621
|
ToastComponent.prototype.closeAfterTimer = function () {
|
|
7608
7622
|
var _this = this;
|
|
7609
7623
|
rxjs.timer(this.TIMED_TOAST_DURATION).pipe(operators.takeUntil(rxjs.race(this.closed, this.destroyed))).subscribe(function () {
|
|
7610
|
-
_this.
|
|
7624
|
+
if (_this.toastItem) {
|
|
7625
|
+
_this.toastService.dismissToast(_this.toastItem, 'auto');
|
|
7626
|
+
}
|
|
7611
7627
|
});
|
|
7612
7628
|
};
|
|
7613
7629
|
return ToastComponent;
|
|
@@ -7615,7 +7631,7 @@
|
|
|
7615
7631
|
ToastComponent.decorators = [
|
|
7616
7632
|
{ type: i0.Component, args: [{
|
|
7617
7633
|
selector: 'ec-toast',
|
|
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)=\"
|
|
7634
|
+
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}}</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>",
|
|
7619
7635
|
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)}"]
|
|
7620
7636
|
},] }
|
|
7621
7637
|
];
|
|
@@ -7630,9 +7646,33 @@
|
|
|
7630
7646
|
closed: [{ type: i0.Output }]
|
|
7631
7647
|
};
|
|
7632
7648
|
|
|
7649
|
+
var TelemetryBaseService = /** @class */ (function () {
|
|
7650
|
+
function TelemetryBaseService() {
|
|
7651
|
+
}
|
|
7652
|
+
return TelemetryBaseService;
|
|
7653
|
+
}());
|
|
7654
|
+
|
|
7655
|
+
/** Default No-op telemetry implementation */
|
|
7656
|
+
var TelemetryService = /** @class */ (function (_super) {
|
|
7657
|
+
__extends(TelemetryService, _super);
|
|
7658
|
+
function TelemetryService() {
|
|
7659
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
7660
|
+
}
|
|
7661
|
+
TelemetryService.prototype.trackPageView = function (pageName, url, properties) { };
|
|
7662
|
+
TelemetryService.prototype.trackEvent = function (name, properties, measurements) { };
|
|
7663
|
+
return TelemetryService;
|
|
7664
|
+
}(TelemetryBaseService));
|
|
7665
|
+
TelemetryService.ɵprov = i0.ɵɵdefineInjectable({ factory: function TelemetryService_Factory() { return new TelemetryService(); }, token: TelemetryService, providedIn: "root" });
|
|
7666
|
+
TelemetryService.decorators = [
|
|
7667
|
+
{ type: i0.Injectable, args: [{
|
|
7668
|
+
providedIn: 'root'
|
|
7669
|
+
},] }
|
|
7670
|
+
];
|
|
7671
|
+
|
|
7633
7672
|
var ToasterComponent = /** @class */ (function () {
|
|
7634
|
-
function ToasterComponent(toastService) {
|
|
7673
|
+
function ToasterComponent(toastService, telemetryService) {
|
|
7635
7674
|
this.toastService = toastService;
|
|
7675
|
+
this.telemetryService = telemetryService;
|
|
7636
7676
|
this.dismissibleToastBottom = 0;
|
|
7637
7677
|
this.pendingToasts = [];
|
|
7638
7678
|
this.destroyed = new rxjs.Subject();
|
|
@@ -7643,9 +7683,11 @@
|
|
|
7643
7683
|
if (event.action == 'add') {
|
|
7644
7684
|
_this.addToast(event.toast);
|
|
7645
7685
|
_this.updateDismissibleToastBottom();
|
|
7686
|
+
_this.trackEvent(event);
|
|
7646
7687
|
}
|
|
7647
7688
|
else if (event.action == 'remove' && event.toast !== _this.currentDismissibleToast && event.toast !== _this.currentTimedToast) {
|
|
7648
7689
|
_this.removePendingToast(event.toast);
|
|
7690
|
+
_this.trackEvent(event);
|
|
7649
7691
|
}
|
|
7650
7692
|
});
|
|
7651
7693
|
};
|
|
@@ -7653,14 +7695,15 @@
|
|
|
7653
7695
|
this.destroyed.next();
|
|
7654
7696
|
this.destroyed.complete();
|
|
7655
7697
|
};
|
|
7656
|
-
ToasterComponent.prototype.updateVisibleToast = function (
|
|
7657
|
-
if (
|
|
7698
|
+
ToasterComponent.prototype.updateVisibleToast = function (event) {
|
|
7699
|
+
if (event.toast.dismissible) {
|
|
7658
7700
|
this.currentDismissibleToast = this.getNextToast(true);
|
|
7659
7701
|
}
|
|
7660
7702
|
else {
|
|
7661
7703
|
this.currentTimedToast = this.getNextToast(false);
|
|
7662
7704
|
}
|
|
7663
7705
|
this.updateDismissibleToastBottom();
|
|
7706
|
+
this.trackEvent(event);
|
|
7664
7707
|
};
|
|
7665
7708
|
ToasterComponent.prototype.addToast = function (toast) {
|
|
7666
7709
|
if ((toast.dismissible && this.currentDismissibleToast) || (!toast.dismissible && this.currentTimedToast)) {
|
|
@@ -7705,6 +7748,25 @@
|
|
|
7705
7748
|
this.dismissibleToastBottom = 0;
|
|
7706
7749
|
}
|
|
7707
7750
|
};
|
|
7751
|
+
ToasterComponent.prototype.trackEvent = function (event) {
|
|
7752
|
+
var _a, _b, _c;
|
|
7753
|
+
var dismissible = this.pendingToasts.filter(function (t) { return t.dismissible; });
|
|
7754
|
+
var transient = this.pendingToasts.filter(function (t) { return !t.dismissible; });
|
|
7755
|
+
this.telemetryService.trackEvent(event.action + " toast", {
|
|
7756
|
+
action: event.action,
|
|
7757
|
+
source: event.source,
|
|
7758
|
+
hasDismissiblePending: dismissible.length > 0 ? 'yes' : 'no',
|
|
7759
|
+
dismissiblePendingLength: "" + dismissible.length,
|
|
7760
|
+
hasTransientPending: transient.length > 0 ? 'yes' : 'no',
|
|
7761
|
+
transientPendingLength: "" + transient.length,
|
|
7762
|
+
toastId: (_a = event.toast.id) !== null && _a !== void 0 ? _a : '',
|
|
7763
|
+
toastType: event.toast.type,
|
|
7764
|
+
toastMessage: event.toast.message,
|
|
7765
|
+
toastDismissible: "" + event.toast.dismissible,
|
|
7766
|
+
toastIcon: (_b = event.toast.icon) !== null && _b !== void 0 ? _b : '',
|
|
7767
|
+
toastAction: (_c = event.toast.actionLabel) !== null && _c !== void 0 ? _c : '',
|
|
7768
|
+
});
|
|
7769
|
+
};
|
|
7708
7770
|
return ToasterComponent;
|
|
7709
7771
|
}());
|
|
7710
7772
|
ToasterComponent.decorators = [
|
|
@@ -7714,7 +7776,8 @@
|
|
|
7714
7776
|
},] }
|
|
7715
7777
|
];
|
|
7716
7778
|
ToasterComponent.ctorParameters = function () { return [
|
|
7717
|
-
{ type: ToastService }
|
|
7779
|
+
{ type: ToastService },
|
|
7780
|
+
{ type: TelemetryService }
|
|
7718
7781
|
]; };
|
|
7719
7782
|
ToasterComponent.propDecorators = {
|
|
7720
7783
|
timedToastEl: [{ type: i0.ViewChild, args: ['timedToast', { static: false, read: i0.ElementRef },] }]
|
|
@@ -7827,9 +7890,61 @@
|
|
|
7827
7890
|
subTitle: [{ type: i0.Input }]
|
|
7828
7891
|
};
|
|
7829
7892
|
|
|
7893
|
+
/**
|
|
7894
|
+
* Format a time to the user's preference for display
|
|
7895
|
+
*/
|
|
7896
|
+
var TimeDisplayPipe = /** @class */ (function () {
|
|
7897
|
+
function TimeDisplayPipe(userPreferenceService) {
|
|
7898
|
+
this.userPreferenceService = userPreferenceService;
|
|
7899
|
+
this.lastFormatString = 'HH:mm:ss';
|
|
7900
|
+
}
|
|
7901
|
+
/**
|
|
7902
|
+
* Format a time for display, accounting for user's display preferences.
|
|
7903
|
+
*/
|
|
7904
|
+
TimeDisplayPipe.prototype.transform = function (time, showSeconds) {
|
|
7905
|
+
var _this = this;
|
|
7906
|
+
var display = '';
|
|
7907
|
+
var formatString = '';
|
|
7908
|
+
// use user-preferred formats
|
|
7909
|
+
this.userPreferenceService.getPreferences().subscribe(function (result) {
|
|
7910
|
+
//if preferences exist then format time to users preference
|
|
7911
|
+
//otherwise use the last user preference
|
|
7912
|
+
if (result.preference) {
|
|
7913
|
+
formatString = result.preference.timeFormat;
|
|
7914
|
+
if (!showSeconds) {
|
|
7915
|
+
formatString = formatString.replace(':ss', '');
|
|
7916
|
+
}
|
|
7917
|
+
_this.lastFormatString = formatString;
|
|
7918
|
+
}
|
|
7919
|
+
});
|
|
7920
|
+
display = moment__default['default'](time).format(this.lastFormatString);
|
|
7921
|
+
return display;
|
|
7922
|
+
};
|
|
7923
|
+
return TimeDisplayPipe;
|
|
7924
|
+
}());
|
|
7925
|
+
TimeDisplayPipe.decorators = [
|
|
7926
|
+
{ type: i0.Pipe, args: [{ name: 'timeDisplay' },] }
|
|
7927
|
+
];
|
|
7928
|
+
TimeDisplayPipe.ctorParameters = function () { return [
|
|
7929
|
+
{ type: UserPreferenceService }
|
|
7930
|
+
]; };
|
|
7931
|
+
|
|
7830
7932
|
var ComponentsModule = /** @class */ (function () {
|
|
7831
7933
|
function ComponentsModule() {
|
|
7832
7934
|
}
|
|
7935
|
+
/**
|
|
7936
|
+
* Providing services through the forRoot pattern here ensures that the components module and the importing
|
|
7937
|
+
* module use the same singleton service instance.
|
|
7938
|
+
* For more info: https://angular.io/guide/singleton-services#the-forroot-pattern
|
|
7939
|
+
*/
|
|
7940
|
+
ComponentsModule.forRoot = function (config) {
|
|
7941
|
+
return {
|
|
7942
|
+
ngModule: ComponentsModule,
|
|
7943
|
+
providers: [
|
|
7944
|
+
{ provide: TelemetryService, useClass: config.telemetryService }
|
|
7945
|
+
]
|
|
7946
|
+
};
|
|
7947
|
+
};
|
|
7833
7948
|
return ComponentsModule;
|
|
7834
7949
|
}());
|
|
7835
7950
|
ComponentsModule.decorators = [
|
|
@@ -7853,6 +7968,7 @@
|
|
|
7853
7968
|
ConfirmComponent,
|
|
7854
7969
|
DialogComponent,
|
|
7855
7970
|
DateDisplayPipe,
|
|
7971
|
+
TimeDisplayPipe,
|
|
7856
7972
|
MockDateDisplayPipe,
|
|
7857
7973
|
RadioButtonComponent,
|
|
7858
7974
|
CheckboxComponent,
|
|
@@ -7900,6 +8016,7 @@
|
|
|
7900
8016
|
FormGroupHelper,
|
|
7901
8017
|
DialogService,
|
|
7902
8018
|
DateDisplayPipe,
|
|
8019
|
+
TimeDisplayPipe,
|
|
7903
8020
|
MockDateDisplayPipe,
|
|
7904
8021
|
RowCountPipe
|
|
7905
8022
|
],
|
|
@@ -7921,6 +8038,7 @@
|
|
|
7921
8038
|
ConfirmComponent,
|
|
7922
8039
|
DialogComponent,
|
|
7923
8040
|
DateDisplayPipe,
|
|
8041
|
+
TimeDisplayPipe,
|
|
7924
8042
|
RadioButtonComponent,
|
|
7925
8043
|
CheckboxComponent,
|
|
7926
8044
|
NumericboxComponent,
|
|
@@ -8635,7 +8753,9 @@
|
|
|
8635
8753
|
exports.TabsComponent = TabsComponent;
|
|
8636
8754
|
exports.Tag = Tag;
|
|
8637
8755
|
exports.TagsComponent = TagsComponent;
|
|
8756
|
+
exports.TelemetryBaseService = TelemetryBaseService;
|
|
8638
8757
|
exports.TextboxComponent = TextboxComponent;
|
|
8758
|
+
exports.TimeDisplayPipe = TimeDisplayPipe;
|
|
8639
8759
|
exports.ToastComponent = ToastComponent;
|
|
8640
8760
|
exports.ToastEvent = ToastEvent;
|
|
8641
8761
|
exports.ToastService = ToastService;
|
|
@@ -8667,6 +8787,7 @@
|
|
|
8667
8787
|
exports.ɵa = ResizableTableDirective;
|
|
8668
8788
|
exports.ɵb = ResizableBase;
|
|
8669
8789
|
exports.ɵc = TableDetailRowComponent;
|
|
8790
|
+
exports.ɵd = TelemetryService;
|
|
8670
8791
|
|
|
8671
8792
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
8672
8793
|
|