@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.
@@ -523,6 +523,9 @@ var RADashboardArea = /** @class */ (function () {
523
523
  };
524
524
  }
525
525
  };
526
+ RADashboardArea.prototype.widgetLoaded = function (widget) {
527
+ widget.canLoadData = true;
528
+ };
526
529
  /** To initiate eventbus subsctiptions */
527
530
  RADashboardArea.prototype.inititateEventBusSubscritions = function () {
528
531
  var _this = this;
@@ -636,7 +639,8 @@ var RADashboardArea = /** @class */ (function () {
636
639
  var _this = this;
637
640
  if (this.templateConfig && this.templateConfig.initialWidgetCount)
638
641
  this.initialWidgetCount = this.templateConfig.initialWidgetCount;
639
- if (location.href.indexOf('loadAllWidgets') > -1)
642
+ window.scrollTo(0, 0);
643
+ if (location.href.indexOf('/kiosk/') > -1)
640
644
  this.initialWidgetCount = 1000;
641
645
  this.currentLoadedIndex = 0;
642
646
  this.loading = false;
@@ -669,6 +673,7 @@ var RADashboardArea = /** @class */ (function () {
669
673
  });
670
674
  };
671
675
  RADashboardArea.prototype.loadWidgetsDelta = function () {
676
+ var _this = this;
672
677
  var _a;
673
678
  if (!this.loading) {
674
679
  this.loading = true;
@@ -676,7 +681,9 @@ var RADashboardArea = /** @class */ (function () {
676
681
  this.currentLoadedIndex += this.initialWidgetCount;
677
682
  (_a = this.widgetList).push.apply(_a, __spread(widgets));
678
683
  this.setAreaHeight();
679
- this.loading = false;
684
+ setTimeout(function () {
685
+ _this.loading = false;
686
+ });
680
687
  }
681
688
  };
682
689
  RADashboardArea.prototype.dataLoaded = function (widgetElement) {
@@ -818,7 +825,8 @@ var RADashboardArea = /** @class */ (function () {
818
825
  this.ngxService.start();
819
826
  this.dashboardService.addWidget(data, this.appConfig).subscribe(function (widget) {
820
827
  _this.userWidgets.push(widget);
821
- if (_this.currentLoadedIndex >= _this.userWidgets.length) {
828
+ if (_this.currentLoadedIndex >= (_this.userWidgets.length - 1)) {
829
+ _this.currentLoadedIndex++;
822
830
  var gridsterItem = _this.responsiveService.getGridsterItem(widget);
823
831
  _this.widgetList.push(gridsterItem);
824
832
  _this.setAreaHeight();
@@ -872,7 +880,8 @@ var RADashboardArea = /** @class */ (function () {
872
880
  });
873
881
  }
874
882
  this.userWidgets.push(data);
875
- if (this.currentLoadedIndex >= this.userWidgets.length) {
883
+ if (this.currentLoadedIndex >= (this.userWidgets.length - 1)) {
884
+ this.currentLoadedIndex++;
876
885
  var gridsterItem = this.responsiveService.getGridsterItem(data);
877
886
  this.widgetList.push(gridsterItem);
878
887
  this.setAreaHeight();
@@ -985,7 +994,7 @@ var RADashboardArea = /** @class */ (function () {
985
994
  RADashboardArea = __decorate([
986
995
  Component({
987
996
  selector: 'ra-dashboard-area',
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>",
997
+ 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>",
989
998
  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}}"]
990
999
  }),
991
1000
  __metadata("design:paramtypes", [RaDashboardService,
@@ -1089,6 +1098,7 @@ var RAWidgetContainer = /** @class */ (function () {
1089
1098
  this.showExcell = true;
1090
1099
  this.hideTitle = false;
1091
1100
  this.inapplicableFilters = [];
1101
+ this.canLoadData = false;
1092
1102
  this.widgetDeleted = new EventEmitter();
1093
1103
  this.updateAppliedFilters = new EventEmitter();
1094
1104
  this.dataLoaded = new EventEmitter();
@@ -1161,6 +1171,10 @@ var RAWidgetContainer = /** @class */ (function () {
1161
1171
  this.invokeWidgetResizedEvent();
1162
1172
  }
1163
1173
  }
1174
+ if (changes.canLoadData && changes.canLoadData.currentValue != changes.canLoadData.previousValue) {
1175
+ if (this.canLoadData)
1176
+ this.refreshWidget(this.data.widgetInfo);
1177
+ }
1164
1178
  };
1165
1179
  RAWidgetContainer.prototype.invokeWidgetResizedEvent = function () {
1166
1180
  if (this.widgetElement) {
@@ -1428,7 +1442,7 @@ var RAWidgetContainer = /** @class */ (function () {
1428
1442
  widgetConfigFilter.widgetInfo.widgetName = widgetInfo.widgetName;
1429
1443
  widgetConfigFilter.globalFilter = this.globalFilter;
1430
1444
  widgetConfigFilter.dashboardInfo = me.dashboardInfo;
1431
- this.widgetElement.loadContent(widgetConfigFilter);
1445
+ //this.widgetElement.loadContent(widgetConfigFilter);
1432
1446
  this.widgetLoaded.emit();
1433
1447
  return [4 /*yield*/, this.setLock(widgetConfigFilter.config)];
1434
1448
  case 1:
@@ -1512,7 +1526,8 @@ var RAWidgetContainer = /** @class */ (function () {
1512
1526
  globalFilter: this.globalFilter,
1513
1527
  appConfig: this.appConfig,
1514
1528
  widgetInfo: widgetInfo,
1515
- configChanges: this.getConfigChanges(configChanged)
1529
+ configChanges: this.getConfigChanges(configChanged),
1530
+ dashboardInfo: this.dashboardInfo
1516
1531
  };
1517
1532
  if (!widgetContainerContext.isWidgetLoaded) return [3 /*break*/, 3];
1518
1533
  if (this.widgetElement && typeof (this.widgetElement.setConfigFilter) == 'function') {
@@ -1907,6 +1922,10 @@ var RAWidgetContainer = /** @class */ (function () {
1907
1922
  Input('bulk-action-data'),
1908
1923
  __metadata("design:type", Object)
1909
1924
  ], RAWidgetContainer.prototype, "bulkActionData", void 0);
1925
+ __decorate([
1926
+ Input(),
1927
+ __metadata("design:type", Boolean)
1928
+ ], RAWidgetContainer.prototype, "canLoadData", void 0);
1910
1929
  __decorate([
1911
1930
  Output(),
1912
1931
  __metadata("design:type", Object)