@schneideress/dashboardframework 0.0.271 → 0.0.272

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.
Files changed (34) hide show
  1. package/bundles/schneideress-dashboardframework.umd.js +415 -118
  2. package/bundles/schneideress-dashboardframework.umd.js.map +1 -1
  3. package/bundles/schneideress-dashboardframework.umd.min.js +1 -15
  4. package/bundles/schneideress-dashboardframework.umd.min.js.map +1 -1
  5. package/esm2015/gridster/lib/gridsterItem.component.js +1 -1
  6. package/esm2015/gridster/lib/gridsterRenderer.service.js +1 -1
  7. package/esm2015/lib/ra-dashboard-area/ra.dashboard.area.js +159 -62
  8. package/esm2015/lib/ra-widget-container/ra.widget.container.component.js +55 -31
  9. package/esm2015/lib/ra.base.dashboard.template.js +4 -2
  10. package/esm2015/lib/ra.dashboard.responsive.service.js +12 -2
  11. package/esm2015/lib/ra.dashboard.service.js +7 -2
  12. package/esm2015/lib/ra.event.enum.js +7 -1
  13. package/esm2015/lib/ra.gridster.config.js +3 -3
  14. package/esm5/gridster/lib/gridsterItem.component.js +1 -1
  15. package/esm5/gridster/lib/gridsterRenderer.service.js +1 -1
  16. package/esm5/lib/ra-dashboard-area/ra.dashboard.area.js +160 -62
  17. package/esm5/lib/ra-widget-container/ra.widget.container.component.js +55 -31
  18. package/esm5/lib/ra.base.dashboard.template.js +4 -2
  19. package/esm5/lib/ra.dashboard.responsive.service.js +12 -2
  20. package/esm5/lib/ra.dashboard.service.js +7 -2
  21. package/esm5/lib/ra.event.enum.js +7 -1
  22. package/esm5/lib/ra.gridster.config.js +3 -3
  23. package/fesm2015/schneideress-dashboardframework.js +240 -96
  24. package/fesm2015/schneideress-dashboardframework.js.map +1 -1
  25. package/fesm5/schneideress-dashboardframework.js +242 -97
  26. package/fesm5/schneideress-dashboardframework.js.map +1 -1
  27. package/lib/ra-dashboard-area/ra.dashboard.area.d.ts +23 -2
  28. package/lib/ra-widget-container/ra.widget.container.component.d.ts +5 -2
  29. package/lib/ra.base.dashboard.template.d.ts +4 -2
  30. package/lib/ra.dashboard.responsive.service.d.ts +1 -1
  31. package/lib/ra.dashboard.service.d.ts +0 -1
  32. package/lib/ra.event.enum.d.ts +7 -1
  33. package/package.json +1 -1
  34. package/schneideress-dashboardframework.metadata.json +1 -1
@@ -1,4 +1,4 @@
1
- import { __extends, __decorate, __metadata, __awaiter, __generator, __assign, __param } from 'tslib';
1
+ import { __extends, __decorate, __metadata, __spread, __awaiter, __generator, __assign, __param } from 'tslib';
2
2
  import { Injector, ɵɵdefineInjectable, ɵɵinject, INJECTOR, Injectable, EventEmitter, NgZone, Input, Output, ViewChild, ElementRef, Component, Renderer2, ChangeDetectorRef, ViewEncapsulation, Host, NgModule } from '@angular/core';
3
3
  import { of, Subject } from 'rxjs';
4
4
  import { BaseService, RATranslateService, RAPermissionService, DomService, RACommonModule } from '@schneideress/ra-common';
