@energycap/components 0.26.1 → 0.26.3-ECAPID-313-Button-Font-Inherit.20211103-1319
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 +123 -11
- 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/controls/button/button.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/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 +111 -12
- 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/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
|
@@ -1010,7 +1010,7 @@ BannerComponent.decorators = [
|
|
|
1010
1010
|
{ type: Component, args: [{
|
|
1011
1011
|
selector: 'ec-banner',
|
|
1012
1012
|
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",
|
|
1013
|
-
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:
|
|
1013
|
+
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}"]
|
|
1014
1014
|
},] }
|
|
1015
1015
|
];
|
|
1016
1016
|
BannerComponent.propDecorators = {
|
|
@@ -1094,7 +1094,7 @@ ButtonComponent.decorators = [
|
|
|
1094
1094
|
{ type: Component, args: [{
|
|
1095
1095
|
selector: 'ec-button',
|
|
1096
1096
|
template: "<button id=\"{{id}}_button\"\r\n class=\"ec-button-{{customTemplate ? 'custom' : type}}\"\r\n [class.has-badge]=\"badge !== undefined\"\r\n tabindex=\"{{tabindex}}\"\r\n [type]=\"type === 'submit' || isSubmit ? 'submit' : 'button'\"\r\n [disabled]=\"disabled\"\r\n (click)=\"onClick($event)\"\r\n #element\r\n [attr.cdkFocusInitial]=\"autofocus || null\">\r\n <ng-container *ngIf=\"customTemplate; else defaultTemplate\">\r\n <ng-container *ngTemplateOutlet=\"customTemplate\"></ng-container>\r\n </ng-container>\r\n</button>\r\n\r\n<ng-template #defaultTemplate>\r\n <!-- Hidden when the button is not pending -->\r\n <div class=\"pending-container\" *ngIf=\"pending\">\r\n <i class=\"ec-icon {{pendingIcon}}\" id=\"{{id}}_pending\"></i>\r\n </div>\r\n\r\n <i class=\"ec-icon {{icon}}\" id=\"{{id}}_icon\" *ngIf=\"icon\"></i>\r\n\r\n <ng-container *ngIf=\"label\">\r\n <span id=\"{{id}}_label\" class=\"label\">{{label | translate}}</span>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"badge !== undefined\">\r\n <span id=\"{{id}}_badge\" class=\"badge\">{{badge}}</span>\r\n </ng-container>\r\n</ng-template>",
|
|
1097
|
-
styles: ["@-webkit-keyframes spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}:host{-webkit-appearance:none;color:#1a1a23;display:inline-block;font-family:Roboto,-apple-system,BlinkMacSystemFont,Segoe UI,Oxygen,Ubuntu,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-size:.875rem;margin:0;padding:0;vertical-align:top}:host(.text-left) button{justify-content:flex-start}:host(.text-right) button{justify-content:flex-end}:host(.active) .ec-button-custom,:host(.active) .ec-button-danger-text,:host(.active) .ec-button-icon,:host(.active) .ec-button-link,:host(.active) .ec-button-secondary,:host(.active) .ec-button-text{background-color:#bfe0e9}:host(.active) button:focus{border-color:transparent;box-shadow:none}:host(.active) .ec-button-secondary:focus{border-color:#d2d7d9}:host(.d-block) button{width:100%}:host(.border-0) button:not(:focus){border-color:transparent}:host(.is-action-icon) .ec-button-icon{color:#0084a9}:host(.is-success) .ec-button-icon,:host(.is-success) .ec-button-secondary,:host(.is-success) .ec-button-text{color:#3c763d}:host(.is-error) .ec-button-icon,:host(.is-error) .ec-button-secondary,:host(.is-error) .ec-button-text{color:#cd1d20}:host-context(.btn-stack) button{height:1rem}:host-context(.btn-stack) .ec-icon{height:.625rem;width:.625rem}:host-context(.btn-group) button:focus{position:relative;z-index:1}.ec-button-primary,.ec-button-submit{background-color:#cfd856;border-color:#c1cd23;color:#1a1a23}.ec-button-primary:active:enabled,.ec-button-submit:active:enabled{background-color:#c1cd23;color:#1a1a23}.ec-button-secondary{border-color:#d2d7d9}.ec-button-secondary,.ec-button-secondary:active:enabled{background-color:#fff;color:#1a1a23}.ec-button-common{background-color:#2d9ab8;border-color:#0084a9;color:#fff}.ec-button-common .ec-icon{color:inherit}.ec-button-common:active:enabled{background-color:#0084a9;border-color:#005f7a}.ec-button-icon{background-color:transparent;color:rgba(26,26,35,.66);padding:0;width:2rem}.ec-button-icon .ec-icon{height:1.1428571429em;margin:0;padding:0}.ec-button-icon:hover{background-color:#bfe0e9}.ec-button-icon:disabled{background-color:transparent;border-color:transparent}.ec-button-icon:disabled .ec-icon{opacity:.5}.ec-button-icon.has-badge{min-width:2rem;padding-left:.375rem;padding-right:0;width:auto}.ec-button-icon .badge{margin-left:-.5rem}.ec-button-text{background-color:transparent;color:#1a1a23}.ec-button-text .ec-icon{color:rgba(26,26,35,.66)}.ec-button-text:active:enabled{background-color:transparent;color:#000}.ec-button-text:disabled{background-color:transparent;border-color:transparent}.ec-button-link{background-color:transparent;color:#0084a9}.ec-button-link .ec-icon{color:inherit}.ec-button-link:active:enabled{background-color:transparent;color:#00485d}.ec-button-link:disabled{background-color:transparent;border-color:transparent}.ec-button-danger{background-color:#e64c4d;border-color:#e33436;color:#fff}.ec-button-danger .ec-icon{color:inherit}.ec-button-danger:active:enabled{background-color:#e33436}.ec-button-danger-text{background-color:transparent;color:#e33436}.ec-button-danger-text .ec-icon{color:inherit}.ec-button-danger-text:active:enabled{background-color:transparent;color:#b2191a}.ec-button-danger-text:disabled{background-color:transparent;border-color:transparent}.ec-button-custom{background-color:transparent;height:auto;padding:0}.ec-button-custom:disabled{background-color:transparent;border:0}button{align-items:center;background-color:#fff;border:.0625rem solid transparent;border-radius:0;cursor:pointer;display:flex;font-size:.875rem;height:2rem;justify-content:center;line-height:1.25;line-height:1.25rem;padding:.3571428571em .5714285714em;position:relative}button.is-highlighted,button.is-selected{background-color:#d9edf2}button:focus{border-color:#0084a9;box-shadow:0 0 0 1px #0084a9;outline:none}button:active{background-color:#0084a9;color:#fff}button.is-disabled,button:disabled{background-color:rgba(26,26,35,.1);border-color:#d2d7d9;color:rgba(26,26,35,.66);cursor:default;opacity:.65}button .label{align-items:center;display:flex;flex:auto}button .ec-icon{flex:0 0 auto}button .ec-icon+.label{margin:0 .375rem}button .label{justify-content:center;white-space:nowrap}button .ec-icon+.label{flex:none;margin-left:.25rem}button.has-badge{padding-right:.0625rem}:host(.textbox-group-btn-right){position:relative}:host(.textbox-group-btn-right) button{border-bottom-left-radius:0;border-top-left-radius:0;margin-left:-1px;padding-left:.4375rem;padding-right:.4375rem}.badge{background-color:#7e579b;border:.125rem solid #fff;border-radius:.5625rem;color:#fff;display:inline-block;font-size:.625rem;font-weight:700;line-height:.875rem;margin-left:-.25rem;margin-top:-.75rem;min-width:1rem;padding:0 .25rem;text-align:center;vertical-align:baseline;white-space:nowrap}:host(.is-tab) button{align-items:center;border:1px solid transparent;border-radius:0;color:rgba(26,26,35,.66);cursor:pointer;display:flex;font-size:.75rem;height:1.5rem;justify-content:center;min-width:1.5rem;padding-left:.5rem;padding-right:.5rem}:host(.is-tab) button:hover{color:#354751}:host(.is-tab) button.active{background-color:#d2d7d9;color:#354751}:host(.is-tab) button:focus{outline:none}:host(.is-tab) button:focus:not(.active):not(.is-disabled){border-color:#0084a9;box-shadow:0 0 0 1px #0084a9;box-shadow:none}:host(.is-tab) button.is-disabled{color:rgba(26,26,35,.38);cursor:default}:host(.is-tab) button.ec-button-icon{justify-content:center;padding:0;width:auto}:host(.is-tab) button:hover{background-color:transparent}:host(.is-tab).active button{background-color:#d2d7d9;color:#354751}.pending-container{align-items:center;bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0;z-index:1}.pending-container>.ec-icon{color:inherit;flex:none}.pending-container~.badge,.pending-container~.ec-icon,.pending-container~.label{opacity:0}"]
|
|
1097
|
+
styles: ["@-webkit-keyframes spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}:host{-webkit-appearance:none;color:#1a1a23;display:inline-block;font-family:Roboto,-apple-system,BlinkMacSystemFont,Segoe UI,Oxygen,Ubuntu,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-size:.875rem;margin:0;padding:0;vertical-align:top}:host(.font-size-inherit),:host(.font-size-inherit) button{font-size:inherit}:host(.text-left) button{justify-content:flex-start}:host(.text-right) button{justify-content:flex-end}:host(.active) .ec-button-custom,:host(.active) .ec-button-danger-text,:host(.active) .ec-button-icon,:host(.active) .ec-button-link,:host(.active) .ec-button-secondary,:host(.active) .ec-button-text{background-color:#bfe0e9}:host(.active) button:focus{border-color:transparent;box-shadow:none}:host(.active) .ec-button-secondary:focus{border-color:#d2d7d9}:host(.d-block) button{width:100%}:host(.border-0) button:not(:focus){border-color:transparent}:host(.is-action-icon) .ec-button-icon{color:#0084a9}:host(.is-success) .ec-button-icon,:host(.is-success) .ec-button-secondary,:host(.is-success) .ec-button-text{color:#3c763d}:host(.is-error) .ec-button-icon,:host(.is-error) .ec-button-secondary,:host(.is-error) .ec-button-text{color:#cd1d20}:host-context(.btn-stack) button{height:1rem}:host-context(.btn-stack) .ec-icon{height:.625rem;width:.625rem}:host-context(.btn-group) button:focus{position:relative;z-index:1}.ec-button-primary,.ec-button-submit{background-color:#cfd856;border-color:#c1cd23;color:#1a1a23}.ec-button-primary:active:enabled,.ec-button-submit:active:enabled{background-color:#c1cd23;color:#1a1a23}.ec-button-secondary{border-color:#d2d7d9}.ec-button-secondary,.ec-button-secondary:active:enabled{background-color:#fff;color:#1a1a23}.ec-button-common{background-color:#2d9ab8;border-color:#0084a9;color:#fff}.ec-button-common .ec-icon{color:inherit}.ec-button-common:active:enabled{background-color:#0084a9;border-color:#005f7a}.ec-button-icon{background-color:transparent;color:rgba(26,26,35,.66);padding:0;width:2rem}.ec-button-icon .ec-icon{height:1.1428571429em;margin:0;padding:0}.ec-button-icon:hover{background-color:#bfe0e9}.ec-button-icon:disabled{background-color:transparent;border-color:transparent}.ec-button-icon:disabled .ec-icon{opacity:.5}.ec-button-icon.has-badge{min-width:2rem;padding-left:.375rem;padding-right:0;width:auto}.ec-button-icon .badge{margin-left:-.5rem}.ec-button-text{background-color:transparent;color:#1a1a23}.ec-button-text .ec-icon{color:rgba(26,26,35,.66)}.ec-button-text:active:enabled{background-color:transparent;color:#000}.ec-button-text:disabled{background-color:transparent;border-color:transparent}.ec-button-link{background-color:transparent;color:#0084a9}.ec-button-link .ec-icon{color:inherit}.ec-button-link:active:enabled{background-color:transparent;color:#00485d}.ec-button-link:disabled{background-color:transparent;border-color:transparent}.ec-button-danger{background-color:#e64c4d;border-color:#e33436;color:#fff}.ec-button-danger .ec-icon{color:inherit}.ec-button-danger:active:enabled{background-color:#e33436}.ec-button-danger-text{background-color:transparent;color:#e33436}.ec-button-danger-text .ec-icon{color:inherit}.ec-button-danger-text:active:enabled{background-color:transparent;color:#b2191a}.ec-button-danger-text:disabled{background-color:transparent;border-color:transparent}.ec-button-custom{background-color:transparent;height:auto;padding:0}.ec-button-custom:disabled{background-color:transparent;border:0}button{align-items:center;background-color:#fff;border:.0625rem solid transparent;border-radius:0;cursor:pointer;display:flex;font-size:.875rem;height:2rem;justify-content:center;line-height:1.25;line-height:1.25rem;padding:.3571428571em .5714285714em;position:relative}button.is-highlighted,button.is-selected{background-color:#d9edf2}button:focus{border-color:#0084a9;box-shadow:0 0 0 1px #0084a9;outline:none}button:active{background-color:#0084a9;color:#fff}button.is-disabled,button:disabled{background-color:rgba(26,26,35,.1);border-color:#d2d7d9;color:rgba(26,26,35,.66);cursor:default;opacity:.65}button .label{align-items:center;display:flex;flex:auto}button .ec-icon{flex:0 0 auto}button .ec-icon+.label{margin:0 .375rem}button .label{justify-content:center;white-space:nowrap}button .ec-icon+.label{flex:none;margin-left:.25rem}button.has-badge{padding-right:.0625rem}:host(.textbox-group-btn-right){position:relative}:host(.textbox-group-btn-right) button{border-bottom-left-radius:0;border-top-left-radius:0;margin-left:-1px;padding-left:.4375rem;padding-right:.4375rem}.badge{background-color:#7e579b;border:.125rem solid #fff;border-radius:.5625rem;color:#fff;display:inline-block;font-size:.625rem;font-weight:700;line-height:.875rem;margin-left:-.25rem;margin-top:-.75rem;min-width:1rem;padding:0 .25rem;text-align:center;vertical-align:baseline;white-space:nowrap}:host(.is-tab) button{align-items:center;border:1px solid transparent;border-radius:0;color:rgba(26,26,35,.66);cursor:pointer;display:flex;font-size:.75rem;height:1.5rem;justify-content:center;min-width:1.5rem;padding-left:.5rem;padding-right:.5rem}:host(.is-tab) button:hover{color:#354751}:host(.is-tab) button.active{background-color:#d2d7d9;color:#354751}:host(.is-tab) button:focus{outline:none}:host(.is-tab) button:focus:not(.active):not(.is-disabled){border-color:#0084a9;box-shadow:0 0 0 1px #0084a9;box-shadow:none}:host(.is-tab) button.is-disabled{color:rgba(26,26,35,.38);cursor:default}:host(.is-tab) button.ec-button-icon{justify-content:center;padding:0;width:auto}:host(.is-tab) button:hover{background-color:transparent}:host(.is-tab).active button{background-color:#d2d7d9;color:#354751}.pending-container{align-items:center;bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0;z-index:1}.pending-container>.ec-icon{color:inherit;flex:none}.pending-container~.badge,.pending-container~.ec-icon,.pending-container~.label{opacity:0}"]
|
|
1098
1098
|
},] }
|
|
1099
1099
|
];
|
|
1100
1100
|
ButtonComponent.ctorParameters = () => [];
|
|
@@ -6950,7 +6950,7 @@ class ToastComponent {
|
|
|
6950
6950
|
ngOnInit() {
|
|
6951
6951
|
this.toastService.events.pipe(takeUntil(this.destroyed)).subscribe(event => {
|
|
6952
6952
|
if (event.action == 'remove' && event.toast === this.toastItem) {
|
|
6953
|
-
this.close();
|
|
6953
|
+
this.close(event);
|
|
6954
6954
|
}
|
|
6955
6955
|
});
|
|
6956
6956
|
}
|
|
@@ -6967,22 +6967,29 @@ class ToastComponent {
|
|
|
6967
6967
|
this.destroyed.next();
|
|
6968
6968
|
this.destroyed.complete();
|
|
6969
6969
|
}
|
|
6970
|
-
|
|
6970
|
+
closeClicked() {
|
|
6971
|
+
if (this.toastItem) {
|
|
6972
|
+
this.toastService.dismissToast(this.toastItem, 'user');
|
|
6973
|
+
}
|
|
6974
|
+
}
|
|
6975
|
+
close(event) {
|
|
6971
6976
|
this.open = false;
|
|
6972
6977
|
timer(this.TOAST_ANIMATION_DURATION).subscribe(() => {
|
|
6973
|
-
this.closed.emit(
|
|
6978
|
+
this.closed.emit(event);
|
|
6974
6979
|
});
|
|
6975
6980
|
}
|
|
6976
6981
|
closeAfterTimer() {
|
|
6977
6982
|
timer(this.TIMED_TOAST_DURATION).pipe(takeUntil(race(this.closed, this.destroyed))).subscribe(() => {
|
|
6978
|
-
this.
|
|
6983
|
+
if (this.toastItem) {
|
|
6984
|
+
this.toastService.dismissToast(this.toastItem, 'auto');
|
|
6985
|
+
}
|
|
6979
6986
|
});
|
|
6980
6987
|
}
|
|
6981
6988
|
}
|
|
6982
6989
|
ToastComponent.decorators = [
|
|
6983
6990
|
{ type: Component, args: [{
|
|
6984
6991
|
selector: 'ec-toast',
|
|
6985
|
-
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)=\"
|
|
6992
|
+
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>",
|
|
6986
6993
|
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)}"]
|
|
6987
6994
|
},] }
|
|
6988
6995
|
];
|
|
@@ -6997,9 +7004,25 @@ ToastComponent.propDecorators = {
|
|
|
6997
7004
|
closed: [{ type: Output }]
|
|
6998
7005
|
};
|
|
6999
7006
|
|
|
7007
|
+
class TelemetryBaseService {
|
|
7008
|
+
}
|
|
7009
|
+
|
|
7010
|
+
/** Default No-op telemetry implementation */
|
|
7011
|
+
class TelemetryService extends TelemetryBaseService {
|
|
7012
|
+
trackPageView(pageName, url, properties) { }
|
|
7013
|
+
trackEvent(name, properties, measurements) { }
|
|
7014
|
+
}
|
|
7015
|
+
TelemetryService.ɵprov = ɵɵdefineInjectable({ factory: function TelemetryService_Factory() { return new TelemetryService(); }, token: TelemetryService, providedIn: "root" });
|
|
7016
|
+
TelemetryService.decorators = [
|
|
7017
|
+
{ type: Injectable, args: [{
|
|
7018
|
+
providedIn: 'root'
|
|
7019
|
+
},] }
|
|
7020
|
+
];
|
|
7021
|
+
|
|
7000
7022
|
class ToasterComponent {
|
|
7001
|
-
constructor(toastService) {
|
|
7023
|
+
constructor(toastService, telemetryService) {
|
|
7002
7024
|
this.toastService = toastService;
|
|
7025
|
+
this.telemetryService = telemetryService;
|
|
7003
7026
|
this.dismissibleToastBottom = 0;
|
|
7004
7027
|
this.pendingToasts = [];
|
|
7005
7028
|
this.destroyed = new Subject();
|
|
@@ -7009,9 +7032,11 @@ class ToasterComponent {
|
|
|
7009
7032
|
if (event.action == 'add') {
|
|
7010
7033
|
this.addToast(event.toast);
|
|
7011
7034
|
this.updateDismissibleToastBottom();
|
|
7035
|
+
this.trackEvent(event);
|
|
7012
7036
|
}
|
|
7013
7037
|
else if (event.action == 'remove' && event.toast !== this.currentDismissibleToast && event.toast !== this.currentTimedToast) {
|
|
7014
7038
|
this.removePendingToast(event.toast);
|
|
7039
|
+
this.trackEvent(event);
|
|
7015
7040
|
}
|
|
7016
7041
|
});
|
|
7017
7042
|
}
|
|
@@ -7019,14 +7044,15 @@ class ToasterComponent {
|
|
|
7019
7044
|
this.destroyed.next();
|
|
7020
7045
|
this.destroyed.complete();
|
|
7021
7046
|
}
|
|
7022
|
-
updateVisibleToast(
|
|
7023
|
-
if (
|
|
7047
|
+
updateVisibleToast(event) {
|
|
7048
|
+
if (event.toast.dismissible) {
|
|
7024
7049
|
this.currentDismissibleToast = this.getNextToast(true);
|
|
7025
7050
|
}
|
|
7026
7051
|
else {
|
|
7027
7052
|
this.currentTimedToast = this.getNextToast(false);
|
|
7028
7053
|
}
|
|
7029
7054
|
this.updateDismissibleToastBottom();
|
|
7055
|
+
this.trackEvent(event);
|
|
7030
7056
|
}
|
|
7031
7057
|
addToast(toast) {
|
|
7032
7058
|
if ((toast.dismissible && this.currentDismissibleToast) || (!toast.dismissible && this.currentTimedToast)) {
|
|
@@ -7071,6 +7097,25 @@ class ToasterComponent {
|
|
|
7071
7097
|
this.dismissibleToastBottom = 0;
|
|
7072
7098
|
}
|
|
7073
7099
|
}
|
|
7100
|
+
trackEvent(event) {
|
|
7101
|
+
var _a, _b, _c;
|
|
7102
|
+
const dismissible = this.pendingToasts.filter(t => t.dismissible);
|
|
7103
|
+
const transient = this.pendingToasts.filter(t => !t.dismissible);
|
|
7104
|
+
this.telemetryService.trackEvent(`${event.action} toast`, {
|
|
7105
|
+
action: event.action,
|
|
7106
|
+
source: event.source,
|
|
7107
|
+
hasDismissiblePending: dismissible.length > 0 ? 'yes' : 'no',
|
|
7108
|
+
dismissiblePendingLength: `${dismissible.length}`,
|
|
7109
|
+
hasTransientPending: transient.length > 0 ? 'yes' : 'no',
|
|
7110
|
+
transientPendingLength: `${transient.length}`,
|
|
7111
|
+
toastId: (_a = event.toast.id) !== null && _a !== void 0 ? _a : '',
|
|
7112
|
+
toastType: event.toast.type,
|
|
7113
|
+
toastMessage: event.toast.message,
|
|
7114
|
+
toastDismissible: `${event.toast.dismissible}`,
|
|
7115
|
+
toastIcon: (_b = event.toast.icon) !== null && _b !== void 0 ? _b : '',
|
|
7116
|
+
toastAction: (_c = event.toast.actionLabel) !== null && _c !== void 0 ? _c : '',
|
|
7117
|
+
});
|
|
7118
|
+
}
|
|
7074
7119
|
}
|
|
7075
7120
|
ToasterComponent.decorators = [
|
|
7076
7121
|
{ type: Component, args: [{
|
|
@@ -7079,7 +7124,8 @@ ToasterComponent.decorators = [
|
|
|
7079
7124
|
},] }
|
|
7080
7125
|
];
|
|
7081
7126
|
ToasterComponent.ctorParameters = () => [
|
|
7082
|
-
{ type: ToastService }
|
|
7127
|
+
{ type: ToastService },
|
|
7128
|
+
{ type: TelemetryService }
|
|
7083
7129
|
];
|
|
7084
7130
|
ToasterComponent.propDecorators = {
|
|
7085
7131
|
timedToastEl: [{ type: ViewChild, args: ['timedToast', { static: false, read: ElementRef },] }]
|
|
@@ -7188,7 +7234,57 @@ PageTitleComponent.propDecorators = {
|
|
|
7188
7234
|
subTitle: [{ type: Input }]
|
|
7189
7235
|
};
|
|
7190
7236
|
|
|
7237
|
+
/**
|
|
7238
|
+
* Format a time to the user's preference for display
|
|
7239
|
+
*/
|
|
7240
|
+
class TimeDisplayPipe {
|
|
7241
|
+
constructor(userPreferenceService) {
|
|
7242
|
+
this.userPreferenceService = userPreferenceService;
|
|
7243
|
+
this.lastFormatString = 'HH:mm:ss';
|
|
7244
|
+
}
|
|
7245
|
+
/**
|
|
7246
|
+
* Format a time for display, accounting for user's display preferences.
|
|
7247
|
+
*/
|
|
7248
|
+
transform(time, showSeconds) {
|
|
7249
|
+
let display = '';
|
|
7250
|
+
let formatString = '';
|
|
7251
|
+
// use user-preferred formats
|
|
7252
|
+
this.userPreferenceService.getPreferences().subscribe(result => {
|
|
7253
|
+
//if preferences exist then format time to users preference
|
|
7254
|
+
//otherwise use the last user preference
|
|
7255
|
+
if (result.preference) {
|
|
7256
|
+
formatString = result.preference.timeFormat;
|
|
7257
|
+
if (!showSeconds) {
|
|
7258
|
+
formatString = formatString.replace(':ss', '');
|
|
7259
|
+
}
|
|
7260
|
+
this.lastFormatString = formatString;
|
|
7261
|
+
}
|
|
7262
|
+
});
|
|
7263
|
+
display = moment(time).format(this.lastFormatString);
|
|
7264
|
+
return display;
|
|
7265
|
+
}
|
|
7266
|
+
}
|
|
7267
|
+
TimeDisplayPipe.decorators = [
|
|
7268
|
+
{ type: Pipe, args: [{ name: 'timeDisplay' },] }
|
|
7269
|
+
];
|
|
7270
|
+
TimeDisplayPipe.ctorParameters = () => [
|
|
7271
|
+
{ type: UserPreferenceService }
|
|
7272
|
+
];
|
|
7273
|
+
|
|
7191
7274
|
class ComponentsModule {
|
|
7275
|
+
/**
|
|
7276
|
+
* Providing services through the forRoot pattern here ensures that the components module and the importing
|
|
7277
|
+
* module use the same singleton service instance.
|
|
7278
|
+
* For more info: https://angular.io/guide/singleton-services#the-forroot-pattern
|
|
7279
|
+
*/
|
|
7280
|
+
static forRoot(config) {
|
|
7281
|
+
return {
|
|
7282
|
+
ngModule: ComponentsModule,
|
|
7283
|
+
providers: [
|
|
7284
|
+
{ provide: TelemetryService, useClass: config.telemetryService }
|
|
7285
|
+
]
|
|
7286
|
+
};
|
|
7287
|
+
}
|
|
7192
7288
|
}
|
|
7193
7289
|
ComponentsModule.decorators = [
|
|
7194
7290
|
{ type: NgModule, args: [{
|
|
@@ -7211,6 +7307,7 @@ ComponentsModule.decorators = [
|
|
|
7211
7307
|
ConfirmComponent,
|
|
7212
7308
|
DialogComponent,
|
|
7213
7309
|
DateDisplayPipe,
|
|
7310
|
+
TimeDisplayPipe,
|
|
7214
7311
|
MockDateDisplayPipe,
|
|
7215
7312
|
RadioButtonComponent,
|
|
7216
7313
|
CheckboxComponent,
|
|
@@ -7258,6 +7355,7 @@ ComponentsModule.decorators = [
|
|
|
7258
7355
|
FormGroupHelper,
|
|
7259
7356
|
DialogService,
|
|
7260
7357
|
DateDisplayPipe,
|
|
7358
|
+
TimeDisplayPipe,
|
|
7261
7359
|
MockDateDisplayPipe,
|
|
7262
7360
|
RowCountPipe
|
|
7263
7361
|
],
|
|
@@ -7279,6 +7377,7 @@ ComponentsModule.decorators = [
|
|
|
7279
7377
|
ConfirmComponent,
|
|
7280
7378
|
DialogComponent,
|
|
7281
7379
|
DateDisplayPipe,
|
|
7380
|
+
TimeDisplayPipe,
|
|
7282
7381
|
RadioButtonComponent,
|
|
7283
7382
|
CheckboxComponent,
|
|
7284
7383
|
NumericboxComponent,
|
|
@@ -7821,5 +7920,5 @@ PageBaseComponentTestInjectorFactory.ComponentProviders = [
|
|
|
7821
7920
|
* Generated bundle index. Do not edit.
|
|
7822
7921
|
*/
|
|
7823
7922
|
|
|
7824
|
-
export { AppBarComponent, AvatarComponent, BannerComponent, ButtonComponent, CacheService, CheckboxComponent, ClickAreaForDirective, CollapsibleToggleComponent, ComboboxComponent, ComponentsModule, ConfirmComponent, ConfirmDialogContext, CopyButtonDirective, CustomValidators, DateDisplayPipe, DateTimeHelper, DialogCloseDuration, DialogCloseEvent, DialogCloseLatestEvent, DialogComponent, DialogEvent, DialogGroupComponent, DialogOpenDuration, DialogOpenEndEvent, DialogOpenStartEvent, DialogResult, DialogService, DropdownComponent, ErrorService, FileTypeExtensions, FileUploadComponent, FormControlBase, FormControlComponent, FormGroupComponent, FormGroupHelper, IfViewportWidthDirective, ItemDisplayComponent, JsonDisplayComponent, JsonHelper, MenuComponent, MockActivatedRoute, MockDateDisplayPipe, MockDialog, MockDialogContent, MockTranslateService, MockTranslationHelperService, NavGroup, NavItemActiveDirective, NumericboxComponent, Overlay, PageBaseComponent, PageBaseComponentTestHelper, PageBaseComponentTestInjectorFactory, PageInitResult, PageTitleComponent, PageViewComponent, PanelCloseDuration, PanelOpenDuration, PopoverComponent, PopupContainerDirective, RadioButtonComponent, RadioButtonOption, ResizableColumnComponent, RowCountPipe, ScrollService, SearchableTableComponent, SelectComponent, SpinnerComponent, SplashComponent, SplashService, SpyFactory, TableComponent, TableLockedColumnComponent, TableMasterHeaderRowComponent, TableMasterRowComponent, TablePaginationComponent, TableSelectableRowComponent, TableSelectableRowContext, TabsComponent, Tag, TagsComponent, TextboxComponent, ToastComponent, ToastEvent, ToastService, ToasterComponent, UnicodeStrings, UserPreferenceService, ValidationMessageService, ViewOverlayComponent, WindowService, canadianPostalCodeRegex, clickEvent, dateInputFormatRegex, findAllSpacesPattern, forEachFormControl, getApiError, getControlValue, getDecimalPattern, integerPattern, isApiError, menuAnimationSpeed, mockRouterFactory, numericboxValidation, orderByIgnoreCase, otherZipCodeRegex, sortByIgnoreCase, textboxValidation, unitedStatesZipCodeRegex, validateFormGroupValuesAreUnique, ResizableTableDirective as ɵa, ResizableBase as ɵb, TableDetailRowComponent as ɵc };
|
|
7923
|
+
export { AppBarComponent, AvatarComponent, BannerComponent, ButtonComponent, CacheService, CheckboxComponent, ClickAreaForDirective, CollapsibleToggleComponent, ComboboxComponent, ComponentsModule, ConfirmComponent, ConfirmDialogContext, CopyButtonDirective, CustomValidators, DateDisplayPipe, DateTimeHelper, DialogCloseDuration, DialogCloseEvent, DialogCloseLatestEvent, DialogComponent, DialogEvent, DialogGroupComponent, DialogOpenDuration, DialogOpenEndEvent, DialogOpenStartEvent, DialogResult, DialogService, DropdownComponent, ErrorService, FileTypeExtensions, FileUploadComponent, FormControlBase, FormControlComponent, FormGroupComponent, FormGroupHelper, IfViewportWidthDirective, ItemDisplayComponent, JsonDisplayComponent, JsonHelper, MenuComponent, MockActivatedRoute, MockDateDisplayPipe, MockDialog, MockDialogContent, MockTranslateService, MockTranslationHelperService, NavGroup, NavItemActiveDirective, NumericboxComponent, Overlay, PageBaseComponent, PageBaseComponentTestHelper, PageBaseComponentTestInjectorFactory, PageInitResult, PageTitleComponent, PageViewComponent, PanelCloseDuration, PanelOpenDuration, PopoverComponent, PopupContainerDirective, RadioButtonComponent, RadioButtonOption, ResizableColumnComponent, RowCountPipe, ScrollService, SearchableTableComponent, SelectComponent, SpinnerComponent, SplashComponent, SplashService, SpyFactory, TableComponent, TableLockedColumnComponent, TableMasterHeaderRowComponent, TableMasterRowComponent, TablePaginationComponent, TableSelectableRowComponent, TableSelectableRowContext, TabsComponent, Tag, TagsComponent, TelemetryBaseService, TextboxComponent, TimeDisplayPipe, ToastComponent, ToastEvent, ToastService, ToasterComponent, UnicodeStrings, UserPreferenceService, ValidationMessageService, ViewOverlayComponent, WindowService, canadianPostalCodeRegex, clickEvent, dateInputFormatRegex, findAllSpacesPattern, forEachFormControl, getApiError, getControlValue, getDecimalPattern, integerPattern, isApiError, menuAnimationSpeed, mockRouterFactory, numericboxValidation, orderByIgnoreCase, otherZipCodeRegex, sortByIgnoreCase, textboxValidation, unitedStatesZipCodeRegex, validateFormGroupValuesAreUnique, ResizableTableDirective as ɵa, ResizableBase as ɵb, TableDetailRowComponent as ɵc, TelemetryService as ɵd };
|
|
7825
7924
|
//# sourceMappingURL=energycap-components.js.map
|