@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.
@@ -643,6 +643,7 @@
643
643
  this.domResized = false;
644
644
  this.showEmptyDashboard = false;
645
645
  this.isWidgetMgmnt = false;
646
+ this.initialWidgetCount = 10;
646
647
  this.widgetHeight = 2;
647
648
  this.widgetWidth = 4;
648
649
  this.hideDashboardBanner = new core.EventEmitter();
@@ -865,8 +866,28 @@
865
866
  _this.showEmptyDashboard = true;
866
867
  _this.raDashboardEventBus.publish(exports.RAEvent.HideDashboardBanner, _this.showEmptyDashboard);
867
868
  }
869
+ if (_this.widgetList) {
870
+ if (_this.widgetList.length < _this.initialWidgetCount) {
871
+ for (var i = 0; i < _this.widgetList.length; i++)
872
+ _this.loadWidgetData(_this.widgetList[i]);
873
+ }
874
+ else
875
+ for (var i = 0; i < _this.initialWidgetCount; i++)
876
+ _this.loadWidgetData(_this.widgetList[i]);
877
+ }
868
878
  });
869
879
  };
880
+ RADashboardArea.prototype.loadWidgetData = function (widget) {
881
+ widget.canLoadData = true;
882
+ };
883
+ RADashboardArea.prototype.dataLoaded = function () {
884
+ for (var i = this.initialWidgetCount; i < this.widgetList.length; i++) {
885
+ if (!this.widgetList[i].canLoadData) {
886
+ this.widgetList[i].canLoadData = true;
887
+ break;
888
+ }
889
+ }
890
+ };
870
891
  /** To set Area(Gridster) height dynamically as widgets are added/removed */
871
892
  RADashboardArea.prototype.setAreaHeight = function () {
872
893
  var _this = this;
@@ -1132,7 +1153,7 @@
1132
1153
  RADashboardArea = __decorate([
1133
1154
  core.Component({
1134
1155
  selector: 'ra-dashboard-area',
1135
- 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>",
1156
+ 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>",
1136
1157
  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}}"]
1137
1158
  }),
1138
1159
  __metadata("design:paramtypes", [RaDashboardService,
@@ -1236,8 +1257,10 @@
1236
1257
  this.showExcell = true;
1237
1258
  this.hideTitle = false;
1238
1259
  this.inapplicableFilters = [];
1260
+ this.canLoadData = false;
1239
1261
  this.widgetDeleted = new core.EventEmitter();
1240
1262
  this.updateAppliedFilters = new core.EventEmitter();
1263
+ this.dataLoaded = new core.EventEmitter();
1241
1264
  this.isWidgetStateApplicable = false;
1242
1265
  this.widgetEmptyState = '';
1243
1266
  this.lockVisible = false;
@@ -1297,7 +1320,7 @@
1297
1320
  this.refreshWidget(this.data.widgetInfo);
1298
1321
  }
1299
1322
  else {
1300
- this.refreshWidget(this.data.widgetInfo);
1323
+ //this.refreshWidget(this.data.widgetInfo);
1301
1324
  }
1302
1325
  }
1303
1326
  }
@@ -1306,6 +1329,10 @@
1306
1329
  this.invokeWidgetResizedEvent();
1307
1330
  }
1308
1331
  }
1332
+ if (changes.canLoadData && changes.width.currentValue != changes.width.previousValue) {
1333
+ if (this.canLoadData)
1334
+ this.refreshWidget(this.data.widgetInfo);
1335
+ }
1309
1336
  };
1310
1337
  RAWidgetContainer.prototype.invokeWidgetResizedEvent = function () {
1311
1338
  if (this.widgetElement) {
@@ -1496,6 +1523,10 @@
1496
1523
  _this.showPanel = true;
1497
1524
  else
1498
1525
  _this.showPanel = false;
1526
+ if (!_this.data.dataLoaded) {
1527
+ _this.data.dataLoaded = true;
1528
+ _this.dataLoaded.emit();
1529
+ }
1499
1530
  break;
1500
1531
  case 'onConfigEditClicked':
1501
1532
  _this.editWidget();
@@ -2047,6 +2078,10 @@
2047
2078
  core.Input('bulk-action-data'),
2048
2079
  __metadata("design:type", Object)
2049
2080
  ], RAWidgetContainer.prototype, "bulkActionData", void 0);
2081
+ __decorate([
2082
+ core.Input(),
2083
+ __metadata("design:type", Boolean)
2084
+ ], RAWidgetContainer.prototype, "canLoadData", void 0);
2050
2085
  __decorate([
2051
2086
  core.Output(),
2052
2087
  __metadata("design:type", Object)
@@ -2055,6 +2090,10 @@
2055
2090
  core.Output(),
2056
2091
  __metadata("design:type", Object)
2057
2092
  ], RAWidgetContainer.prototype, "updateAppliedFilters", void 0);
2093
+ __decorate([
2094
+ core.Output(),
2095
+ __metadata("design:type", Object)
2096
+ ], RAWidgetContainer.prototype, "dataLoaded", void 0);
2058
2097
  __decorate([
2059
2098
  core.Input('dom-resized'),
2060
2099
  __metadata("design:type", Boolean),