@schneideress/dashboardframework 0.0.234 → 0.0.236

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.
@@ -1499,16 +1499,18 @@ class RAWidgetContainer {
1499
1499
  */
1500
1500
  invokeWidgetResizedEvent() {
1501
1501
  if (this.widgetElement) {
1502
- /** @type {?} */
1503
- let size = {};
1504
- size.height = this.height;
1505
- size.width = this.width;
1506
- size.cellHeight = this.gridCellHeight;
1507
- this.widgetElement.widgetResized(size);
1508
- if (this.height == 1 || this.width == 1)
1509
- this.isKpiView = true;
1510
- else
1511
- this.isKpiView = false;
1502
+ if (typeof this.widgetElement.widgetResized === "function") {
1503
+ /** @type {?} */
1504
+ let size = {};
1505
+ size.height = this.height;
1506
+ size.width = this.width;
1507
+ size.cellHeight = this.gridCellHeight;
1508
+ this.widgetElement.widgetResized(size);
1509
+ if (this.height == 1 || this.width == 1)
1510
+ this.isKpiView = true;
1511
+ else
1512
+ this.isKpiView = false;
1513
+ }
1512
1514
  }
1513
1515
  }
1514
1516
  /**
@@ -1576,6 +1578,9 @@ class RAWidgetContainer {
1576
1578
  ngOnDestroy() {
1577
1579
  if (this.configChanged)
1578
1580
  this.configChanged.unsubscribe();
1581
+ if (this.widgetElementHandler && this.data && this.data.widgetInfo && this.data.widgetInfo.widgetInstanceId) {
1582
+ document.body.removeEventListener('widgetinitiated' + this.data.widgetInfo.widgetInstanceId, this.widgetElementHandler);
1583
+ }
1579
1584
  }
1580
1585
  /**
1581
1586
  * To Edit current widget configuration
@@ -1740,15 +1745,18 @@ class RAWidgetContainer {
1740
1745
  () => {
1741
1746
  me.widgetElement = document.createElement(widgetInfo.customTag);
1742
1747
  me.widgetElement.setAttribute("widget-instance-id", widgetInfo.widgetInstanceId);
1743
- document.body.addEventListener('widgetinitiated' + widgetInfo.widgetInstanceId, (/**
1748
+ /** @type {?} */
1749
+ let handler = (/**
1750
+ * @param {?} event
1744
1751
  * @return {?}
1745
1752
  */
1746
- () => __awaiter(this, void 0, void 0, function* () {
1753
+ function (event) {
1747
1754
  setTimeout((/**
1748
1755
  * @return {?}
1749
1756
  */
1750
1757
  () => __awaiter(this, void 0, void 0, function* () {
1751
- me.widgetElement.addEventListener('on-widget-respond', (/**
1758
+ console.log('widget inititated listener triggered');
1759
+ this.widgetElement.addEventListener('on-widget-respond', (/**
1752
1760
  * @param {?} e
1753
1761
  * @return {?}
1754
1762
  */
@@ -1758,15 +1766,15 @@ class RAWidgetContainer {
1758
1766
  switch (type) {
1759
1767
  case 'onDataLoad':
1760
1768
  if (e.detail.data)
1761
- me.showPanel = true;
1769
+ this.showPanel = true;
1762
1770
  else
1763
- me.showPanel = false;
1771
+ this.showPanel = false;
1764
1772
  break;
1765
1773
  case 'onConfigEditClicked':
1766
- me.editWidget();
1774
+ this.editWidget();
1767
1775
  break;
1768
1776
  case 'onEnableDefaultState':
1769
- me.setEmptyState(e.detail.data);
1777
+ this.setEmptyState(e.detail.data);
1770
1778
  break;
1771
1779
  case 'onSetTitleUnderline':
1772
1780
  if (e.detail.data == true)
@@ -1790,9 +1798,9 @@ class RAWidgetContainer {
1790
1798
  break;
1791
1799
  }
1792
1800
  }));
1793
- if (typeof (me.widgetElement.titleLineEnabled) != 'undefined') {
1801
+ if (typeof (this.widgetElement.titleLineEnabled) != 'undefined') {
1794
1802
  /** @type {?} */
1795
- let titleLineEnabled = me.widgetElement.titleLineEnabled();
1803
+ let titleLineEnabled = this.widgetElement.titleLineEnabled();
1796
1804
  if (titleLineEnabled) {
1797
1805
  this.enableTitleLine = titleLineEnabled;
1798
1806
  this.enableTitleLineActual = titleLineEnabled;
@@ -1828,17 +1836,19 @@ class RAWidgetContainer {
1828
1836
  this.deleteToolTipValue = this.translateService.translate('Common.delete');
1829
1837
  this.deleteToolTipWidth = "300px";
1830
1838
  }
1831
- me.isWidgetLoaded = true;
1839
+ this.isWidgetLoaded = true;
1832
1840
  widgetConfigFilter.appConfig = this.appConfig;
1833
1841
  widgetConfigFilter.widgetInfo = widgetInfo;
1834
1842
  widgetConfigFilter.configChanges = this.getConfigChanges(false);
1835
1843
  widgetConfigFilter.widgetInfo.widgetName = widgetInfo.widgetName;
1836
1844
  widgetConfigFilter.globalFilter = this.globalFilter;
1837
- me.widgetElement.loadContent(widgetConfigFilter);
1838
- yield me.setLock(widgetConfigFilter.config);
1839
- yield me.setDownloadIcon();
1845
+ this.widgetElement.loadContent(widgetConfigFilter);
1846
+ yield this.setLock(widgetConfigFilter.config);
1847
+ yield this.setDownloadIcon();
1840
1848
  })));
1841
- })));
1849
+ }).bind(this);
1850
+ this.widgetElementHandler = handler;
1851
+ document.body.addEventListener('widgetinitiated' + widgetInfo.widgetInstanceId, handler);
1842
1852
  this.ctlWidget.nativeElement.appendChild(this.widgetElement);
1843
1853
  }));
