@schneideress/dashboardframework 0.0.151 → 0.0.153

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.
@@ -396,6 +396,8 @@ var RAEvent = {
396
396
  WidgetAdded: "WidgetAdded",
397
397
  /**To update global filter site from map widget selected site */
398
398
  UpdateGlobalFilterFromMapWidget: "UpdateGlobalFilterFromMapWidget",
399
+ /**To add widget on empty dashboard */
400
+ AddWidgetEmptyDashboard: "AddWidgetEmptyDashboard",
399
401
  };
400
402
  /** @enum {string} */
401
403
  var RAEventKey = {
@@ -792,6 +794,8 @@ var RADashboardResponsiveService = /** @class */ (function () {
792
794
  function (widget) {
793
795
  /** @type {?} */
794
796
  var gridsterItem = (/** @type {?} */ ({
797
+ actCols: widget.width,
798
+ actRows: widget.height,
795
799
  cols: this.getWidth(widget.width),
796
800
  rows: this.getHeight(widget.height),
797
801
  x: this.IsDesktopView ? widget.position_x : 0,
@@ -1303,18 +1307,29 @@ var RADashboardArea = /** @class */ (function () {
1303
1307
  function (widgetInstanceId, isalertDisabled) {
1304
1308
  if (isalertDisabled === void 0) { isalertDisabled = false; }
1305
1309
  /** @type {?} */
1306
- var widget = this.widgetList.filter((/**
1310
+ var gridsterItem = this.widgetList.filter((/**
1307
1311
  * @param {?} item
1308
1312
  * @return {?}
1309
1313
  */
1310
1314
  function (item) {
1311
1315
  return item.widgetInfo.widgetInstanceId === widgetInstanceId;
1312
1316
  }));
1313
- if (widget.length > 0) {
1314
- this.widgetList.splice(this.widgetList.indexOf(widget[0]), 1);
1317
+ if (gridsterItem.length > 0) {
1318
+ /** @type {?} */
1319
+ var widget = this.userWidgets.filter((/**
1320
+ * @param {?} item
1321
+ * @return {?}
1322
+ */
1323
+ function (item) {
1324
+ return item.widgetInstanceId === widgetInstanceId;
1325
+ }));
1326
+ if (widget.length > 0) {
1327
+ this.userWidgets.splice(this.userWidgets.indexOf(widget[0]), 1);
1328
+ }
1329
+ this.widgetList.splice(this.widgetList.indexOf(gridsterItem[0]), 1);
1315
1330
  this.setAreaHeight();
1316
1331
  if (!isalertDisabled) {
1317
- this.notifier.notify('success', " " + this.translateService.translate('Common.Widgettext') + " " + widget[0].widgetInfo.widgetTitle + " " + this.translateService.translate('Common.deletedSuccesfully') + " ");
1332
+ this.notifier.notify('success', " " + this.translateService.translate('Common.Widgettext') + " " + gridsterItem[0].widgetInfo.widgetTitle + " " + this.translateService.translate('Common.deletedSuccesfully') + " ");
1318
1333
  }
1319
1334
  }
1320
1335
  };
@@ -1362,6 +1377,7 @@ var RADashboardArea = /** @class */ (function () {
1362
1377
  * @return {?}
1363
1378
  */
1364
1379
  function (widget) {
1380
+ _this.userWidgets.push(widget);
1365
1381
  /** @type {?} */
1366
1382
  var gridsterItem = _this.responsiveService.getGridsterItem(widget);
1367
1383
  _this.widgetList.push(gridsterItem);
@@ -1438,6 +1454,7 @@ var RADashboardArea = /** @class */ (function () {
1438
1454
  function (widgets) {
1439
1455
  }));
1440
1456
  }
1457
+ this.userWidgets.push(data);
1441
1458
  /** @type {?} */
1442
1459
  var gridsterItem = this.responsiveService.getGridsterItem(data);
1443
1460
  this.widgetList.push(gridsterItem);