@energycap/components 0.27.1 → 0.27.2-ECAPID-377-Implement-Sidebar.20220118-1026
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 +218 -169
- 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/components.module.js +7 -3
- package/esm2015/lib/shared/display/pipes/relative-date.pipe.js +49 -0
- package/esm2015/public-api.js +2 -1
- package/fesm2015/energycap-components.js +206 -159
- package/fesm2015/energycap-components.js.map +1 -1
- package/lib/shared/display/pipes/relative-date.pipe.d.ts +23 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/src/styles/email/_email-base.scss +1 -0
|
@@ -5273,110 +5273,6 @@ JsonDisplayComponent.propDecorators = {
|
|
|
5273
5273
|
maxLength: [{ type: Input }]
|
|
5274
5274
|
};
|
|
5275
5275
|
|
|
5276
|
-
/** Exposes the markup and styles that represent the spinner. No inputs or outputs defined because it is just a visual component*/
|
|
5277
|
-
class SpinnerComponent {
|
|
5278
|
-
}
|
|
5279
|
-
SpinnerComponent.decorators = [
|
|
5280
|
-
{ type: Component, args: [{
|
|
5281
|
-
selector: 'ec-spinner',
|
|
5282
|
-
template: "<div class=\"spinner\">\r\n <span class=\"spinner-dot\"></span>\r\n <span class=\"spinner-dot\"></span>\r\n <span class=\"spinner-dot\"></span>\r\n <span class=\"spinner-dot\"></span>\r\n</div>",
|
|
5283
|
-
styles: ["@-webkit-keyframes sk-bouncedelay{0%,80%,to{opacity:0}40%{opacity:1}}@keyframes sk-bouncedelay{0%,80%,to{opacity:0}40%{opacity:1}}.spinner{display:flex}.spinner-dot{-webkit-animation:sk-bouncedelay 1.7s ease-in-out infinite both;animation:sk-bouncedelay 1.7s ease-in-out infinite both;background-color:#0084a9;height:.75rem;margin-right:.25rem;width:.75rem}.spinner-dot:first-child{-webkit-animation-delay:-.6s;animation-delay:-.6s}.spinner-dot:nth-child(2){-webkit-animation-delay:-.4s;animation-delay:-.4s}.spinner-dot:nth-child(3){-webkit-animation-delay:-.2s;animation-delay:-.2s}:host(.spinner-small) .spinner-dot{-webkit-animation:sk-bouncedelay 1.7s ease-in-out infinite both;animation:sk-bouncedelay 1.7s ease-in-out infinite both;background-color:#0084a9;height:.5rem;margin-right:.1666666667rem;width:.5rem}:host(.spinner-small) .spinner-dot:first-child{-webkit-animation-delay:-.6s;animation-delay:-.6s}:host(.spinner-small) .spinner-dot:nth-child(2){-webkit-animation-delay:-.4s;animation-delay:-.4s}:host(.spinner-small) .spinner-dot:nth-child(3){-webkit-animation-delay:-.2s;animation-delay:-.2s}"]
|
|
5284
|
-
},] }
|
|
5285
|
-
];
|
|
5286
|
-
|
|
5287
|
-
class SplashService {
|
|
5288
|
-
constructor() {
|
|
5289
|
-
/** Used to interact with the splash component
|
|
5290
|
-
* The splash component will subscribe to this and any components
|
|
5291
|
-
* that wish to bring the splash visible can use this to communicate
|
|
5292
|
-
* with the splash component.
|
|
5293
|
-
*/
|
|
5294
|
-
this._splashVisibility = new Subject();
|
|
5295
|
-
this.splashVisibility = this._splashVisibility;
|
|
5296
|
-
}
|
|
5297
|
-
/**
|
|
5298
|
-
* Shows the splash screen
|
|
5299
|
-
*/
|
|
5300
|
-
showSplash() {
|
|
5301
|
-
this._splashVisibility.next(true);
|
|
5302
|
-
}
|
|
5303
|
-
/**
|
|
5304
|
-
* Hides the splash screen
|
|
5305
|
-
*/
|
|
5306
|
-
hideSplash() {
|
|
5307
|
-
this._splashVisibility.next(false);
|
|
5308
|
-
}
|
|
5309
|
-
}
|
|
5310
|
-
SplashService.ɵprov = ɵɵdefineInjectable({ factory: function SplashService_Factory() { return new SplashService(); }, token: SplashService, providedIn: "root" });
|
|
5311
|
-
SplashService.decorators = [
|
|
5312
|
-
{ type: Injectable, args: [{
|
|
5313
|
-
providedIn: 'root'
|
|
5314
|
-
},] }
|
|
5315
|
-
];
|
|
5316
|
-
SplashService.ctorParameters = () => [];
|
|
5317
|
-
|
|
5318
|
-
class SplashComponent {
|
|
5319
|
-
constructor(splashService) {
|
|
5320
|
-
this.splashService = splashService;
|
|
5321
|
-
/** Sets the visibility of the splash display */
|
|
5322
|
-
this.isVisible = true;
|
|
5323
|
-
this.stopAnimation = false;
|
|
5324
|
-
/** Emits when the service is destroyed */
|
|
5325
|
-
this.destroyed = new Subject();
|
|
5326
|
-
}
|
|
5327
|
-
ngOnInit() {
|
|
5328
|
-
this.splashService.splashVisibility.pipe(takeUntil(this.destroyed), tap((value) => __awaiter(this, void 0, void 0, function* () {
|
|
5329
|
-
if (value) {
|
|
5330
|
-
this.stopAnimation = false;
|
|
5331
|
-
}
|
|
5332
|
-
else {
|
|
5333
|
-
// Prevent animation from continuing after splash screen is hidden
|
|
5334
|
-
// but if we hide it then show while the timer is running, don't stop the animation after all
|
|
5335
|
-
timer(1000).pipe(takeUntil(this.splashService.splashVisibility)).subscribe(() => {
|
|
5336
|
-
this.stopAnimation = true;
|
|
5337
|
-
});
|
|
5338
|
-
}
|
|
5339
|
-
}))).subscribe(showSplash => {
|
|
5340
|
-
this.isVisible = showSplash;
|
|
5341
|
-
});
|
|
5342
|
-
}
|
|
5343
|
-
ngOnDestroy() {
|
|
5344
|
-
this.destroyed.next();
|
|
5345
|
-
this.destroyed.unsubscribe();
|
|
5346
|
-
}
|
|
5347
|
-
}
|
|
5348
|
-
SplashComponent.decorators = [
|
|
5349
|
-
{ type: Component, args: [{
|
|
5350
|
-
selector: 'ec-splash',
|
|
5351
|
-
template: "<div class=\"app-splash\"\r\n [class.app-loaded]=\"!isVisible\">\r\n\r\n <!-- This is the raw icon.svg file so we can animate it -->\r\n <svg [class.d-none]=\"stopAnimation\" \r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n width=\"50\"\r\n height=\"50\"\r\n viewBox=\"0 0 50 50\">\r\n <g>\r\n <g>\r\n <path fill=\"#A0AD39\"\r\n fill-rule=\"nonzero\"\r\n d=\"M34.93,32.25 L34.93,37.25 L15.21,37.25 L15.21,32.25 L34.93,32.25 Z M28.45,22.48 L28.45,27.48 L15.21,27.48 L15.21,22.48 L28.45,22.48 Z M34.93,12.71 L34.93,17.71 L15.21,17.71 L15.21,12.71 L34.93,12.71 Z\" />\r\n <path fill=\"#A0AD39\"\r\n d=\"M24.99,5 C31.1,5 36.56,7.75 40.23,12.07 L44.33,9.16 C39.75,3.57 32.78,0 24.99,0 C17.2,0 10.23,3.57 5.65,9.16 L9.75,12.07 C13.42,7.75 18.88,5 24.99,5 Z\" />\r\n </g>\r\n <path fill=\"#17303B\"\r\n d=\"M40.24,37.93 C36.57,42.25 31.11,45 25,45 C18.89,45 13.43,42.25 9.76,37.93 L9.78,37.92 C6.82,34.43 5,29.94 5,25 C5,21.86 5.74,18.91 7.03,16.26 L2.89,13.33 C1.05,16.81 0,20.78 0,25 C0,31.01 2.13,36.52 5.66,40.83 L5.66,40.83 C10.24,46.42 17.21,49.99 25,49.99 C32.79,49.99 39.76,46.42 44.34,40.83 L40.24,37.93 Z\" />\r\n </g>\r\n\r\n </svg>\r\n</div>"
|
|
5352
|
-
},] }
|
|
5353
|
-
];
|
|
5354
|
-
SplashComponent.ctorParameters = () => [
|
|
5355
|
-
{ type: SplashService }
|
|
5356
|
-
];
|
|
5357
|
-
|
|
5358
|
-
class ResizableColumnComponent {
|
|
5359
|
-
constructor(el) {
|
|
5360
|
-
this.el = el;
|
|
5361
|
-
this.onResize = new EventEmitter();
|
|
5362
|
-
}
|
|
5363
|
-
emitWidth(width) {
|
|
5364
|
-
this.onResize.emit(width);
|
|
5365
|
-
}
|
|
5366
|
-
}
|
|
5367
|
-
ResizableColumnComponent.decorators = [
|
|
5368
|
-
{ type: Component, args: [{
|
|
5369
|
-
selector: 'th.is-resizable',
|
|
5370
|
-
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"
|
|
5371
|
-
},] }
|
|
5372
|
-
];
|
|
5373
|
-
ResizableColumnComponent.ctorParameters = () => [
|
|
5374
|
-
{ type: ElementRef }
|
|
5375
|
-
];
|
|
5376
|
-
ResizableColumnComponent.propDecorators = {
|
|
5377
|
-
onResize: [{ type: Output }]
|
|
5378
|
-
};
|
|
5379
|
-
|
|
5380
5276
|
class CacheService {
|
|
5381
5277
|
constructor() {
|
|
5382
5278
|
this.localStorageAvailable = false;
|
|
@@ -5595,6 +5491,163 @@ ResizableBase.propDecorators = {
|
|
|
5595
5491
|
id: [{ type: Input }]
|
|
5596
5492
|
};
|
|
5597
5493
|
|
|
5494
|
+
/**
|
|
5495
|
+
* Make an element resizable horizontally by wrapping it in the ResizableComponent.
|
|
5496
|
+
* Default widths / limits are applied but you can optionally override them
|
|
5497
|
+
* with min-width and max-width with style attributes
|
|
5498
|
+
* @example
|
|
5499
|
+
* <ec-resizable [style.width.px]="200"
|
|
5500
|
+
* [style.min-width.px]="75"
|
|
5501
|
+
* [style.max-width.px]="300">
|
|
5502
|
+
* <div> ... </div>
|
|
5503
|
+
* </ec-resizable>
|
|
5504
|
+
*/
|
|
5505
|
+
class ResizableComponent extends ResizableBase {
|
|
5506
|
+
constructor(el, renderer, cacheService, document) {
|
|
5507
|
+
super(renderer, cacheService, document);
|
|
5508
|
+
this.el = el;
|
|
5509
|
+
//default rememberWidth to true for standard resizable, resizable tables default to false
|
|
5510
|
+
this.rememberWidth = true;
|
|
5511
|
+
}
|
|
5512
|
+
/** Store the host element to reference later */
|
|
5513
|
+
ngOnInit() {
|
|
5514
|
+
this.currentEl = this.el.nativeElement;
|
|
5515
|
+
}
|
|
5516
|
+
/**
|
|
5517
|
+
* Set the new width of the element and emit the new width to subscribers
|
|
5518
|
+
*/
|
|
5519
|
+
setWidth(width) {
|
|
5520
|
+
this.renderer.setStyle(this.currentEl, 'width', width + 'px');
|
|
5521
|
+
this.saveWidths([width]);
|
|
5522
|
+
}
|
|
5523
|
+
/**Called from the base class when cached widths are available and restoring
|
|
5524
|
+
* width is enabled. We only care about the first one because we only have one width
|
|
5525
|
+
*/
|
|
5526
|
+
restoreWidths(widths) {
|
|
5527
|
+
this.setWidth(widths[0]);
|
|
5528
|
+
}
|
|
5529
|
+
}
|
|
5530
|
+
ResizableComponent.decorators = [
|
|
5531
|
+
{ type: Component, args: [{
|
|
5532
|
+
selector: 'ec-resizable',
|
|
5533
|
+
template: `<div class="content">
|
|
5534
|
+
<ng-content></ng-content>
|
|
5535
|
+
</div>
|
|
5536
|
+
<div class="handle" (mousedown)="startDrag($event)"></div>`,
|
|
5537
|
+
styles: ["@-webkit-keyframes spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}:host{border-right:1px solid #d2d7d9;display:flex;max-width:480px;min-width:100px;position:relative;width:240px}:host.is-active{-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;user-select:none}:host.is-active .handle:after{background-color:#0084a9}.handle{height:100%;padding:0 5px;position:absolute;right:-7px;top:0;width:13px;z-index:30}.handle:after{content:\"\";display:block;height:100%;position:relative;transition:background-color .3s ease}.handle:hover{cursor:col-resize}.handle:hover:after{background-color:#0084a9}.content{display:flex;overflow:hidden}.content,.content ::ng-deep>*{flex:1 1;min-height:0;min-width:0}"]
|
|
5538
|
+
},] }
|
|
5539
|
+
];
|
|
5540
|
+
ResizableComponent.ctorParameters = () => [
|
|
5541
|
+
{ type: ElementRef },
|
|
5542
|
+
{ type: Renderer2 },
|
|
5543
|
+
{ type: CacheService },
|
|
5544
|
+
{ type: Document, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
|
|
5545
|
+
];
|
|
5546
|
+
|
|
5547
|
+
/** Exposes the markup and styles that represent the spinner. No inputs or outputs defined because it is just a visual component*/
|
|
5548
|
+
class SpinnerComponent {
|
|
5549
|
+
}
|
|
5550
|
+
SpinnerComponent.decorators = [
|
|
5551
|
+
{ type: Component, args: [{
|
|
5552
|
+
selector: 'ec-spinner',
|
|
5553
|
+
template: "<div class=\"spinner\">\r\n <span class=\"spinner-dot\"></span>\r\n <span class=\"spinner-dot\"></span>\r\n <span class=\"spinner-dot\"></span>\r\n <span class=\"spinner-dot\"></span>\r\n</div>",
|
|
5554
|
+
styles: ["@-webkit-keyframes sk-bouncedelay{0%,80%,to{opacity:0}40%{opacity:1}}@keyframes sk-bouncedelay{0%,80%,to{opacity:0}40%{opacity:1}}.spinner{display:flex}.spinner-dot{-webkit-animation:sk-bouncedelay 1.7s ease-in-out infinite both;animation:sk-bouncedelay 1.7s ease-in-out infinite both;background-color:#0084a9;height:.75rem;margin-right:.25rem;width:.75rem}.spinner-dot:first-child{-webkit-animation-delay:-.6s;animation-delay:-.6s}.spinner-dot:nth-child(2){-webkit-animation-delay:-.4s;animation-delay:-.4s}.spinner-dot:nth-child(3){-webkit-animation-delay:-.2s;animation-delay:-.2s}:host(.spinner-small) .spinner-dot{-webkit-animation:sk-bouncedelay 1.7s ease-in-out infinite both;animation:sk-bouncedelay 1.7s ease-in-out infinite both;background-color:#0084a9;height:.5rem;margin-right:.1666666667rem;width:.5rem}:host(.spinner-small) .spinner-dot:first-child{-webkit-animation-delay:-.6s;animation-delay:-.6s}:host(.spinner-small) .spinner-dot:nth-child(2){-webkit-animation-delay:-.4s;animation-delay:-.4s}:host(.spinner-small) .spinner-dot:nth-child(3){-webkit-animation-delay:-.2s;animation-delay:-.2s}"]
|
|
5555
|
+
},] }
|
|
5556
|
+
];
|
|
5557
|
+
|
|
5558
|
+
class SplashService {
|
|
5559
|
+
constructor() {
|
|
5560
|
+
/** Used to interact with the splash component
|
|
5561
|
+
* The splash component will subscribe to this and any components
|
|
5562
|
+
* that wish to bring the splash visible can use this to communicate
|
|
5563
|
+
* with the splash component.
|
|
5564
|
+
*/
|
|
5565
|
+
this._splashVisibility = new Subject();
|
|
5566
|
+
this.splashVisibility = this._splashVisibility;
|
|
5567
|
+
}
|
|
5568
|
+
/**
|
|
5569
|
+
* Shows the splash screen
|
|
5570
|
+
*/
|
|
5571
|
+
showSplash() {
|
|
5572
|
+
this._splashVisibility.next(true);
|
|
5573
|
+
}
|
|
5574
|
+
/**
|
|
5575
|
+
* Hides the splash screen
|
|
5576
|
+
*/
|
|
5577
|
+
hideSplash() {
|
|
5578
|
+
this._splashVisibility.next(false);
|
|
5579
|
+
}
|
|
5580
|
+
}
|
|
5581
|
+
SplashService.ɵprov = ɵɵdefineInjectable({ factory: function SplashService_Factory() { return new SplashService(); }, token: SplashService, providedIn: "root" });
|
|
5582
|
+
SplashService.decorators = [
|
|
5583
|
+
{ type: Injectable, args: [{
|
|
5584
|
+
providedIn: 'root'
|
|
5585
|
+
},] }
|
|
5586
|
+
];
|
|
5587
|
+
SplashService.ctorParameters = () => [];
|
|
5588
|
+
|
|
5589
|
+
class SplashComponent {
|
|
5590
|
+
constructor(splashService) {
|
|
5591
|
+
this.splashService = splashService;
|
|
5592
|
+
/** Sets the visibility of the splash display */
|
|
5593
|
+
this.isVisible = true;
|
|
5594
|
+
this.stopAnimation = false;
|
|
5595
|
+
/** Emits when the service is destroyed */
|
|
5596
|
+
this.destroyed = new Subject();
|
|
5597
|
+
}
|
|
5598
|
+
ngOnInit() {
|
|
5599
|
+
this.splashService.splashVisibility.pipe(takeUntil(this.destroyed), tap((value) => __awaiter(this, void 0, void 0, function* () {
|
|
5600
|
+
if (value) {
|
|
5601
|
+
this.stopAnimation = false;
|
|
5602
|
+
}
|
|
5603
|
+
else {
|
|
5604
|
+
// Prevent animation from continuing after splash screen is hidden
|
|
5605
|
+
// but if we hide it then show while the timer is running, don't stop the animation after all
|
|
5606
|
+
timer(1000).pipe(takeUntil(this.splashService.splashVisibility)).subscribe(() => {
|
|
5607
|
+
this.stopAnimation = true;
|
|
5608
|
+
});
|
|
5609
|
+
}
|
|
5610
|
+
}))).subscribe(showSplash => {
|
|
5611
|
+
this.isVisible = showSplash;
|
|
5612
|
+
});
|
|
5613
|
+
}
|
|
5614
|
+
ngOnDestroy() {
|
|
5615
|
+
this.destroyed.next();
|
|
5616
|
+
this.destroyed.unsubscribe();
|
|
5617
|
+
}
|
|
5618
|
+
}
|
|
5619
|
+
SplashComponent.decorators = [
|
|
5620
|
+
{ type: Component, args: [{
|
|
5621
|
+
selector: 'ec-splash',
|
|
5622
|
+
template: "<div class=\"app-splash\"\r\n [class.app-loaded]=\"!isVisible\">\r\n\r\n <!-- This is the raw icon.svg file so we can animate it -->\r\n <svg [class.d-none]=\"stopAnimation\" \r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n width=\"50\"\r\n height=\"50\"\r\n viewBox=\"0 0 50 50\">\r\n <g>\r\n <g>\r\n <path fill=\"#A0AD39\"\r\n fill-rule=\"nonzero\"\r\n d=\"M34.93,32.25 L34.93,37.25 L15.21,37.25 L15.21,32.25 L34.93,32.25 Z M28.45,22.48 L28.45,27.48 L15.21,27.48 L15.21,22.48 L28.45,22.48 Z M34.93,12.71 L34.93,17.71 L15.21,17.71 L15.21,12.71 L34.93,12.71 Z\" />\r\n <path fill=\"#A0AD39\"\r\n d=\"M24.99,5 C31.1,5 36.56,7.75 40.23,12.07 L44.33,9.16 C39.75,3.57 32.78,0 24.99,0 C17.2,0 10.23,3.57 5.65,9.16 L9.75,12.07 C13.42,7.75 18.88,5 24.99,5 Z\" />\r\n </g>\r\n <path fill=\"#17303B\"\r\n d=\"M40.24,37.93 C36.57,42.25 31.11,45 25,45 C18.89,45 13.43,42.25 9.76,37.93 L9.78,37.92 C6.82,34.43 5,29.94 5,25 C5,21.86 5.74,18.91 7.03,16.26 L2.89,13.33 C1.05,16.81 0,20.78 0,25 C0,31.01 2.13,36.52 5.66,40.83 L5.66,40.83 C10.24,46.42 17.21,49.99 25,49.99 C32.79,49.99 39.76,46.42 44.34,40.83 L40.24,37.93 Z\" />\r\n </g>\r\n\r\n </svg>\r\n</div>"
|
|
5623
|
+
},] }
|
|
5624
|
+
];
|
|
5625
|
+
SplashComponent.ctorParameters = () => [
|
|
5626
|
+
{ type: SplashService }
|
|
5627
|
+
];
|
|
5628
|
+
|
|
5629
|
+
class ResizableColumnComponent {
|
|
5630
|
+
constructor(el) {
|
|
5631
|
+
this.el = el;
|
|
5632
|
+
this.onResize = new EventEmitter();
|
|
5633
|
+
}
|
|
5634
|
+
emitWidth(width) {
|
|
5635
|
+
this.onResize.emit(width);
|
|
5636
|
+
}
|
|
5637
|
+
}
|
|
5638
|
+
ResizableColumnComponent.decorators = [
|
|
5639
|
+
{ type: Component, args: [{
|
|
5640
|
+
selector: 'th.is-resizable',
|
|
5641
|
+
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"
|
|
5642
|
+
},] }
|
|
5643
|
+
];
|
|
5644
|
+
ResizableColumnComponent.ctorParameters = () => [
|
|
5645
|
+
{ type: ElementRef }
|
|
5646
|
+
];
|
|
5647
|
+
ResizableColumnComponent.propDecorators = {
|
|
5648
|
+
onResize: [{ type: Output }]
|
|
5649
|
+
};
|
|
5650
|
+
|
|
5598
5651
|
/**
|
|
5599
5652
|
* Add the ability to resize columns to a standard HTML table.
|
|
5600
5653
|
* Specify a column as resizable by adding the .is-resizable class to a <th>.
|
|
@@ -7480,6 +7533,50 @@ TimeDisplayPipe.ctorParameters = () => [
|
|
|
7480
7533
|
{ type: UserPreferenceService }
|
|
7481
7534
|
];
|
|
7482
7535
|
|
|
7536
|
+
class RelativeDatePipe {
|
|
7537
|
+
constructor(dateDisplayPipe, timeDisplayPipe, translateService) {
|
|
7538
|
+
this.dateDisplayPipe = dateDisplayPipe;
|
|
7539
|
+
this.timeDisplayPipe = timeDisplayPipe;
|
|
7540
|
+
this.translateService = translateService;
|
|
7541
|
+
}
|
|
7542
|
+
/**
|
|
7543
|
+
* If dateOnly is true, returns timeSelected formatted according to the user's date preference.
|
|
7544
|
+
* If timeOnly is true, returns timeSelected formatted according to the user's time preference.
|
|
7545
|
+
* If any of todayLabel, yesterdayLabel is supplied, use the supplied label.
|
|
7546
|
+
* If dateOnly and timeOnly are both false, returns timeSelected formatted according to the user's date plus time preference.
|
|
7547
|
+
*/
|
|
7548
|
+
transform(timeSelected, options) {
|
|
7549
|
+
const selected = moment(timeSelected);
|
|
7550
|
+
const today = moment();
|
|
7551
|
+
const yesterday = moment().subtract(1, 'day');
|
|
7552
|
+
const timeDisplay = (options === null || options === void 0 ? void 0 : options.dateOnly) ? `` : ` ${this.timeDisplayPipe.transform(timeSelected)}`;
|
|
7553
|
+
let displayValue = null;
|
|
7554
|
+
if (selected.isSame(today, 'day') && !(options === null || options === void 0 ? void 0 : options.showTimeForToday)) {
|
|
7555
|
+
displayValue = this.translateService.instant((options === null || options === void 0 ? void 0 : options.todayLabel) ? options === null || options === void 0 ? void 0 : options.todayLabel : 'today');
|
|
7556
|
+
}
|
|
7557
|
+
else if (selected.isSame(today, 'day') && (options === null || options === void 0 ? void 0 : options.showTimeForToday) && !timeDisplay) {
|
|
7558
|
+
displayValue = this.timeDisplayPipe.transform(timeSelected);
|
|
7559
|
+
}
|
|
7560
|
+
else if (selected.isSame(yesterday, 'day')) {
|
|
7561
|
+
displayValue = this.translateService.instant((options === null || options === void 0 ? void 0 : options.yesterdayLabel) ? options === null || options === void 0 ? void 0 : options.yesterdayLabel : 'yesterday');
|
|
7562
|
+
}
|
|
7563
|
+
else {
|
|
7564
|
+
displayValue = this.dateDisplayPipe.transform(timeSelected);
|
|
7565
|
+
}
|
|
7566
|
+
return `${displayValue}${timeDisplay}`;
|
|
7567
|
+
}
|
|
7568
|
+
}
|
|
7569
|
+
RelativeDatePipe.decorators = [
|
|
7570
|
+
{ type: Pipe, args: [{
|
|
7571
|
+
name: 'relativeDate'
|
|
7572
|
+
},] }
|
|
7573
|
+
];
|
|
7574
|
+
RelativeDatePipe.ctorParameters = () => [
|
|
7575
|
+
{ type: DateDisplayPipe },
|
|
7576
|
+
{ type: TimeDisplayPipe },
|
|
7577
|
+
{ type: TranslateService }
|
|
7578
|
+
];
|
|
7579
|
+
|
|
7483
7580
|
class PageTitleComponent {
|
|
7484
7581
|
}
|
|
7485
7582
|
PageTitleComponent.decorators = [
|
|
@@ -7860,6 +7957,7 @@ ComponentsModule.decorators = [
|
|
|
7860
7957
|
WizardButtonsComponent,
|
|
7861
7958
|
HierarchyTreeComponent,
|
|
7862
7959
|
TreeComponent,
|
|
7960
|
+
RelativeDatePipe,
|
|
7863
7961
|
ResizableComponent
|
|
7864
7962
|
],
|
|
7865
7963
|
imports: [
|
|
@@ -7877,7 +7975,8 @@ ComponentsModule.decorators = [
|
|
|
7877
7975
|
DateDisplayPipe,
|
|
7878
7976
|
TimeDisplayPipe,
|
|
7879
7977
|
MockDateDisplayPipe,
|
|
7880
|
-
RowCountPipe
|
|
7978
|
+
RowCountPipe,
|
|
7979
|
+
RelativeDatePipe
|
|
7881
7980
|
],
|
|
7882
7981
|
exports: [
|
|
7883
7982
|
ButtonComponent,
|
|
@@ -7931,6 +8030,7 @@ ComponentsModule.decorators = [
|
|
|
7931
8030
|
WizardButtonsComponent,
|
|
7932
8031
|
HierarchyTreeComponent,
|
|
7933
8032
|
TreeComponent,
|
|
8033
|
+
RelativeDatePipe,
|
|
7934
8034
|
ResizableComponent
|
|
7935
8035
|
]
|
|
7936
8036
|
},] }
|
|
@@ -8010,59 +8110,6 @@ class Tag {
|
|
|
8010
8110
|
}
|
|
8011
8111
|
;
|
|
8012
8112
|
|
|
8013
|
-
/**
|
|
8014
|
-
* Make an element resizable horizontally by wrapping it in the ResizableComponent.
|
|
8015
|
-
* Default widths / limits are applied but you can optionally override them
|
|
8016
|
-
* with min-width and max-width with style attributes
|
|
8017
|
-
* @example
|
|
8018
|
-
* <ec-resizable [style.width.px]="200"
|
|
8019
|
-
* [style.min-width.px]="75"
|
|
8020
|
-
* [style.max-width.px]="300">
|
|
8021
|
-
* <div> ... </div>
|
|
8022
|
-
* </ec-resizable>
|
|
8023
|
-
*/
|
|
8024
|
-
class ResizableComponent extends ResizableBase {
|
|
8025
|
-
constructor(el, renderer, cacheService, document) {
|
|
8026
|
-
super(renderer, cacheService, document);
|
|
8027
|
-
this.el = el;
|
|
8028
|
-
//default rememberWidth to true for standard resizable, resizable tables default to false
|
|
8029
|
-
this.rememberWidth = true;
|
|
8030
|
-
}
|
|
8031
|
-
/** Store the host element to reference later */
|
|
8032
|
-
ngOnInit() {
|
|
8033
|
-
this.currentEl = this.el.nativeElement;
|
|
8034
|
-
}
|
|
8035
|
-
/**
|
|
8036
|
-
* Set the new width of the element and emit the new width to subscribers
|
|
8037
|
-
*/
|
|
8038
|
-
setWidth(width) {
|
|
8039
|
-
this.renderer.setStyle(this.currentEl, 'width', width + 'px');
|
|
8040
|
-
this.saveWidths([width]);
|
|
8041
|
-
}
|
|
8042
|
-
/**Called from the base class when cached widths are available and restoring
|
|
8043
|
-
* width is enabled. We only care about the first one because we only have one width
|
|
8044
|
-
*/
|
|
8045
|
-
restoreWidths(widths) {
|
|
8046
|
-
this.setWidth(widths[0]);
|
|
8047
|
-
}
|
|
8048
|
-
}
|
|
8049
|
-
ResizableComponent.decorators = [
|
|
8050
|
-
{ type: Component, args: [{
|
|
8051
|
-
selector: 'ec-resizable',
|
|
8052
|
-
template: `<div class="content">
|
|
8053
|
-
<ng-content></ng-content>
|
|
8054
|
-
</div>
|
|
8055
|
-
<div class="handle" (mousedown)="startDrag($event)"></div>`,
|
|
8056
|
-
styles: ["@-webkit-keyframes spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}:host{border-right:1px solid #d2d7d9;display:flex;max-width:480px;min-width:100px;position:relative;width:240px}:host.is-active{-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;user-select:none}:host.is-active .handle:after{background-color:#0084a9}.handle{height:100%;padding:0 5px;position:absolute;right:-7px;top:0;width:13px;z-index:30}.handle:after{content:\"\";display:block;height:100%;position:relative;transition:background-color .3s ease}.handle:hover{cursor:col-resize}.handle:hover:after{background-color:#0084a9}.content{display:flex;overflow:hidden}.content,.content ::ng-deep>*{flex:1 1;min-height:0;min-width:0}"]
|
|
8057
|
-
},] }
|
|
8058
|
-
];
|
|
8059
|
-
ResizableComponent.ctorParameters = () => [
|
|
8060
|
-
{ type: ElementRef },
|
|
8061
|
-
{ type: Renderer2 },
|
|
8062
|
-
{ type: CacheService },
|
|
8063
|
-
{ type: Document, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
|
|
8064
|
-
];
|
|
8065
|
-
|
|
8066
8113
|
class CustomValidators {
|
|
8067
8114
|
}
|
|
8068
8115
|
/**
|
|
@@ -8922,5 +8969,5 @@ class HierarchyBaseTestInjectorFactory {
|
|
|
8922
8969
|
* Generated bundle index. Do not edit.
|
|
8923
8970
|
*/
|
|
8924
8971
|
|
|
8925
|
-
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, HierarchyBase, HierarchyBaseTestInjectorFactory, HierarchyItem, HierarchyMocks, HierarchyTreeComponent, IfViewportWidthDirective, ItemDisplayComponent, JsonDisplayComponent, JsonHelper, MenuComponent, MockActivatedRoute, MockDateDisplayPipe, MockDialog, MockDialogContent, MockTranslateService, MockTranslationHelperService, NavGroup, NavItemActiveDirective, NumericboxComponent, Overlay, PageBaseComponent, PageBaseComponentTestHelper, PageBaseComponentTestInjectorFactory, PageInitResult, PageStatus, PageStatuses, PageTitleComponent, PageViewComponent, PanelCloseDuration, PanelOpenDuration, PopoverComponent, PopupContainerDirective, RadioButtonComponent, RadioButtonOption, ResizableBase, ResizableColumnComponent, ResizableComponent, RowCountPipe, ScrollService, SearchableTableComponent, SelectComponent, SpinnerComponent, SplashComponent, SplashService, SpyFactory, TableComponent, TableLockedColumnComponent, TableMasterHeaderRowComponent, TableMasterRowComponent, TablePaginationComponent, TableSelectableRowComponent, TableSelectableRowContext, TabsComponent, Tag, TagsComponent, TelemetryService, TelemetryTrackerService, TextboxComponent, TimeDisplayPipe, ToastComponent, ToastEvent, ToastService, ToasterComponent, TreeComponent, UnicodeStrings, UserPreferenceService, ValidationMessageService, ViewOverlayComponent, WindowService, WizardBaseComponent, WizardButtonsComponent, WizardProgressComponent, canadianPostalCodeRegex, clickEvent, dateInputFormatRegex, findAllSpacesPattern, forEachFormControl, getApiError, getControlValue, getDecimalPattern, integerPattern, isApiError, menuAnimationSpeed, mockRouterFactory, numericboxValidation, orderByIgnoreCase, otherZipCodeRegex, phoneNumberValidationPattern, sortByIgnoreCase, textboxValidation, unitedStatesZipCodeRegex, urlValidationPattern, validateFormGroupValuesAreUnique, ResizableTableDirective as ɵa, AvatarService as ɵb, TableDetailRowComponent as ɵc };
|
|
8972
|
+
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, HierarchyBase, HierarchyBaseTestInjectorFactory, HierarchyItem, HierarchyMocks, HierarchyTreeComponent, IfViewportWidthDirective, ItemDisplayComponent, JsonDisplayComponent, JsonHelper, MenuComponent, MockActivatedRoute, MockDateDisplayPipe, MockDialog, MockDialogContent, MockTranslateService, MockTranslationHelperService, NavGroup, NavItemActiveDirective, NumericboxComponent, Overlay, PageBaseComponent, PageBaseComponentTestHelper, PageBaseComponentTestInjectorFactory, PageInitResult, PageStatus, PageStatuses, PageTitleComponent, PageViewComponent, PanelCloseDuration, PanelOpenDuration, PopoverComponent, PopupContainerDirective, RadioButtonComponent, RadioButtonOption, RelativeDatePipe, ResizableBase, ResizableColumnComponent, ResizableComponent, RowCountPipe, ScrollService, SearchableTableComponent, SelectComponent, SpinnerComponent, SplashComponent, SplashService, SpyFactory, TableComponent, TableLockedColumnComponent, TableMasterHeaderRowComponent, TableMasterRowComponent, TablePaginationComponent, TableSelectableRowComponent, TableSelectableRowContext, TabsComponent, Tag, TagsComponent, TelemetryService, TelemetryTrackerService, TextboxComponent, TimeDisplayPipe, ToastComponent, ToastEvent, ToastService, ToasterComponent, TreeComponent, UnicodeStrings, UserPreferenceService, ValidationMessageService, ViewOverlayComponent, WindowService, WizardBaseComponent, WizardButtonsComponent, WizardProgressComponent, canadianPostalCodeRegex, clickEvent, dateInputFormatRegex, findAllSpacesPattern, forEachFormControl, getApiError, getControlValue, getDecimalPattern, integerPattern, isApiError, menuAnimationSpeed, mockRouterFactory, numericboxValidation, orderByIgnoreCase, otherZipCodeRegex, phoneNumberValidationPattern, sortByIgnoreCase, textboxValidation, unitedStatesZipCodeRegex, urlValidationPattern, validateFormGroupValuesAreUnique, ResizableTableDirective as ɵa, AvatarService as ɵb, TableDetailRowComponent as ɵc };
|
|
8926
8973
|
//# sourceMappingURL=energycap-components.js.map
|