@schneideress/dashboardframework 0.0.13 → 0.0.15

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.
@@ -364,6 +364,8 @@ var RAEvent = {
364
364
  WidgetDelete: "WidgetDelete",
365
365
  /** used to add widget to widgetlist when user copies a widget to current dashboard */
366
366
  AddWidget: "AddWidget",
367
+ /** done button click on widget library flyout */
368
+ widgetLibraryDoneClick: "widgetLibraryDoneClick",
367
369
  };
368
370
  /** @enum {string} */
369
371
  var RAEventKey = {
@@ -497,9 +499,10 @@ var RADashboardArea = /** @class */ (function () {
497
499
  * @return {?}
498
500
  */
499
501
  function (changes) {
500
- if (this.raDashboardEventBus && this.userDashboardId && this.areaKey) {
501
- this.initiateGridsterConfig();
502
+ if (this.globalFilter && this.raDashboardEventBus && this.appConfig) {
502
503
  this.loadWidgets(this.userDashboardId, this.areaKey);
504
+ }
505
+ if (changes.raDashboardEventBus.currentValue != changes.raDashboardEventBus.previousValue) {
503
506
  this.inititateEventBusSubscritions();
504
507
  }
505
508
  };
@@ -573,6 +576,27 @@ var RADashboardArea = /** @class */ (function () {
573
576
  _this.addWidget(e);
574
577
  }));
575
578
  }));
579
+ this.widgetLibraryDoneClick = this.raDashboardEventBus.subscribe(RAEvent.widgetLibraryDoneClick).subscribe((/**
580
+ * @param {?} widgetList
581
+ * @return {?}
582
+ */
583
+ function (widgetList) {
584
+ _this.ngZone.run((/**
585
+ * @return {?}
586
+ */
587
+ function () {
588
+ console.log(widgetList);
589
+ if (widgetList) {
590
+ widgetList.forEach((/**
591
+ * @param {?} widgetInfo
592
+ * @return {?}
593
+ */
594
+ function (widgetInfo) {
595
+ _this.addWidget(widgetInfo);
596
+ }));
597
+ }
598
+ }));
599
+ }));
576
600
  };
577
601
  /**
578
602
  * @return {?}
@@ -584,6 +608,7 @@ var RADashboardArea = /** @class */ (function () {
584
608
  this.conifgAddClick.unsubscribe();
585
609
  this.widgetAddEvent.unsubscribe();
586
610
  this.widgetDeleteEvent.unsubscribe();
611
+ this.widgetLibraryDoneClick.unsubscribe();
587
612
  };
588
613
  /**To update position/dimention of all widgets in the area */
589
614
  /**
@@ -632,12 +657,7 @@ var RADashboardArea = /** @class */ (function () {
632
657
  function (widgets) {
633
658
  if (widgets && widgets.length > 0) {
634
659
  areaContext.widgetList = _this.mapObjectListToGridsterItemList(widgets);
635
- setTimeout((/**
636
- * @return {?}
637
- */
638
- function () {
639
- areaContext.setAreaHeight();
640
- }), 2000);
660
+ areaContext.setAreaHeight();
641
661
  }
642
662
  }));
643
663
  };
@@ -2563,12 +2583,6 @@ var GridsterComponent = /** @class */ (function () {
2563
2583
  if (this.options.destroyCallback) {
2564
2584
  this.options.destroyCallback(this);
2565
2585
  }
2566
- if (this.options.api) {
2567
- this.options.api.resize = undefined;
2568
- this.options.api.optionsChanged = undefined;
2569
- this.options.api.getNextPossiblePosition = undefined;
2570
- this.options.api = undefined;
2571
- }
2572
2586
  this.emptyCell.destroy();
2573
2587
  delete this.emptyCell;
2574
2588
  this.compact.destroy();