@schneideress/dashboardframework 0.0.272 → 0.0.274

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.
@@ -886,6 +886,9 @@
886
886
  };
887
887
  }
888
888
  };
889
+ RADashboardArea.prototype.widgetLoaded = function (widget) {
890
+ widget.canLoadData = true;
891
+ };
889
892
  /** To initiate eventbus subsctiptions */
890
893
  RADashboardArea.prototype.inititateEventBusSubscritions = function () {
891
894
  var _this = this;
@@ -999,7 +1002,8 @@
999
1002
  var _this = this;
1000
1003
  if (this.templateConfig && this.templateConfig.initialWidgetCount)
1001
1004
  this.initialWidgetCount = this.templateConfig.initialWidgetCount;
1002
- if (location.href.indexOf('loadAllWidgets') > -1)
1005
+ window.scrollTo(0, 0);
1006
+ if (location.href.indexOf('/kiosk/') > -1)
1003
1007
  this.initialWidgetCount = 1000;
1004
1008
  this.currentLoadedIndex = 0;
1005
1009
  this.loading = false;
@@ -1032,6 +1036,7 @@
1032
1036
  });
1033
1037
  };
1034
1038
  RADashboardArea.prototype.loadWidgetsDelta = function () {
1039
+ var _this = this;
1035
1040
  var _a;
1036
1041
  if (!this.loading) {
1037
1042
  this.loading = true;
@@ -1039,7 +1044,9 @@
1039
1044
  this.currentLoadedIndex += this.initialWidgetCount;
1040
1045
  (_a = this.widgetList).push.apply(_a, __spread(widgets));
1041
1046
  this.setAreaHeight();
1042
- this.loading = false;
1047
+ setTimeout(function () {
1048
+ _this.loading = false;
1049
+ });
1043
1050
  }
1044
1051
  };
1045
1052
  RADashboardArea.prototype.dataLoaded = function (widgetElement) {
@@ -1181,7 +1188,8 @@
1181
1188
  this.ngxService.start();
1182
1189
  this.dashboardService.addWidget(data, this.appConfig).subscribe(function (widget) {
1183
1190
  _this.userWidgets.push(widget);
1184
- if (_this.currentLoadedIndex >= _this.userWidgets.length) {
1191
+ if (_this.currentLoadedIndex >= (_this.userWidgets.length - 1)) {
1192
+ _this.currentLoadedIndex++;
1185
1193
  var gridsterItem = _this.responsiveService.getGridsterItem(widget);
1186
1194
  _this.widgetList.push(gridsterItem);
1187
1195
  _this.setAreaHeight();
@@ -1235,7 +1243,8 @@
1235
1243
  });
1236
1244
  }
1237
1245
  this.userWidgets.push(data);
1238
- if (this.currentLoadedIndex >= this.userWidgets.length) {
1246
+ if (this.currentLoadedIndex >= (this.userWidgets.length - 1)) {
1247
+ this.currentLoadedIndex++;
1239
1248
  var gridsterItem = this.responsiveService.getGridsterItem(data);
1240
1249
  this.widgetList.push(gridsterItem);
1241
1250
  this.setAreaHeight();
@@ -1348,7 +1357,7 @@
1348
1357
  RADashboardArea = __decorate([
1349
1358
  core.Component({
1350
1359
  selector: 'ra-dashboard-area',
1351
- 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>",
1360
+ 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 (widgetLoaded)=\"widgetLoaded(item)\" [canLoadData]=\"item.canLoadData\" (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>",
1352
1361
  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}}"]
1353
1362
  }),
1354
1363
  __metadata("design:paramtypes", [RaDashboardService,
@@ -1452,6 +1461,7 @@
1452
1461
  this.showExcell = true;
1453
1462
  this.hideTitle = false;
1454
1463
  this.inapplicableFilters = [];
1464
+ this.canLoadData = false;
1455
1465
  this.widgetDeleted = new core.EventEmitter();
1456
1466
  this.updateAppliedFilters = new core.EventEmitter();
1457
1467
  this.dataLoaded = new core.EventEmitter();
@@ -1524,6 +1534,10 @@
1524
1534
  this.invokeWidgetResizedEvent();
1525
1535
  }
1526
1536
  }
1537
+ if (changes.canLoadData && changes.canLoadData.currentValue != changes.canLoadData.previousValue) {
1538
+ if (this.canLoadData)
1539
+ this.refreshWidget(this.data.widgetInfo);
1540
+ }
1527
1541
  };
1528
1542
  RAWidgetContainer.prototype.invokeWidgetResizedEvent = function () {
1529
1543
  if (this.widgetElement) {
@@ -1791,7 +1805,7 @@
1791
1805
  widgetConfigFilter.widgetInfo.widgetName = widgetInfo.widgetName;
1792
1806
  widgetConfigFilter.globalFilter = this.globalFilter;
1793
1807
  widgetConfigFilter.dashboardInfo = me.dashboardInfo;
1794
- this.widgetElement.loadContent(widgetConfigFilter);
1808
+ //this.widgetElement.loadContent(widgetConfigFilter);
1795
1809
  this.widgetLoaded.emit();
1796
1810
  return [4 /*yield*/, this.setLock(widgetConfigFilter.config)];
1797
1811
  case 1:
@@ -1875,7 +1889,8 @@
1875
1889
  globalFilter: this.globalFilter,
1876
1890
  appConfig: this.appConfig,
1877
1891
  widgetInfo: widgetInfo,
1878
- configChanges: this.getConfigChanges(configChanged)
1892
+ configChanges: this.getConfigChanges(configChanged),
1893
+ dashboardInfo: this.dashboardInfo
1879
1894
  };
1880
1895
  if (!widgetContainerContext.isWidgetLoaded) return [3 /*break*/, 3];
1881
1896
  if (this.widgetElement && typeof (this.widgetElement.setConfigFilter) == 'function') {
@@ -2270,6 +2285,10 @@
2270
2285
  core.Input('bulk-action-data'),
2271
2286
  __metadata("design:type", Object)
2272
2287
  ], RAWidgetContainer.prototype, "bulkActionData", void 0);
2288
+ __decorate([
2289
+ core.Input(),
2290
+ __metadata("design:type", Boolean)
2291
+ ], RAWidgetContainer.prototype, "canLoadData", void 0);
2273
2292
  __decorate([
2274
2293
  core.Output(),
2275
2294
  __metadata("design:type", Object)