1844
1854
  }));
@@ -2275,7 +2285,7 @@ class RAWidgetContainer {
2275
2285
  RAWidgetContainer.decorators = [
2276
2286
  { type: Component, args: [{
2277
2287
  selector: 'ra-widget-container',
2278
- template: "<div #wcWrapper class=\"wc-wrapper\" (mouseenter)=\"mouseHover(true)\" (mouseleave)=\"mouseHover(false)\"\r\n [ngStyle]=\"{'margin-left': noPadding?'0px':'15px','margin-right': noPadding?'0px':'15px'}\">\r\n <div class=\"wcheader widget-move\" *ngIf=\"!hideTitle\"\r\n [ngClass]=\"{'underLine': enableTitleLine || isWidgetStateApplicable}\">\r\n <div class=\"col-md-12 wc-mover\" style=\"padding-left: 0px;height:inherit;padding-right: 0px;\">\r\n <div style=\"display:flex;margin-top:10px;\"\r\n [ngStyle]=\"{'margin-left': noPadding?'15px':'0px','margin-right': noPadding?'15px':'0px'}\">\r\n <div class=\"col-9 float-left title-label\">\r\n <ra-tooltip [value]=\"toolTipValue\" [width]=\"toolTipWidth\">\r\n <div [hidden]=\"hideTitle\" style=\"text-overflow: ellipsis;white-space: nowrap;overflow: hidden;\"\r\n (mouseover)=\"mouseOver($event)\" #searchInput>{{WidgetDisplayName}}</div>\r\n </ra-tooltip>\r\n </div>\r\n <div class=\"col-3\" style=\"cursor:default;padding-right: 0px;\"> \r\n <div class=\"float-right\" style=\"display: flex;\">\r\n <div class=\"title-bar-lock-icon lock-dropdown\" [hidden]=\"!inapplicableFilters || inapplicableFilters.length == 0\">\r\n <i class=\"fal fa-ban lock\"></i>\r\n <div class=\"lock-dropdown-content light widget-config-item\">\r\n <div *ngIf=\"inapplicableFilters\">\r\n <label style=\"color: #D9F0FA;\">\r\n {{'Common.InapplicableFilters'|translate}}:\r\n </label>\r\n <div style=\"color: white;\">\r\n <label class=\"bold\" style=\"margin-bottom: 0px;width: 100%;\" *ngFor=\"let item of inapplicableFilters\">\r\n {{item}}\r\n </label>\r\n </div>\r\n <hr>\r\n <div style=\"color: #D9F0FA;\">\r\n <label>{{'Common.InapplicableFiltersDesc'|translate}}</label>\r\n </div>\r\n </div> \r\n </div>\r\n </div>\r\n <div class=\"title-bar-lock-icon lock-dropdown\" [hidden]=\"!lockDetails && !lockTemplateInfo\">\r\n <i class=\"fal fa-lock lock\"></i>\r\n <div class=\"lock-dropdown-content light widget-config-item\">\r\n <div *ngIf=\"lockDetails && !lockTemplateInfo\">\r\n <label style=\"color: #D9F0FA;\">\r\n {{'Common.lockedfields'|translate}}\r\n </label>\r\n <div style=\"color: white;\">\r\n <label class=\"bold\" style=\"margin-bottom: 0px;width: 100%;\" *ngFor=\"let item of lockDetails\">\r\n {{item}}\r\n </label>\r\n </div>\r\n <hr>\r\n <div style=\"color: #D9F0FA;\">\r\n <label>{{'Common.lockedfieldseditinfo'|translate}}</label>\r\n </div>\r\n </div>\r\n <div *ngIf=\"!lockDetails && lockTemplateInfo\">\r\n <ng-container *ngTemplateOutlet=\"lockTemplateInfo\">\r\n </ng-container>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"widget-menu\" style=\"width:10px;\"\r\n [ngClass]=\"{'widget-menu-show': isMouseHover && showSettingsLink}\">\r\n <div class=\"dropbtn title-bar-icon\">\r\n <i (click)=\"showDropDown($event)\" #widgetDropdown class=\"fal fa-ellipsis-v widget-menu-ellipse\"></i>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div *ngIf=\"hideTitle\" class=\"wcheader widget-move\"\r\n style=\"height: 45px;width: 95%;cursor: move;z-index: 99;opacity: 0;\">\r\n </div>\r\n <div *ngIf=\"hideTitle\" class=\"widget-menu widget-menu-title-hidden\" [ngClass]=\"{'widget-menu-show': isMouseHover && showSettingsLink}\">\r\n <div class=\"dropbtn title-bar-icon\">\r\n <i (click)=\"showDropDown($event)\" class=\"fal fa-ellipsis-v\" style=\"text-align: center;\"></i>\r\n </div>\r\n </div>\r\n <div class=\"wcBody\" [ngStyle]=\"{'bottom': noPadding?'0px':'10px','top':hideTitle?'10px':'46px'}\">\r\n <div [hidden]=\"isWidgetStateApplicable\" class=\"m-fadeOut widget-overlay\" [ngClass]=\"{'m-fadeIn': showPanel}\">\r\n <div class=\"lds-roller\">\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n </div>\r\n </div>\r\n <div class=\"wc\" [hidden]=\"isWidgetStateApplicable\">\r\n <div #ctlWidget></div>\r\n </div>\r\n <div *ngIf=\"isWidgetStateApplicable\" class=\"defaultConfig\">\r\n <ra-widget-state style=\"width: 100%;height: 100%;\" [isWidgetStateApplicable]=\"isWidgetStateApplicable\"\r\n [isGlobalFilterApplied]=\"isGlobalFilterApplied\" [widgetEmptyState]=\"widgetEmptyState\"\r\n (editWidgetClicked)=editWidget() [widthCol]=\"width\" [heightCol]=\"height\">\r\n </ra-widget-state>\r\n </div>\r\n <div>\r\n </div>\r\n </div>\r\n</div>"
2288
+ template: "<div #wcWrapper class=\"wc-wrapper\" (mouseenter)=\"mouseHover(true)\" (mouseleave)=\"mouseHover(false)\"\r\n [ngStyle]=\"{'margin-left': noPadding?'0px':'15px','margin-right': noPadding?'0px':'15px'}\">\r\n <div class=\"wcheader widget-move\" *ngIf=\"!hideTitle\"\r\n [ngClass]=\"{'underLine': enableTitleLine || isWidgetStateApplicable}\">\r\n <div class=\"col-md-12 wc-mover\" style=\"padding-left: 0px;height:inherit;padding-right: 0px;\">\r\n <div style=\"display:flex;margin-top:10px;\"\r\n [ngStyle]=\"{'margin-left': noPadding?'15px':'0px','margin-right': noPadding?'15px':'0px'}\">\r\n <div class=\"col-9 float-left title-label\">\r\n <ra-tooltip [value]=\"toolTipValue\" [width]=\"toolTipWidth\">\r\n <div [hidden]=\"hideTitle\" style=\"text-overflow: ellipsis;white-space: nowrap;overflow: hidden;\"\r\n (mouseover)=\"mouseOver($event)\" #searchInput>{{WidgetDisplayName}}</div>\r\n </ra-tooltip>\r\n </div>\r\n <div class=\"col-3\" style=\"cursor:default;padding-right: 0px;\"> \r\n <div class=\"float-right\" style=\"display: flex;\">\r\n <div class=\"title-bar-lock-icon lock-dropdown\" [hidden]=\"!inapplicableFilters || inapplicableFilters.length == 0 || !globalFilter || globalFilter == '{}'\">\r\n <i class=\"fal fa-ban lock\"></i>\r\n <div class=\"lock-dropdown-content light widget-config-item\">\r\n <div *ngIf=\"inapplicableFilters && globalFilter && globalFilter !='{}'\">\r\n <label style=\"color: #D9F0FA;\">\r\n {{'Common.InapplicableFilters'|translate}}:\r\n </label>\r\n <div style=\"color: white;\">\r\n <label class=\"bold\" style=\"margin-bottom: 0px;width: 100%;\" *ngFor=\"let item of inapplicableFilters\">\r\n {{item}}\r\n </label>\r\n </div>\r\n <hr>\r\n <div style=\"color: #D9F0FA;\">\r\n <label>{{'Common.InapplicableFiltersDesc'|translate}}</label>\r\n </div>\r\n </div> \r\n </div>\r\n </div>\r\n <div class=\"title-bar-lock-icon lock-dropdown\" [hidden]=\"!lockDetails && !lockTemplateInfo\">\r\n <i class=\"fal fa-lock lock\"></i>\r\n <div class=\"lock-dropdown-content light widget-config-item\">\r\n <div *ngIf=\"lockDetails && !lockTemplateInfo\">\r\n <label style=\"color: #D9F0FA;\">\r\n {{'Common.lockedfields'|translate}}\r\n </label>\r\n <div style=\"color: white;\">\r\n <label class=\"bold\" style=\"margin-bottom: 0px;width: 100%;\" *ngFor=\"let item of lockDetails\">\r\n {{item}}\r\n </label>\r\n </div>\r\n <hr>\r\n <div style=\"color: #D9F0FA;\">\r\n <label>{{'Common.lockedfieldseditinfo'|translate}}</label>\r\n </div>\r\n </div>\r\n <div *ngIf=\"!lockDetails && lockTemplateInfo\">\r\n <ng-container *ngTemplateOutlet=\"lockTemplateInfo\">\r\n </ng-container>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"widget-menu\" style=\"width:10px;\"\r\n [ngClass]=\"{'widget-menu-show': isMouseHover && showSettingsLink}\">\r\n <div class=\"dropbtn title-bar-icon\">\r\n <i (click)=\"showDropDown($event)\" #widgetDropdown class=\"fal fa-ellipsis-v widget-menu-ellipse\"></i>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div *ngIf=\"hideTitle\" class=\"wcheader widget-move\"\r\n style=\"height: 45px;width: 95%;cursor: move;z-index: 99;opacity: 0;\">\r\n </div>\r\n <div *ngIf=\"hideTitle\" class=\"widget-menu widget-menu-title-hidden\" [ngClass]=\"{'widget-menu-show': isMouseHover && showSettingsLink}\">\r\n <div class=\"dropbtn title-bar-icon\">\r\n <i (click)=\"showDropDown($event)\" class=\"fal fa-ellipsis-v\" style=\"text-align: center;\"></i>\r\n </div>\r\n </div>\r\n <div class=\"wcBody\" [ngStyle]=\"{'bottom': noPadding?'0px':'10px','top':hideTitle?'10px':'46px'}\">\r\n <div [hidden]=\"isWidgetStateApplicable\" class=\"m-fadeOut widget-overlay\" [ngClass]=\"{'m-fadeIn': showPanel}\">\r\n <div class=\"lds-roller\">\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n </div>\r\n </div>\r\n <div class=\"wc\" [hidden]=\"isWidgetStateApplicable\">\r\n <div #ctlWidget></div>\r\n </div>\r\n <div *ngIf=\"isWidgetStateApplicable\" class=\"defaultConfig\">\r\n <ra-widget-state style=\"width: 100%;height: 100%;\" [isWidgetStateApplicable]=\"isWidgetStateApplicable\"\r\n [isGlobalFilterApplied]=\"isGlobalFilterApplied\" [widgetEmptyState]=\"widgetEmptyState\"\r\n (editWidgetClicked)=editWidget() [widthCol]=\"width\" [heightCol]=\"height\">\r\n </ra-widget-state>\r\n </div>\r\n <div>\r\n </div>\r\n </div>\r\n</div>"
2279
2289
  }] }
2280
2290
  ];
2281
2291
  /** @nocollapse */
@@ -2445,6 +2455,8 @@ if (false) {
2445
2455
  RAWidgetContainer.prototype.WidgetDisplayName;
2446
2456
  /** @type {?} */
2447
2457
  RAWidgetContainer.prototype.enableTitleLineActual;
2458
+ /** @type {?} */
2459
+ RAWidgetContainer.prototype.widgetElementHandler;
2448
2460
  /**
2449
2461
  * @type {?}
2450
2462
  * @private