@schneideress/dashboardframework 0.0.191 → 0.0.193

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.
@@ -934,6 +934,7 @@
934
934
  this.widgetList = Array();
935
935
  this.gridheight = 300;
936
936
  this.gridcellHeight = 0;
937
+ this.userWidgets = [];
937
938
  this.isWidgetLoaded = false;
938
939
  this.domResized = false;
939
940
  this.widgetHeight = 2;
@@ -1287,49 +1288,54 @@
1287
1288
  */
1288
1289
  function () {
1289
1290
  var _this = this;
1290
- /** @type {?} */
1291
- var isMobile = false;
1292
- if (this.options.mobileBreakpoint > this.gridWrapper.nativeElement.clientWidth) {
1293
- isMobile = true;
1294
- }
1295
- /** @type {?} */
1296
- var areaScrollHeight = 0;
1297
- /** @type {?} */
1298
- var areaHeight = 0;
1299
- /** @type {?} */
1300
- var curRowHeight = 0;
1301
- if (this.options.api) {
1302
- curRowHeight = this.options.api.getCurrentRowHeight();
1303
- }
1304
- this.widgetList.forEach((/**
1305
- * @param {?} t
1291
+ setTimeout((/**
1306
1292
  * @return {?}
1307
1293
  */
1308
- function (t) {
1294
+ function () {
1295
+ /** @type {?} */
1296
+ var isMobile = false;
1297
+ if (_this.options.mobileBreakpoint > _this.gridWrapper.nativeElement.clientWidth) {
1298
+ isMobile = true;
1299
+ }
1300
+ /** @type {?} */
1301
+ var areaScrollHeight = 0;
1302
+ /** @type {?} */
1303
+ var areaHeight = 0;
1304
+ /** @type {?} */
1305
+ var curRowHeight = 0;
1306
+ if (_this.options.api) {
1307
+ curRowHeight = _this.options.api.getCurrentRowHeight();
1308
+ }
1309
+ _this.widgetList.forEach((/**
1310
+ * @param {?} t
1311
+ * @return {?}
1312
+ */
1313
+ function (t) {
1314
+ /** @type {?} */
1315
+ var currentHeight = t.y + t.rows;
1316
+ if (currentHeight > areaScrollHeight) {
1317
+ areaScrollHeight = currentHeight;
1318
+ }
1319
+ if (curRowHeight == 0) {
1320
+ currentHeight = _this.widgetList[0].curRowHeight;
1321
+ }
1322
+ t.widgetInfo.rowHeight = curRowHeight;
1323
+ }));
1324
+ _this.gridcellHeight = curRowHeight;
1325
+ if (_this.options.api) {
1326
+ areaHeight = areaScrollHeight * _this.options.api.getCurrentRowHeight() + 100;
1327
+ }
1309
1328
  /** @type {?} */
1310
- var currentHeight = t.y + t.rows;
1311
- if (currentHeight > areaScrollHeight) {
1312
- areaScrollHeight = currentHeight;
1329
+ var areaScrollHeightMob = 0;
1330
+ if (isMobile) {
1331
+ areaScrollHeightMob = _this.widgetList.length * 300 + 200;
1332
+ areaHeight = areaScrollHeightMob;
1313
1333
  }
1314
- if (curRowHeight == 0) {
1315
- currentHeight = _this.widgetList[0].curRowHeight;
1334
+ if (areaHeight < 600) {
1335
+ areaHeight = 600;
1316
1336
  }
1317
- t.widgetInfo.rowHeight = curRowHeight;
1337
+ _this.gridheight = areaHeight;
1318
1338
  }));
1319
- this.gridcellHeight = curRowHeight;
1320
- if (this.options.api) {
1321
- areaHeight = areaScrollHeight * this.options.api.getCurrentRowHeight() + 100;
1322
- }
1323
- /** @type {?} */
1324
- var areaScrollHeightMob = 0;
1325
- if (isMobile) {
1326
- areaScrollHeightMob = this.widgetList.length * 300 + 200;
1327
- areaHeight = areaScrollHeightMob;
1328
- }
1329
- if (areaHeight < 600) {
1330
- areaHeight = 600;
1331
- }
1332
- this.gridheight = areaHeight;
1333
1339
  };
1334
1340
  /** To remove a widget instance from dashboard and to save info in database */
1335
1341
  /**
@@ -1594,7 +1600,7 @@
1594
1600
  RADashboardArea.decorators = [
1595
1601
  { type: core.Component, args: [{
1596
1602
  selector: 'ra-dashboard-area',
1597
- 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>",
1603
+ template: "<div #gridWrapper class=\"wrap gridster gridster-mobile\" [style.height.px]=\"userWidgets.length > 0 ? gridheight : ''\">\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 [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=\"userWidgets.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>",
1598
1604
  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}}"]
1599
1605
  }] }
1600
1606
  ];
@@ -1628,10 +1634,7 @@
1628
1634
  RADashboardArea.prototype.gridheight;
1629
1635
  /** @type {?} */
1630
1636
  RADashboardArea.prototype.gridcellHeight;
1631
- /**
1632
- * @type {?}
1633
- * @private
1634
- */
1637
+ /** @type {?} */
1635
1638
  RADashboardArea.prototype.userWidgets;
1636
1639
  /**
1637
1640
  * @type {?}