@schneideress/dashboardframework 0.0.266 → 0.0.267

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.
@@ -432,6 +432,7 @@ var RADashboardArea = /** @class */ (function () {
432
432
  this.domResized = false;
433
433
  this.showEmptyDashboard = false;
434
434
  this.isWidgetMgmnt = false;
435
+ this.initialWidgetCount = 10;
435
436
  this.widgetHeight = 2;
436
437
  this.widgetWidth = 4;
437
438
  this.hideDashboardBanner = new EventEmitter();
@@ -654,8 +655,28 @@ var RADashboardArea = /** @class */ (function () {
654
655
  _this.showEmptyDashboard = true;
655
656
  _this.raDashboardEventBus.publish(RAEvent.HideDashboardBanner, _this.showEmptyDashboard);
656
657
  }
658
+ if (_this.widgetList) {
659
+ if (_this.widgetList.length < _this.initialWidgetCount) {
660
+ for (var i = 0; i < _this.widgetList.length; i++)
661
+ _this.loadWidgetData(_this.widgetList[i]);
662
+ }
663
+ else
664
+ for (var i = 0; i < _this.initialWidgetCount; i++)
665
+ _this.loadWidgetData(_this.widgetList[i]);
666
+ }
657
667
  });
658
668
  };
669
+ RADashboardArea.prototype.loadWidgetData = function (widget) {
670
+ widget.canLoadData = true;
671
+ };
672
+ RADashboardArea.prototype.dataLoaded = function () {
673
+ for (var i = this.initialWidgetCount; i < this.widgetList.length; i++) {
674
+ if (!this.widgetList[i].canLoadData) {
675
+ this.widgetList[i].canLoadData = true;
676
+ break;
677
+ }
678
+ }
679
+ };
659
680
  /** To set Area(Gridster) height dynamically as widgets are added/removed */
660
681
  RADashboardArea.prototype.setAreaHeight = function () {
661
682
  var _this = this;
@@ -921,7 +942,7 @@ var RADashboardArea = /** @class */ (function () {
921
942
  RADashboardArea = __decorate([
922
943
  Component({
923
944
  selector: 'ra-dashboard-area',
924
- 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 [bulk-action-data]=\"bulkActionData\" [dashboard-info]=\"dashboardInfo\" [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=\"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>",
945
+ 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 (dataLoaded)=\"dataLoaded()\" [canLoadData]=\"item.canLoadData\" [bulk-action-data]=\"bulkActionData\" [dashboard-info]=\"dashboardInfo\" [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=\"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>",
925
946
  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}}"]
926
947
  }),
927
948
  __metadata("design:paramtypes", [RaDashboardService,
@@ -1025,8 +1046,10 @@ var RAWidgetContainer = /** @class */ (function () {
1025
1046
  this.showExcell = true;
1026
1047
  this.hideTitle = false;
1027
1048
  this.inapplicableFilters = [];
1049
+ this.canLoadData = false;
1028
1050
  this.widgetDeleted = new EventEmitter();
1029
1051
  this.updateAppliedFilters = new EventEmitter();
1052
+ this.dataLoaded = new EventEmitter();
1030
1053
  this.isWidgetStateApplicable = false;
1031
1054
  this.widgetEmptyState = '';
1032
1055
  this.lockVisible = false;
@@ -1086,7 +1109,7 @@ var RAWidgetContainer = /** @class */ (function () {
1086
1109
  this.refreshWidget(this.data.widgetInfo);
1087
1110
  }
1088
1111
  else {
1089
- this.refreshWidget(this.data.widgetInfo);
1112
+ //this.refreshWidget(this.data.widgetInfo);
1090
1113
  }
1091
1114
  }
1092
1115
  }
@@ -1095,6 +1118,10 @@ var RAWidgetContainer = /** @class */ (function () {
1095
1118
  this.invokeWidgetResizedEvent();
1096
1119
  }
1097
1120
  }
1121
+ if (changes.canLoadData && changes.width.currentValue != changes.width.previousValue) {
1122
+ if (this.canLoadData)
1123
+ this.refreshWidget(this.data.widgetInfo);
1124
+ }
1098
1125
  };
1099
1126
  RAWidgetContainer.prototype.invokeWidgetResizedEvent = function () {
1100
1127
  if (this.widgetElement) {
@@ -1285,6 +1312,10 @@ var RAWidgetContainer = /** @class */ (function () {
1285
1312
  _this.showPanel = true;
1286
1313
  else
1287
1314
  _this.showPanel = false;
1315
+ if (!_this.data.dataLoaded) {
1316
+ _this.data.dataLoaded = true;
1317
+ _this.dataLoaded.emit();
1318
+ }
1288
1319
  break;
1289
1320
  case 'onConfigEditClicked':
1290
1321
  _this.editWidget();
@@ -1836,6 +1867,10 @@ var RAWidgetContainer = /** @class */ (function () {
1836
1867
  Input('bulk-action-data'),
1837
1868
  __metadata("design:type", Object)
1838
1869
  ], RAWidgetContainer.prototype, "bulkActionData", void 0);
1870
+ __decorate([
1871
+ Input(),
1872
+ __metadata("design:type", Boolean)
1873
+ ], RAWidgetContainer.prototype, "canLoadData", void 0);
1839
1874
  __decorate([
1840
1875
  Output(),
1841
1876
  __metadata("design:type", Object)
@@ -1844,6 +1879,10 @@ var RAWidgetContainer = /** @class */ (function () {
1844
1879
  Output(),
1845
1880
  __metadata("design:type", Object)
1846
1881
  ], RAWidgetContainer.prototype, "updateAppliedFilters", void 0);
1882
+ __decorate([
1883
+ Output(),
1884
+ __metadata("design:type", Object)
1885
+ ], RAWidgetContainer.prototype, "dataLoaded", void 0);
1847
1886
  __decorate([
1848
1887
  Input('dom-resized'),
1849
1888
  __metadata("design:type", Boolean),