@schneideress/dashboardframework 0.0.190 → 0.0.192

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.
@@ -398,6 +398,8 @@ var RAEvent = {
398
398
  UpdateGlobalFilterFromMapWidget: "UpdateGlobalFilterFromMapWidget",
399
399
  /**To add widget on empty dashboard */
400
400
  AddWidgetEmptyDashboard: "AddWidgetEmptyDashboard",
401
+ /**To raise widget added event */
402
+ AddNewWidgetToDashboard: "AddNewWidgetToDashboard",
401
403
  };
402
404
  /** @enum {string} */
403
405
  var RAEventKey = {
@@ -1079,49 +1081,54 @@ var RADashboardArea = /** @class */ (function () {
1079
1081
  */
1080
1082
  function () {
1081
1083
  var _this = this;
1082
- /** @type {?} */
1083
- var isMobile = false;
1084
- if (this.options.mobileBreakpoint > this.gridWrapper.nativeElement.clientWidth) {
1085
- isMobile = true;
1086
- }
1087
- /** @type {?} */
1088
- var areaScrollHeight = 0;
1089
- /** @type {?} */
1090
- var areaHeight = 0;
1091
- /** @type {?} */
1092
- var curRowHeight = 0;
1093
- if (this.options.api) {
1094
- curRowHeight = this.options.api.getCurrentRowHeight();
1095
- }
1096
- this.widgetList.forEach((/**
1097
- * @param {?} t
1084
+ setTimeout((/**
1098
1085
  * @return {?}
1099
1086
  */
1100
- function (t) {
1087
+ function () {
1101
1088
  /** @type {?} */
1102
- var currentHeight = t.y + t.rows;
1103
- if (currentHeight > areaScrollHeight) {
1104
- areaScrollHeight = currentHeight;
1089
+ var isMobile = false;
1090
+ if (_this.options.mobileBreakpoint > _this.gridWrapper.nativeElement.clientWidth) {
1091
+ isMobile = true;
1105
1092
  }
1106
- if (curRowHeight == 0) {
1107
- currentHeight = _this.widgetList[0].curRowHeight;
1093
+ /** @type {?} */
1094
+ var areaScrollHeight = 0;
1095
+ /** @type {?} */
1096
+ var areaHeight = 0;
1097
+ /** @type {?} */
1098
+ var curRowHeight = 0;
1099
+ if (_this.options.api) {
1100
+ curRowHeight = _this.options.api.getCurrentRowHeight();
1108
1101
  }
1109
- t.widgetInfo.rowHeight = curRowHeight;
1102
+ _this.widgetList.forEach((/**
1103
+ * @param {?} t
1104
+ * @return {?}
1105
+ */
1106
+ function (t) {
1107
+ /** @type {?} */
1108
+ var currentHeight = t.y + t.rows;
1109
+ if (currentHeight > areaScrollHeight) {
1110
+ areaScrollHeight = currentHeight;
1111
+ }
1112
+ if (curRowHeight == 0) {
1113
+ currentHeight = _this.widgetList[0].curRowHeight;
1114
+ }
1115
+ t.widgetInfo.rowHeight = curRowHeight;
1116
+ }));
1117
+ _this.gridcellHeight = curRowHeight;
1118
+ if (_this.options.api) {
1119
+ areaHeight = areaScrollHeight * _this.options.api.getCurrentRowHeight() + 100;
1120
+ }
1121
+ /** @type {?} */
1122
+ var areaScrollHeightMob = 0;
1123
+ if (isMobile) {
1124
+ areaScrollHeightMob = _this.widgetList.length * 300 + 200;
1125
+ areaHeight = areaScrollHeightMob;
1126
+ }
1127
+ if (areaHeight < 600) {
1128
+ areaHeight = 600;
1129
+ }
1130
+ _this.gridheight = areaHeight;
1110
1131
  }));
1111
- this.gridcellHeight = curRowHeight;
1112
- if (this.options.api) {
1113
- areaHeight = areaScrollHeight * this.options.api.getCurrentRowHeight() + 100;
1114
- }
1115
- /** @type {?} */
1116
- var areaScrollHeightMob = 0;
1117
- if (isMobile) {
1118
- areaScrollHeightMob = this.widgetList.length * 300 + 200;
1119
- areaHeight = areaScrollHeightMob;
1120
- }
1121
- if (areaHeight < 600) {
1122
- areaHeight = 600;
1123
- }
1124
- this.gridheight = areaHeight;
1125
1132
  };
1126
1133
  /** To remove a widget instance from dashboard and to save info in database */
1127
1134
  /**
@@ -1374,11 +1381,20 @@ var RADashboardArea = /** @class */ (function () {
1374
1381
  }));
1375
1382
  return widgetListArray;
1376
1383
  };
1384
+ /**
1385
+ * @return {?}
1386
+ */
1387
+ RADashboardArea.prototype.addNewWidget = /**
1388
+ * @return {?}
1389
+ */
1390
+ function () {
1391
+ this.raDashboardEventBus.publish(RAEvent.AddNewWidgetToDashboard, null);
1392
+ };
1377
1393
  RADashboardArea.decorators = [
1378
1394
  { type: Component, args: [{
1379
1395
  selector: 'ra-dashboard-area',
1380
- template: "<div #gridWrapper class=\"wrap gridster gridster-mobile\" [style.height.px]=\"gridheight\">\r\n <!-- <div #gridWrapper class=\"wrap gridster\"> -->\r\n <gridster [options]=\"options\" style=\"height:100%;\">\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 </ra-widget-container>\r\n </gridster-item>\r\n </gridster>\r\n <notifier-container></notifier-container>\r\n</div>\r\n",
1381
- 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;-ms-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}}"]
1396
+ template: "<div #gridWrapper class=\"wrap gridster gridster-mobile\" [style.height.px]=\"widgetList.length > 0 ? gridheight : ''\">\r\n <!-- <div #gridWrapper class=\"wrap gridster\"> -->\r\n <gridster [options]=\"options\" style=\"height:100%;\" *ngIf=\"widgetList.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 </ra-widget-container>\r\n </gridster-item>\r\n </gridster>\r\n\r\n <div class=\"empty-padding kiosk-hide\" *ngIf=\"widgetList.length <= 0\">\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\" style=\"color:#32AD3C; font-size: 24px; margin-right: 15px;\"></i>\r\n <span style=\"margin-top: 10px;\">Empty Dashboard</span>\r\n </div>\r\n <div class=\"empty-content\">\r\n <div>\r\n <div class=\"col-sm-12 empty-msg\">\r\n This dashboard doesn\u2019t contain any widgets. <br />\r\n Widgets can be added via the Dashboard Menu in the upper left.\r\n </div>\r\n <button class=\"btn btnLib btn-sm m-1 dashboard-button\" (click)=\"addNewWidget()\">\r\n <i class=\"fal fa-plus m-1\"></i>Add a Widgets</button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <notifier-container></notifier-container>\r\n</div>",
1397
+ 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;-ms-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}}.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}.btn-group-sm>.btn,.btn-sm{padding:5px 20px 5px 5px}@media screen and (max-width:500px){.empty-padding{padding:20px;background-color:#ededed;width:480px;display:block}.empty-prefix{color:#32ad3c;font-size:18px;display:flex;height:39px;padding:6px 120px 10px 33px}.empty-content{color:#333;border-top:1px solid #a9afb1;display:flex;padding:10px 30px;margin-top:44px;margin-left:-366px;border-left:none}.empty-msg{padding:4px 4px 10px;font-size:16px}}"]
1382
1398
  }] }
1383
1399
  ];
1384
1400
  /** @nocollapse */