@@ -17,7 +17,6 @@ var RaDashboardService = /** @class */ (function (_super) {
17
17
  function RaDashboardService(injector) {
18
18
  var _this = _super.call(this, injector, '') || this;
19
19
  _this.loadedScripts = [];
20
- _this.clientId = undefined;
21
20
  return _this;
22
21
  }
23
22
  /*
@@ -70,6 +69,12 @@ var RaDashboardService = /** @class */ (function (_super) {
70
69
  /**To Update widgetInfo in database */
71
70
  RaDashboardService.prototype.updateWidget = function (widgetInfo, appConfig) {
72
71
  this.baseUrl = appConfig.apiBaseUrl;
72
+ var info = {};
73
+ info.widgetConfigInfo = widgetInfo.widgetConfigInfo;
74
+ info.widgetInstanceId = widgetInfo.widgetInstanceId;
75
+ info.widgetTitle = widgetInfo.widgetTitle;
76
+ info.widgetType = widgetInfo.widgetType;
77
+ info.widgetId = widgetInfo.widgetId;
73
78
  return this.post('widget/UpdateUserWidget', widgetInfo);
74
79
  };
75
80
  /** To Move or change position if current widget container*/
@@ -185,6 +190,12 @@ var RAEvent;
185
190
  RAEvent["UpdateAppledFiterForInapplicableFilter"] = "UpdateAppledFiterForInapplicableFilter";
186
191
  /**show inapplicable filter message in global filter flyout */
187
192
  RAEvent["ShowInapplicableFilterMessage"] = "ShowInapplicableFilterMessage";
193
+ /** Bulk Action Clicked */
194
+ RAEvent["BulkActionClick"] = "BulkActionClick";
195
+ /** Global Filter Clicked */
196
+ /** When user change the curated filter(eg:data streams), system will create/delete widgets */
197
+ RAEvent["CuratedFilterChange"] = "CuratedFilterChange";
198
+ RAEvent["GlobalFilterClick"] = "GlobalFilterClick";
188
199
  })(RAEvent || (RAEvent = {}));
189
200
  var RAEventKey;
190
201
  (function (RAEventKey) {
@@ -198,9 +209,9 @@ var GridsterConfigDefaultSettings = {
198
209
  margin: 10,
199
210
  outerMargin: true,
200
211
  outerMarginTop: 10,
201
- outerMarginRight: 10,
212
+ outerMarginRight: 0,
202
213
  outerMarginBottom: 30,
203
- outerMarginLeft: 10,
214
+ outerMarginLeft: 0,
204
215
  useTransformPositioning: true,
205
216
  mobileBreakpoint: 640,
206
217
  minCols: 10,
@@ -315,7 +326,7 @@ var RADashboardResponsiveService = /** @class */ (function () {
315
326
  enumerable: true,
316
327
  configurable: true
317
328
  });
318
- RADashboardResponsiveService.prototype.getGridsterConfig = function (isWidgetMgmnt) {
329
+ RADashboardResponsiveService.prototype.getGridsterConfig = function (isWidgetMgmnt, resize, canMove) {
319
330
  var config = GridsterConfigDefaultSettings;
320
331
  config.minCols = this.currentResInfo.maxCols;
321
332
  config.maxCols = this.currentResInfo.maxCols;
@@ -337,6 +348,13 @@ var RADashboardResponsiveService = /** @class */ (function () {
337
348
  config.swap = true;
338
349
  config.draggable.enabled = true;
339
350
  }
351
+ if (!resize) {
352
+ config.resizable.enabled = false;
353
+ config.swap = false;
354
+ }
355
+ if (!canMove) {
356
+ config.draggable.enabled = false;
357
+ }
340
358
  return config;
341
359
  };
342
360
  /**To map IwidgetInfo object to gridsterItem */
@@ -344,6 +362,9 @@ var RADashboardResponsiveService = /** @class */ (function () {
344
362
  if (widget.widgetSettings) {
345
363
  widget.settings = JSON.parse(widget.widgetSettings);
346
364
  }
365
+ if (widget.templateSettings) {
366
+ widget.templateWidgetSettings = JSON.parse(widget.templateSettings);
367
+ }
347
368
  var gridsterItem = {
348
369
  cols: this.getWidth(widget.width),
349
370
  rows: this.getHeight(widget.height),
@@ -411,14 +432,21 @@ var RADashboardArea = /** @class */ (function () {
411
432
  this.domResized = false;
412
433
  this.showEmptyDashboard = false;
413
434
  this.isWidgetMgmnt = false;
435
+ this.initialWidgetCount = 10;
436
+ this.currentLoadedIndex = 0;
437
+ this.loading = false;
414
438
  this.widgetHeight = 2;
415
439
  this.widgetWidth = 4;
416
440
  this.hideDashboardBanner = new EventEmitter();
417
441
  }
418
442
  RADashboardArea.prototype.ngOnInit = function () {
419
443
  var _this = this;
444
+ window.addEventListener('scroll', function () {
445
+ _this.loadNext();
446
+ });
420
447
  this.isWidgetMgmnt = this.permissionService.hasPermission('ra.widgetmanagement');
421
448
  this.initiateGridsterConfig();
449
+ this.setEmptyDashboardConfig();
422
450
  this.lastViewType = this.responsiveService.IsDesktopView ? 'desktop' : 'mobile';
423
451
  this.responsiveService.resized.subscribe(function (isDesktop) {
424
452
  if (_this.lastViewType != (isDesktop ? 'desktop' : 'mobile') || !isDesktop) {
@@ -447,6 +475,11 @@ var RADashboardArea = /** @class */ (function () {
447
475
  }, 100);
448
476
  }
449
477
  });
478
+ setTimeout(function () {
479
+ _this.bulkActionClick = _this.raDashboardEventBus.subscribe(RAEvent.BulkActionClick).subscribe(function (data) {
480
+ _this.bulkActionData = JSON.parse(JSON.stringify(data)); // To create a new reference;
481
+ });
482
+ });
450
483
  };
451
484
  RADashboardArea.prototype.ngOnChanges = function (changes) {
452
485
  this.isWidgetMgmnt = this.permissionService.hasPermission('ra.widgetmanagement');
@@ -454,28 +487,41 @@ var RADashboardArea = /** @class */ (function () {
454
487
  this.isWidgetLoaded = true;
455
488
  this.loadWidgets(this.userDashboardId, this.areaKey);
456
489
  }
490
+ this.initiateGridsterConfig();
457
491
  if (changes.raDashboardEventBus && changes.raDashboardEventBus.currentValue != changes.raDashboardEventBus.previousValue) {
458
492
  this.inititateEventBusSubscritions();
459
493
  }
460
494
  };
495
+ RADashboardArea.prototype.setEmptyDashboardConfig = function () {
496
+ if (this.dashboardInfo && this.dashboardInfo.templateConfig.emptyDashboardHeader) {
497
+ this.emptyDashboardTitle = this.translateService.translate("dashboard." + this.dashboardInfo.templateConfig.emptyDashboardHeader.titleKey);
498
+ this.emptyDashboardMsg1 = this.translateService.translate("dashboard." + this.dashboardInfo.templateConfig.emptyDashboardHeader.descriptionKey1);
499
+ this.emptyDashboardMsg2 = (this.dashboardInfo.templateConfig.emptyDashboardHeader.descriptionKey2) ? this.translateService.translate("dashboard." + this.dashboardInfo.templateConfig.emptyDashboardHeader.descriptionKey2) : '';
500
+ this.emptyDashboardButtonText = this.translateService.translate("dashboard." + this.dashboardInfo.templateConfig.emptyDashboardHeader.buttonTextKey);
501
+ this.emptyDashboardButtonIcon = this.dashboardInfo.templateConfig.emptyDashboardHeader.buttonIcon ? this.dashboardInfo.templateConfig.emptyDashboardHeader.buttonIcon : '';
502
+ this.emptyDashboardButtonAction = this.dashboardInfo.templateConfig.emptyDashboardHeader.buttonAction ? this.dashboardInfo.templateConfig.emptyDashboardHeader.buttonAction : '';
503
+ }
504
+ };
461
505
  /**To set GridsterConfig */
462
506
  RADashboardArea.prototype.initiateGridsterConfig = function () {
463
507
  var _this = this;
464
- /**To override default configuration values to the gridster control */
465
- this.options = this.responsiveService.getGridsterConfig(this.isWidgetMgmnt);
466
- this.options.initCallback = function (gridster) {
467
- if (_this.options.api) {
468
- _this.gridcellHeight = _this.options.api.getCurrentRowHeight();
469
- }
470
- };
471
- this.options.itemChangeCallback = function (item) {
472
- if (_this.responsiveService.IsDesktopView) {
473
- if (item.widgetInfo && item.widgetInfo.widgetInstanceId) {
474
- _this.updateWidgetPosition(item.widgetInfo.widgetInstanceId);
508
+ if (this.dashboardInfo) {
509
+ /**To override default configuration values to the gridster control */
510
+ this.options = this.responsiveService.getGridsterConfig(this.isWidgetMgmnt, this.dashboardInfo.templateConfig.widget.canResize, this.dashboardInfo.templateConfig.widget.canMove);
511
+ this.options.initCallback = function (gridster) {
512
+ if (_this.options.api) {
513
+ _this.gridcellHeight = _this.options.api.getCurrentRowHeight();
475
514
  }
476
- }
477
- _this.setAreaHeight();
478
- };
515
+ };
516
+ this.options.itemChangeCallback = function (item) {
517
+ if (_this.responsiveService.IsDesktopView) {
518
+ if (item.widgetInfo && item.widgetInfo.widgetInstanceId) {
519
+ _this.updateWidgetPosition(item.widgetInfo.widgetInstanceId);
520
+ }
521
+ }
522
+ _this.setAreaHeight();
523
+ };
524
+ }
479
525
  };
480
526
  /** To initiate eventbus subsctiptions */
481
527
  RADashboardArea.prototype.inititateEventBusSubscritions = function () {
@@ -495,6 +541,11 @@ var RADashboardArea = /** @class */ (function () {
495
541
  _this.addWidget(e);
496
542
  });
497
543
  });
544
+ this.curatedFilterChange = this.raDashboardEventBus.subscribe(RAEvent.CuratedFilterChange).subscribe(function (e) {
545
+ _this.ngZone.run(function () {
546
+ _this.loadWidgets(_this.userDashboardId, _this.areaKey);
547
+ });
548
+ });
498
549
  this.rearrangeWidgetClick = this.raDashboardEventBus.subscribe(RAEvent.RearrangeClicked).subscribe(function (e) {
499
550
  _this.ngZone.run(function () {
500
551
  _this.rearrangeWidgets();
@@ -543,6 +594,10 @@ var RADashboardArea = /** @class */ (function () {
543
594
  this.widgetLibraryDoneClick.unsubscribe();
544
595
  if (this.rearrangeWidgetClick)
545
596
  this.rearrangeWidgetClick.unsubscribe();
597
+ if (this.curatedFilterChange)
598
+ this.curatedFilterChange.unsubscribe();
599
+ if (this.bulkActionClick)
600
+ this.bulkActionClick.unsubscribe();
546
601
  };
547
602
  /**To update position/dimention of all widgets in the area */
548
603
  RADashboardArea.prototype.updateWidgets = function () {
@@ -579,6 +634,12 @@ var RADashboardArea = /** @class */ (function () {
579
634
  /** To retrieve widgets based on userDashboardid and area name */
580
635
  RADashboardArea.prototype.loadWidgets = function (userDashboarId, areaKey) {
581
636
  var _this = this;
637
+ if (this.templateConfig && this.templateConfig.initialWidgetCount)
638
+ this.initialWidgetCount = this.templateConfig.initialWidgetCount;
639
+ if (location.href.indexOf('loadAllWidgets') > -1)
640
+ this.initialWidgetCount = 1000;
641
+ this.currentLoadedIndex = 0;
642
+ this.loading = false;
582
643
  var widgetInfo = {
583
644
  dashboardId: userDashboarId.toString(),
584
645
  dashboardAreaKey: areaKey
@@ -586,7 +647,6 @@ var RADashboardArea = /** @class */ (function () {
586
647
  this.widgetList = [];
587
648
  this.dashboardService.getWidgetsByDashboardArea(widgetInfo, this.appConfig).subscribe(function (widgets) {
588
649
  _this.userWidgets = widgets;
589
- _this.dashboardService.clientId = widgets[0].clientId;
590
650
  _this.PAMWidgets = [];
591
651
  widgets.forEach(function (element) {
592
652
  var settings = undefined;
@@ -598,8 +658,8 @@ var RADashboardArea = /** @class */ (function () {
598
658
  });
599
659
  _this.checkPAMWidgets();
600
660
  if (widgets && widgets.length > 0) {
601
- _this.widgetList = _this.mapObjectListToGridsterItemList(widgets);
602
- _this.setAreaHeight();
661
+ _this.widgetList = [];
662
+ _this.loadWidgetsDelta();
603
663
  _this.raDashboardEventBus.publish(RAEvent.HideDashboardBanner, false);
604
664
  }
605
665
  else {
@@ -608,6 +668,42 @@ var RADashboardArea = /** @class */ (function () {
608
668
  }
609
669
  });
610
670
  };
671
+ RADashboardArea.prototype.loadWidgetsDelta = function () {
672
+ var _a;
673
+ if (!this.loading) {
674
+ this.loading = true;
675
+ var widgets = this.mapObjectListToGridsterItemList(this.userWidgets.slice(this.currentLoadedIndex, (this.currentLoadedIndex + this.initialWidgetCount)));
676
+ this.currentLoadedIndex += this.initialWidgetCount;
677
+ (_a = this.widgetList).push.apply(_a, __spread(widgets));
678
+ this.setAreaHeight();
679
+ this.loading = false;
680
+ }
681
+ };
682
+ RADashboardArea.prototype.dataLoaded = function (widgetElement) {
683
+ this.loadNext();
684
+ };
685
+ RADashboardArea.prototype.loadNext = function () {
686
+ if (this.divBottom) {
687
+ if (this.elementInViewport(this.divBottom.nativeElement)) {
688
+ this.loadWidgetsDelta();
689
+ }
690
+ }
691
+ };
692
+ RADashboardArea.prototype.elementInViewport = function (el) {
693
+ var top = el.offsetTop;
694
+ var left = el.offsetLeft;
695
+ var width = el.offsetWidth;
696
+ var height = el.offsetHeight;
697
+ while (el.offsetParent) {
698
+ el = el.offsetParent;
699
+ top += el.offsetTop;
700
+ left += el.offsetLeft;
701
+ }
702
+ return (top >= window.scrollY &&
703
+ left >= window.scrollX &&
704
+ (top + height) <= (window.scrollY + window.innerHeight) &&
705
+ (left + width) <= (window.scrollX + window.innerWidth));
706
+ };
611
707
  /** To set Area(Gridster) height dynamically as widgets are added/removed */
612
708
  RADashboardArea.prototype.setAreaHeight = function () {
613
709
  var _this = this;
@@ -651,22 +747,22 @@ var RADashboardArea = /** @class */ (function () {
651
747
  /** To remove a widget instance from dashboard and to save info in database */
652
748
  RADashboardArea.prototype.deleteWidget = function (widgetInstanceId, isalertDisabled) {
653
749
  if (isalertDisabled === void 0) { isalertDisabled = false; }
750
+ var widget = this.userWidgets.filter(function (item) {
751
+ return item.widgetInstanceId === widgetInstanceId;
752
+ });
753
+ if (widget.length > 0) {
754
+ this.userWidgets.splice(this.userWidgets.indexOf(widget[0]), 1);
755
+ }
756
+ if (this.PAMWidgets.length > 0) {
757
+ var indx = this.PAMWidgets.indexOf(widgetInstanceId);
758
+ if (indx > -1)
759
+ this.PAMWidgets.splice(indx, 1);
760
+ this.checkPAMWidgets();
761
+ }
654
762
  var gridsterItem = this.widgetList.filter(function (item) {
655
763
  return item.widgetInfo.widgetInstanceId === widgetInstanceId;
656
764
  });
657
765
  if (gridsterItem.length > 0) {
658
- var widget = this.userWidgets.filter(function (item) {
659
- return item.widgetInstanceId === widgetInstanceId;
660
- });
661
- if (widget.length > 0) {
662
- this.userWidgets.splice(this.userWidgets.indexOf(widget[0]), 1);
663
- }
664
- if (this.PAMWidgets.length > 0) {
665
- var indx = this.PAMWidgets.indexOf(widgetInstanceId);
666
- if (indx > -1)
667
- this.PAMWidgets.splice(indx, 1);
668
- this.checkPAMWidgets();
669
- }
670
766
  this.widgetList.splice(this.widgetList.indexOf(gridsterItem[0]), 1);
671
767
  this.setAreaHeight();
672
768
  if (!isalertDisabled) {
@@ -681,11 +777,15 @@ var RADashboardArea = /** @class */ (function () {
681
777
  /**To rearrange widgets position in the dashboard, compactLeft&Up,compactLeft,compactUp,etc*/
682
778
  RADashboardArea.prototype.rearrangeWidgets = function () {
683
779
  var _this = this;
780
+ this.currentLoadedIndex = 0;
781
+ this.loading = false;
684
782
  for (var i = 0; i < this.userWidgets.length; i++) {
685
783
  this.userWidgets[i].position_x = 0;
686
784
  this.userWidgets[i].position_y = 0;
687
785
  }
688
- this.widgetList = this.mapObjectListToGridsterItemList(this.userWidgets);
786
+ this.widgetList = [];
787
+ this.loadWidgetsDelta();
788
+ this.raDashboardEventBus.publish(RAEvent.HideDashboardBanner, false);
689
789
  if (this.widgetList.length > 0)
690
790
  this.updateWidgetPosition(this.widgetList[0].widgetInfo.widgetInstanceId);
691
791
  setTimeout(function () {
@@ -718,29 +818,31 @@ var RADashboardArea = /** @class */ (function () {
718
818
  this.ngxService.start();
719
819
  this.dashboardService.addWidget(data, this.appConfig).subscribe(function (widget) {
720
820
  _this.userWidgets.push(widget);
721
- var gridsterItem = _this.responsiveService.getGridsterItem(widget);
722
- _this.widgetList.push(gridsterItem);
723
- _this.setAreaHeight();
724
- if (_this.options.api) {
725
- var curRowHeight = Number(_this.options.api.getCurrentRowHeight());
726
- if (curRowHeight > 0) {
727
- widget.rowHeight = curRowHeight;
728
- _this.gridcellHeight = curRowHeight;
821
+ if (_this.currentLoadedIndex >= _this.userWidgets.length) {
822
+ var gridsterItem = _this.responsiveService.getGridsterItem(widget);
823
+ _this.widgetList.push(gridsterItem);
824
+ _this.setAreaHeight();
825
+ if (_this.options.api) {
826
+ var curRowHeight = Number(_this.options.api.getCurrentRowHeight());
827
+ if (curRowHeight > 0) {
828
+ widget.rowHeight = curRowHeight;
829
+ _this.gridcellHeight = curRowHeight;
830
+ }
729
831
  }
730
- }
731
- var widgetInstanceId = 0;
732
- if (widget && widget.widgetInstanceId) {
733
- widgetInstanceId = widget.widgetInstanceId;
734
- /**To save added widget position in db */
735
- if (_this.responsiveService.IsDesktopView) {
736
- setTimeout(function () {
737
- _this.updateWidgetPosition(widgetInstanceId);
738
- });
832
+ var widgetInstanceId = 0;
833
+ if (widget && widget.widgetInstanceId) {
834
+ widgetInstanceId = widget.widgetInstanceId;
835
+ /**To save added widget position in db */
836
+ if (_this.responsiveService.IsDesktopView) {
837
+ setTimeout(function () {
838
+ _this.updateWidgetPosition(widgetInstanceId);
839
+ });
840
+ }
841
+ }
842
+ if (widget.settings && widget.settings.isPAMWidget) {
843
+ _this.PAMWidgets.push(widget.widgetInstanceId);
844
+ _this.checkPAMWidgets();
739
845
  }
740
- }
741
- if (widget.settings && widget.settings.isPAMWidget) {
742
- _this.PAMWidgets.push(widget.widgetInstanceId);
743
- _this.checkPAMWidgets();
744
846
  }
745
847
  _this.raDashboardEventBus.publish(RAEvent.WidgetAdded, widget);
746
848
  });
@@ -770,12 +872,14 @@ var RADashboardArea = /** @class */ (function () {
770
872
  });
771
873
  }
772
874
  this.userWidgets.push(data);
773
- var gridsterItem = this.responsiveService.getGridsterItem(data);
774
- this.widgetList.push(gridsterItem);
775
- this.setAreaHeight();
776
- if (data.settings && data.settings.isPAMWidget) {
777
- this.PAMWidgets.push(data.widgetInstanceId);
778
- this.checkPAMWidgets();
875
+ if (this.currentLoadedIndex >= this.userWidgets.length) {
876
+ var gridsterItem = this.responsiveService.getGridsterItem(data);
877
+ this.widgetList.push(gridsterItem);
878
+ this.setAreaHeight();
879
+ if (data.settings && data.settings.isPAMWidget) {
880
+ this.PAMWidgets.push(data.widgetInstanceId);
881
+ this.checkPAMWidgets();
882
+ }
779
883
  }
780
884
  };
781
885
  RADashboardArea.prototype.mapObjectListToGridsterItemList = function (widgetList) {
@@ -804,8 +908,11 @@ var RADashboardArea = /** @class */ (function () {
804
908
  });
805
909
  return widgetListArray;
806
910
  };
807
- RADashboardArea.prototype.addNewWidget = function () {
808
- this.raDashboardEventBus.publish(RAEvent.AddNewWidgetToDashboard, null);
911
+ RADashboardArea.prototype.buttonClick = function () {
912
+ if (this.emptyDashboardButtonAction == "widgets")
913
+ this.raDashboardEventBus.publish(RAEvent.AddNewWidgetToDashboard, null);
914
+ else if (this.emptyDashboardButtonAction == "filter")
915
+ this.raDashboardEventBus.publish(RAEvent.GlobalFilterClick, null);
809
916
  };
810
917
  RADashboardArea.prototype.updateAppliedFilters = function (data) {
811
918
  this.raDashboardEventBus.publish(RAEvent.UpdateAppledFiterForInapplicableFilter, data);
@@ -855,6 +962,14 @@ var RADashboardArea = /** @class */ (function () {
855
962
  Input('app-config'),
856
963
  __metadata("design:type", Object)
857
964
  ], RADashboardArea.prototype, "appConfig", void 0);
965
+ __decorate([
966
+ Input('dashboard-info'),
967
+ __metadata("design:type", Object)
968
+ ], RADashboardArea.prototype, "dashboardInfo", void 0);
969
+ __decorate([
970
+ Input(),
971
+ __metadata("design:type", Object)
972
+ ], RADashboardArea.prototype, "templateConfig", void 0);
858
973
  __decorate([
859
974
  Output(),
860
975
  __metadata("design:type", Object)
@@ -863,11 +978,15 @@ var RADashboardArea = /** @class */ (function () {
863
978
  ViewChild('gridWrapper', { static: false }),
864
979
  __metadata("design:type", ElementRef)
865
980
  ], RADashboardArea.prototype, "gridWrapper", void 0);
981
+ __decorate([
982
+ ViewChild('divBottom', { static: false }),
983
+ __metadata("design:type", ElementRef)
984
+ ], RADashboardArea.prototype, "divBottom", void 0);
866
985
  RADashboardArea = __decorate([
867
986
  Component({
868
987
  selector: 'ra-dashboard-area',
869
- template: "<div #gridWrapper class=\"wrap gridster gridster-mobile\" [ngStyle]=\"{'height': userWidgets.length > 0 ? (gridheight + 'px') : 'unset'}\">\r\n <!-- <div #gridWrapper class=\"wrap gridster\"> -->\r\n <gridster [options]=\"options\" style=\"height:100%;\" *ngIf=\"userWidgets.length > 0\">\r\n <gridster-item [item]=\"item\" *ngFor=\"let item of widgetList\">\r\n <ra-widget-container [app-config]=\"appConfig\" [event-bus]=\"raDashboardEventBus\"\r\n (widgetDeleted)=\"deleteWidget($event)\" [data]=\"item\" [global-filter]=\"globalFilter\"\r\n [grid-cell-height]=\"gridcellHeight\" *ngIf=\"gridcellHeight && gridcellHeight > 0\" [widget-width]=\"item.cols\"\r\n [widget-height]=\"item.rows\" [widget-instance-id]=\"item.widgetInstanceId\" [dom-resized]=\"domResized\"\r\n (updateAppliedFilters)=\"updateAppliedFilters($event)\">\r\n </ra-widget-container>\r\n </gridster-item>\r\n </gridster>\r\n\r\n <div class=\"empty-padding kiosk-hide\" *ngIf=\"showEmptyDashboard\">\r\n <div class=\"empty-wrapper\">\r\n <div></div>\r\n <div class=\"m-1 empty-prefix\">\r\n <i class=\"fal fa-edit edit-icon\"></i>\r\n <span class=\"empty-title\">{{'dashboard.emptydashboard'|translate}}</span>\r\n </div>\r\n <div class=\"empty-content light\">\r\n <div>\r\n <div class=\"col-sm-12 empty-msg\">\r\n {{'dashboard.emptydashboardmessage'|translate}} <br />\r\n {{'dashboard.emptydashboardmessage2'|translate}}\r\n </div>\r\n <button *ngIf=\"isWidgetMgmnt\" class=\"btn btnLib btn-sm m-1 dashboard-button light\" (click)=\"addNewWidget()\">\r\n <i class=\"fal fa-plus m-1\"></i>{{'dashboard.addawidgets'|translate}}</button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <notifier-container></notifier-container>\r\n</div>",
870
- styles: ["gridster{width:inherit;resize:height;display:flex;background-color:#ededed;overflow-y:hidden!important}.dvheader{width:100%;height:35px;background:#000;color:#fff;padding:7px 3px 5px 6px;text-transform:uppercase}gridster-item{box-sizing:border-box;z-index:1;position:absolute;overflow:hidden;transition:.3s;display:none;background:#fff;-webkit-user-select:text;-moz-user-select:text;user-select:text;box-shadow:0 1px 10px rgba(0,0,0,.05)}gridster-item:hover{box-shadow:0 1px 10px rgba(0,0,0,.15)}@media screen and (max-width:685px){.gridster-mobile{height:auto!important;margin-bottom:50px!important}}@media screen and (max-width:350px){.gridster-mobile{min-height:330px!important;margin-bottom:0!important}}.empty-padding{padding:40px 20px 20px;background-color:#ededed;display:flex;justify-content:center;align-content:center}.empty-wrapper{display:flex;background-color:#fff;border-radius:8px;min-height:125px;width:72%}.empty-prefix{color:#32ad3c;font-size:18px;display:flex;align-items:center;padding:10px 30px;min-width:-webkit-max-content;min-width:max-content;min-width:-moz-max-content}.empty-content{color:#333;border-left:1px solid #a9afb1;width:100%;display:flex;align-items:center;padding:15px 30px 10px 40px}.empty-msg{padding:0 0 5px;font-size:16px}.dashboard-button{padding:5px 10px 5px 5px!important}.btnLib{background-color:#ededed;color:#333!important}.btn-group-sm>.btn,.btn-sm{padding:5px 20px 5px 5px}.edit-icon{color:#32ad3c;font-size:24px;margin-right:15px}.empty-title{margin-top:10px}@media screen and (max-width:600px){.empty-padding{padding:10px;background-color:#ededed;width:100%;display:block}.empty-wrapper{display:flex;background-color:#fff;border-radius:8px;min-height:125px;width:100%}.empty-prefix{color:#32ad3c;font-size:16px;display:flex;height:40px;padding:6px 10px 8px}.empty-content{color:#333;display:flex;padding:5px 10px 10px;margin-top:44px;margin-left:-185px;border-left:none}.empty-msg{padding:12px 10px 10px 5px;font-size:14px;border-top:1px solid #a9afb1}.edit-icon{color:#32ad3c;font-size:20px;margin-right:6px}.empty-title{margin-top:6px}}"]
988
+ template: "<div #gridWrapper class=\"wrap gridster gridster-mobile\"\r\n [ngStyle]=\"{'height': userWidgets.length > 0 ? (gridheight + 'px') : 'unset'}\">\r\n <!-- <div #gridWrapper class=\"wrap gridster\"> -->\r\n <gridster [options]=\"options\" style=\"height:100%;\" *ngIf=\"userWidgets.length > 0\">\r\n <gridster-item [item]=\"item\" *ngFor=\"let item of widgetList\">\r\n <ra-widget-container (dataLoaded)=\"dataLoaded($event)\"\r\n [bulk-action-data]=\"bulkActionData\" [dashboard-info]=\"dashboardInfo\" [app-config]=\"appConfig\"\r\n [event-bus]=\"raDashboardEventBus\" (widgetDeleted)=\"deleteWidget($event)\" [data]=\"item\"\r\n [global-filter]=\"globalFilter\" [grid-cell-height]=\"gridcellHeight\" *ngIf=\"gridcellHeight && gridcellHeight > 0\"\r\n [widget-width]=\"item.cols\" [widget-height]=\"item.rows\" [widget-instance-id]=\"item.widgetInstanceId\"\r\n [dom-resized]=\"domResized\" (updateAppliedFilters)=\"updateAppliedFilters($event)\">\r\n </ra-widget-container>\r\n </gridster-item>\r\n </gridster>\r\n\r\n <div class=\"empty-padding kiosk-hide\" *ngIf=\"showEmptyDashboard\">\r\n <div class=\"empty-wrapper\">\r\n <div></div>\r\n <div class=\"empty-prefix\">\r\n <!-- <i class=\"fal fa-edit edit-icon\"></i> -->\r\n <span>{{emptyDashboardTitle}}</span>\r\n </div>\r\n <hr class=\"horizontalLine-solid\" />\r\n <div class=\"empty-content light\">\r\n <div>\r\n <div class=\"col-sm-12 empty-msg\">\r\n {{emptyDashboardMsg1}} <br />\r\n {{emptyDashboardMsg2}}\r\n </div>\r\n <button *ngIf=\"isWidgetMgmnt\" class=\"btn btnLib btn-sm dashboard-button light\" (click)=\"buttonClick()\">\r\n <i class=\"{{emptyDashboardButtonIcon}}\"></i>{{emptyDashboardButtonText}}</button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <notifier-container></notifier-container>\r\n</div>\r\n<div #divBottom></div>",
989
+ styles: ["gridster{width:inherit;resize:height;display:flex;background-color:#fff;overflow-y:hidden!important}.dvheader{width:100%;height:35px;background:#000;color:#fff;padding:7px 3px 5px 6px;text-transform:uppercase}gridster-item{box-sizing:border-box;z-index:1;position:absolute;overflow:hidden;transition:.3s;display:none;background:#fff;-webkit-user-select:text;-moz-user-select:text;user-select:text;box-shadow:none}gridster-item:hover{box-shadow:0 1px 10px rgba(0,0,0,.15)!important}@media screen and (max-width:685px){.gridster-mobile{height:auto!important;margin-bottom:50px!important}}@media screen and (max-width:350px){.gridster-mobile{min-height:330px!important;margin-bottom:0!important}}.empty-padding{padding:15px 0;background-color:#fff;display:flex}.empty-wrapper{background-color:#fff;border:1px solid #9fa0a4;min-height:125px;width:100%}.empty-prefix{color:#32ad3c;font-size:18px;padding:15px}.empty-content{color:#626469;width:100%;padding:15px}.empty-msg{padding:0 0 15px;font-size:16px}.horizontalLine-solid{border-top:1px solid #cbcbcb;margin:0 15px}.dashboard-button{padding:5px 10px 5px 5px!important}.btnLib{background-color:#ededed;color:#333!important}.btn-group-sm>.btn,.btn-sm{padding:5px 20px 5px 5px}.edit-icon{color:#32ad3c;font-size:24px;margin-right:15px}.empty-title{margin-top:10px}@media screen and (max-width:600px){.empty-padding{padding:15px 0;background-color:#fff;width:100%;display:block}.empty-wrapper{display:flex;background-color:#fff;border:1px solid #9fa0a4;min-height:125px;width:100%}.empty-prefix{color:#32ad3c;font-size:16px;display:flex;height:40px;padding:15px}.empty-content{color:#333;display:flex;padding:15px}.empty-msg{padding:0 0 15px;font-size:14px}.edit-icon{color:#32ad3c;font-size:20px;margin-right:6px}.empty-title{margin-top:6px}}"]
871
990
  }),
872
991
  __metadata("design:paramtypes", [RaDashboardService,
873
992
  NgZone,
@@ -972,6 +1091,8 @@ var RAWidgetContainer = /** @class */ (function () {
972
1091
  this.inapplicableFilters = [];
973
1092
  this.widgetDeleted = new EventEmitter();
974
1093
  this.updateAppliedFilters = new EventEmitter();
1094
+ this.dataLoaded = new EventEmitter();
1095
+ this.widgetLoaded = new EventEmitter();
975
1096
  this.isWidgetStateApplicable = false;
976
1097
  this.widgetEmptyState = '';
977
1098
  this.lockVisible = false;
@@ -996,7 +1117,7 @@ var RAWidgetContainer = /** @class */ (function () {
996
1117
  configurable: true
997
1118
  });
998
1119
  RAWidgetContainer.prototype.ngOnInit = function () {
999
- this.WidgetDisplayName = this.getwidgetTitleTranslation(this.data.widgetInfo.widgetTitle);
1120
+ this.WidgetDisplayName = this.translateService.translate('Common.' + this.data.widgetInfo.widgetTitle, true);
1000
1121
  this.lockIconTitle = this.translateService.translate('Common.lockedfields');
1001
1122
  this.lockIconFooter = this.translateService.translate('Common.lockedfieldseditinfo');
1002
1123
  this.inapplicableIconTitle = this.translateService.translate('Common.InapplicableFilters');
@@ -1017,19 +1138,28 @@ var RAWidgetContainer = /** @class */ (function () {
1017
1138
  });
1018
1139
  });
1019
1140
  }
1020
- if (this.widgetElement && changes.globalFilter && changes.globalFilter.currentValue != changes.globalFilter.previousValue) {
1021
- var filterObj = this.getParsedConfig(this.globalFilter);
1022
- if (filterObj.WidgetInstanceId) {
1023
- if (this.data.widgetInfo.widgetInstanceId != filterObj.WidgetInstanceId)
1024
- this.refreshWidget(this.data.widgetInfo);
1141
+ if (this.widgetElement) {
1142
+ if (changes.bulkActionData && changes.bulkActionData.currentValue != changes.bulkActionData.previousValue) {
1143
+ if (typeof this.widgetElement.bulkActionClicked === "function") {
1144
+ this.widgetElement.bulkActionClicked(this.bulkActionData);
1145
+ }
1025
1146
  }
1026
- else {
1027
- this.refreshWidget(this.data.widgetInfo);
1147
+ if (changes.globalFilter && changes.globalFilter.currentValue != changes.globalFilter.previousValue) {
1148
+ if (!this.dashboardInfo.curatedFilters) {
1149
+ var filterObj = this.getParsedConfig(this.globalFilter);
1150
+ if (filterObj.WidgetInstanceId) {
1151
+ if (this.data.widgetInfo.widgetInstanceId != filterObj.WidgetInstanceId)
1152
+ this.refreshWidget(this.data.widgetInfo);
1153
+ }
1154
+ else {
1155
+ //this.refreshWidget(this.data.widgetInfo);
1156
+ }
1157
+ }
1158
+ }
1159
+ if (changes.width && changes.width.currentValue != changes.width.previousValue ||
1160
+ (changes.height && changes.height.currentValue != changes.height.previousValue)) {
1161
+ this.invokeWidgetResizedEvent();
1028
1162
  }
1029
- }
1030
- if (changes.width && changes.width.currentValue != changes.width.previousValue ||
1031
- (changes.height && changes.height.currentValue != changes.height.previousValue)) {
1032
- this.invokeWidgetResizedEvent();
1033
1163
  }
1034
1164
  };
1035
1165
  RAWidgetContainer.prototype.invokeWidgetResizedEvent = function () {
@@ -1221,6 +1351,10 @@ var RAWidgetContainer = /** @class */ (function () {
1221
1351
  _this.showPanel = true;
1222
1352
  else
1223
1353
  _this.showPanel = false;
1354
+ if (!_this.data.dataLoaded) {
1355
+ _this.data.dataLoaded = true;
1356
+ _this.dataLoaded.emit(_this.widgetElement);
1357
+ }
1224
1358
  break;
1225
1359
  case 'onConfigEditClicked':
1226
1360
  _this.editWidget();
@@ -1293,7 +1427,9 @@ var RAWidgetContainer = /** @class */ (function () {
1293
1427
  widgetConfigFilter.configChanges = this.getConfigChanges(false);
1294
1428
  widgetConfigFilter.widgetInfo.widgetName = widgetInfo.widgetName;
1295
1429
  widgetConfigFilter.globalFilter = this.globalFilter;
1430
+ widgetConfigFilter.dashboardInfo = me.dashboardInfo;
1296
1431
  this.widgetElement.loadContent(widgetConfigFilter);
1432
+ this.widgetLoaded.emit();
1297
1433
  return [4 /*yield*/, this.setLock(widgetConfigFilter.config)];
1298
1434
  case 1:
1299
1435
  _a.sent();
@@ -1563,9 +1699,12 @@ var RAWidgetContainer = /** @class */ (function () {
1563
1699
  var html = '<div id="ra-db-widget-menu"' + 'style="' + style + '" class="download-content dropdown-content widget-config-item dropdown-click" style="z-index: 1002;">';
1564
1700
  var settings = '';
1565
1701
  if (this.isWidgetMgmnt) {
1566
- settings += this.getHtmlForButton('wcEditWidget', 'fal fa-edit', this.editText);
1567
- settings += this.getHtmlForButton('wcCopyWidget', 'fal fa-copy', this.copyText);
1568
- settings += this.getHtmlForButton('wcMoveWidget', 'fal fa-arrows-alt', this.moveText);
1702
+ if (!this.data.widgetInfo.templateWidgetSettings || !this.data.widgetInfo.templateWidgetSettings.hideEdit)
1703
+ settings += this.getHtmlForButton('wcEditWidget', 'fal fa-edit', this.editText);
1704
+ if (!this.data.widgetInfo.templateWidgetSettings || !this.data.widgetInfo.templateWidgetSettings.hideCopy)
1705
+ settings += this.getHtmlForButton('wcCopyWidget', 'fal fa-copy', this.copyText);
1706
+ if (!this.data.widgetInfo.templateWidgetSettings || !this.data.widgetInfo.templateWidgetSettings.hideMove)
1707
+ settings += this.getHtmlForButton('wcMoveWidget', 'fal fa-arrows-alt', this.moveText);
1569
1708
  }
1570
1709
  var customPageParams = false;
1571
1710
  if (this.data.widgetInfo && this.data.widgetInfo.widgetSettings) {
@@ -1574,14 +1713,14 @@ var RAWidgetContainer = /** @class */ (function () {
1574
1713
  customPageParams = true;
1575
1714
  }
1576
1715
  }
1577
- if ((this.detailPageUrl || customPageParams) && this.checkVisitLinkVisiblity()) {
1716
+ if (!this.data.widgetInfo.templateWidgetSettings || !this.data.widgetInfo.templateWidgetSettings.hideVisitPage && (this.detailPageUrl || customPageParams) && this.checkVisitLinkVisiblity()) {
1578
1717
  settings += '<a style="max-height: 30px;align-items: center;align-content: center; display: flex;" id="wcVisitWidget">';
1579
1718
  settings += '<i style="padding-left: 4px;font-size: 27px !important;" class="fal fa-angle-right"></i> ';
1580
1719
  settings += '<span style="padding-left: 11px;margin-top: 2px;" style="padding-left: 6px;">';
1581
1720
  settings += this.translateService.translate('Common.visitpage');
1582
1721
  settings += '</span></a>';
1583
1722
  }
1584
- if ((this.detailPageUrl && this.checkVisitLinkVisiblity()) || this.isWidgetMgmnt) {
1723
+ if (!this.data.widgetInfo.templateWidgetSettings || !this.data.widgetInfo.templateWidgetSettings.hideVisitPage && (this.detailPageUrl && this.checkVisitLinkVisiblity()) || this.isWidgetMgmnt) {
1585
1724
  html += '<div style="color: #9FA0A4;font-size: 12px;padding-top: 8px;padding-left: 12px;">';
1586
1725
  html += this.translateService.translate('Common.settings') + '</div>';
1587
1726
  html += settings;
@@ -1613,7 +1752,7 @@ var RAWidgetContainer = /** @class */ (function () {
1613
1752
  if (this.isDownloadIconVisible && this.isWidgetMgmnt && this.showExcell) {
1614
1753
  html += this.getHr();
1615
1754
  }
1616
- if (this.isWidgetMgmnt) {
1755
+ if (this.isWidgetMgmnt && !this.data.widgetInfo.templateWidgetSettings || !this.data.widgetInfo.templateWidgetSettings.hideDelete) {
1617
1756
  html += '<a id="wcWidgetDelete"><i class="fal fa-times" style="padding-left: 3px;color: red;"></i><span>';
1618
1757
  html += this.deleteText;
1619
1758
  html += '</span></a>';
@@ -1694,18 +1833,6 @@ var RAWidgetContainer = /** @class */ (function () {
1694
1833
  if (this.currentComponent)
1695
1834
  this.popupInstance.removeMe(this.currentComponent);
1696
1835
  };
1697
- RAWidgetContainer.prototype.getwidgetTitleTranslation = function (item) {
1698
- var rKey = 'DBW_' + this.translateService.makeCode(item);
1699
- var translatedString = '';
1700
- var translationModule = this.dashboardService.clientId + '_DBW';
1701
- translatedString = this.translateService.translate(translationModule + '.' + rKey);
1702
- if (translatedString.toLowerCase() === rKey.toLowerCase()) {
1703
- return item;
1704
- }
1705
- else {
1706
- return translatedString;
1707
- }
1708
- };
1709
1836
  RAWidgetContainer.ctorParameters = function () { return [
1710
1837
  { type: RaDashboardService },
1711
1838
  { type: NgxUiLoaderService },
@@ -1748,6 +1875,10 @@ var RAWidgetContainer = /** @class */ (function () {
1748
1875
  Input('global-filter'),
1749
1876
  __metadata("design:type", Object)
1750
1877
  ], RAWidgetContainer.prototype, "globalFilter", void 0);
1878
+ __decorate([
1879
+ Input('dashboard-info'),
1880
+ __metadata("design:type", Object)
1881
+ ], RAWidgetContainer.prototype, "dashboardInfo", void 0);
1751
1882
  __decorate([
1752
1883
  Input('data'),
1753
1884
  __metadata("design:type", Object)
@@ -1772,6 +1903,10 @@ var RAWidgetContainer = /** @class */ (function () {
1772
1903
  Input('grid-cell-height'),
1773
1904
  __metadata("design:type", Number)
1774
1905
  ], RAWidgetContainer.prototype, "gridCellHeight", void 0);
1906
+ __decorate([
1907
+ Input('bulk-action-data'),
1908
+ __metadata("design:type", Object)
1909
+ ], RAWidgetContainer.prototype, "bulkActionData", void 0);
1775
1910
  __decorate([
1776
1911
  Output(),
1777
1912
  __metadata("design:type", Object)
@@ -1780,6 +1915,14 @@ var RAWidgetContainer = /** @class */ (function () {
1780
1915
  Output(),
1781
1916
  __metadata("design:type", Object)
1782
1917
  ], RAWidgetContainer.prototype, "updateAppliedFilters", void 0);
1918
+ __decorate([
1919
+ Output(),
1920
+ __metadata("design:type", Object)
1921
+ ], RAWidgetContainer.prototype, "dataLoaded", void 0);
1922
+ __decorate([
1923
+ Output(),
1924
+ __metadata("design:type", Object)
1925
+ ], RAWidgetContainer.prototype, "widgetLoaded", void 0);
1783
1926
  __decorate([
1784
1927
  Input('dom-resized'),
1785
1928
  __metadata("design:type", Boolean),
@@ -4778,11 +4921,13 @@ var RaBaseDashboardTemplate = /** @class */ (function () {
4778
4921
  function RaBaseDashboardTemplate(ngZone) {
4779
4922
  var _this = this;
4780
4923
  this.ngZone = ngZone;
4781
- this.initialize = function (eventBus, userDashboardId, appConfig) {
4924
+ this.initialize = function (eventBus, userDashboardId, appConfig, dashboardInfo, templateConfig) {
4782
4925
  _this.ngZone.run(function () {
4783
4926
  _this.userDashboardId = userDashboardId;
4784
4927
  _this.appConfig = appConfig;
4785
4928
  _this.raDashboardEventBus = eventBus;
4929
+ _this.dashboardInfo = dashboardInfo;
4930
+ _this.templateConfig = templateConfig;
4786
4931
  });
4787
4932
  _this.init();
4788
4933
  };