@schneideress/dashboardframework 0.0.233 → 0.0.235

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.
@@ -983,22 +983,14 @@
983
983
  var _this = this;
984
984
  this.isWidgetMgmnt = this.permissionService.hasPermission('ra.widgetmanagement');
985
985
  this.initiateGridsterConfig();
986
+ this.lastViewType = this.responsiveService.IsDesktopView ? 'desktop' : 'mobile';
986
987
  this.responsiveService.resized.subscribe((/**
987
988
  * @param {?} isDesktop
988
989
  * @return {?}
989
990
  */
990
991
  function (isDesktop) {
991
- if (isDesktop) {
992
- setTimeout((/**
993
- * @return {?}
994
- */
995
- function () {
996
- _this.gridcellHeight = _this.options.api.getCurrentRowHeight();
997
- _this.domResized = !_this.domResized;
998
- _this.setAreaHeight();
999
- }), 100);
1000
- }
1001
- else {
992
+ if (_this.lastViewType != (isDesktop ? 'desktop' : 'mobile') || !isDesktop) {
993
+ _this.lastViewType = (isDesktop ? 'desktop' : 'mobile');
1002
994
  _this.widgetList = [];
1003
995
  setTimeout((/**
1004
996
  * @return {?}
@@ -1021,6 +1013,16 @@
1021
1013
  _this.domResized = !_this.domResized;
1022
1014
  }));
1023
1015
  }
1016
+ else {
1017
+ setTimeout((/**
1018
+ * @return {?}
1019
+ */
1020
+ function () {
1021
+ _this.gridcellHeight = _this.options.api.getCurrentRowHeight();
1022
+ _this.domResized = !_this.domResized;
1023
+ _this.setAreaHeight();
1024
+ }), 100);
1025
+ }
1024
1026
  }));
1025
1027
  };
1026
1028
  /**
@@ -1793,6 +1795,8 @@
1793
1795
  /** @type {?} */
1794
1796
  RADashboardArea.prototype.isWidgetMgmnt;
1795
1797
  /** @type {?} */
1798
+ RADashboardArea.prototype.lastViewType;
1799
+ /** @type {?} */
1796
1800
  RADashboardArea.prototype.userDashboardId;
1797
1801
  /** @type {?} */
1798
1802
  RADashboardArea.prototype.areaKey;
@@ -1994,16 +1998,18 @@
1994
1998
  */
1995
1999
  function () {
1996
2000
  if (this.widgetElement) {
1997
- /** @type {?} */
1998
- var size = {};
1999
- size.height = this.height;
2000
- size.width = this.width;
2001
- size.cellHeight = this.gridCellHeight;
2002
- this.widgetElement.widgetResized(size);
2003
- if (this.height == 1 || this.width == 1)
2004
- this.isKpiView = true;
2005
- else
2006
- this.isKpiView = false;
2001
+ if (typeof this.widgetElement.widgetResized === "function") {
2002
+ /** @type {?} */
2003
+ var size = {};
2004
+ size.height = this.height;
2005
+ size.width = this.width;
2006
+ size.cellHeight = this.gridCellHeight;
2007
+ this.widgetElement.widgetResized(size);
2008
+ if (this.height == 1 || this.width == 1)
2009
+ this.isKpiView = true;
2010
+ else
2011
+ this.isKpiView = false;
2012
+ }
2007
2013
  }
2008
2014
  };
2009
2015
  /**
@@ -2083,6 +2089,9 @@
2083
2089
  function () {
2084
2090
  if (this.configChanged)
2085
2091
  this.configChanged.unsubscribe();
2092
+ if (this.widgetElementHandler && this.data && this.data.widgetInfo && this.data.widgetInfo.widgetInstanceId) {
2093
+ document.body.removeEventListener('widgetinitiated' + this.data.widgetInfo.widgetInstanceId, this.widgetElementHandler);
2094
+ }
2086
2095
  };
2087
2096
  /** To Edit current widget configuration*/
2088
2097
  /**
@@ -2291,120 +2300,122 @@
2291
2300
  function () {
2292
2301
  me.widgetElement = document.createElement(widgetInfo.customTag);
2293
2302
  me.widgetElement.setAttribute("widget-instance-id", widgetInfo.widgetInstanceId);
2294
- document.body.addEventListener('widgetinitiated' + widgetInfo.widgetInstanceId, (/**
2303
+ /** @type {?} */
2304
+ var handler = (/**
2305
+ * @param {?} event
2295
2306
  * @return {?}
2296
2307
  */
2297
- function () { return __awaiter(_this, void 0, void 0, function () {
2308
+ function (event) {
2298
2309
  var _this = this;
2299
- return __generator(this, function (_a) {
2300
- setTimeout((/**
2301
- * @return {?}
2302
- */
2303
- function () { return __awaiter(_this, void 0, void 0, function () {
2304
- var titleLineEnabled;
2305
- var _this = this;
2306
- return __generator(this, function (_a) {
2307
- switch (_a.label) {
2308
- case 0:
2309
- me.widgetElement.addEventListener('on-widget-respond', (/**
2310
- * @param {?} e
2311
- * @return {?}
2312
- */
2313
- function (e) {
2314
- /** @type {?} */
2315
- var type = e.detail.type;
2316
- switch (type) {
2317
- case 'onDataLoad':
2318
- if (e.detail.data)
2319
- me.showPanel = true;
2320
- else
2321
- me.showPanel = false;
2322
- break;
2323
- case 'onConfigEditClicked':
2324
- me.editWidget();
2325
- break;
2326
- case 'onEnableDefaultState':
2327
- me.setEmptyState(e.detail.data);
2328
- break;
2329
- case 'onSetTitleUnderline':
2330
- if (e.detail.data == true)
2331
- _this.enableTitleLine = true;
2332
- else
2333
- _this.enableTitleLine = _this.enableTitleLineActual;
2334
- break;
2335
- case 'onWidgetTitleHidden':
2336
- if (e.detail.data == true)
2337
- _this.hideTitle = true;
2338
- else
2339
- _this.hideTitle = false;
2340
- break;
2341
- case 'onUpdateLockData':
2342
- _this.setLock(e.detail.data);
2343
- break;
2344
- case 'onGlobalFilterApplicableCheck':
2345
- _this.setInapplicableFilters(e.detail.data, widgetInfo.widgetInstanceId);
2346
- break;
2347
- default:
2348
- break;
2349
- }
2350
- }));
2351
- if (typeof (me.widgetElement.titleLineEnabled) != 'undefined') {
2352
- titleLineEnabled = me.widgetElement.titleLineEnabled();
2353
- if (titleLineEnabled) {
2354
- this.enableTitleLine = titleLineEnabled;
2355
- this.enableTitleLineActual = titleLineEnabled;
2356
- }
2357
- }
2358
- this.editText = this.translateService.translate('Common.edit');
2359
- if (this.translateService.translate('Common.edit').length > 6) {
2360
- this.editText = (this.translateService.translate('Common.edit').substring(0, 6) + '...');
2361
- this.editToolTipValue = this.translateService.translate('Common.edit');
2362
- this.editToolTipWidth = "300px";
2363
- }
2364
- this.copyText = this.translateService.translate('Common.copy');
2365
- if (this.translateService.translate('Common.copy').length > 6) {
2366
- this.copyText = (this.translateService.translate('Common.copy').substring(0, 6) + '...');
2367
- this.copyToolTipValue = this.translateService.translate('Common.copy');
2368
- this.copyToolTipWidth = "300px";
2310
+ setTimeout((/**
2311
+ * @return {?}
2312
+ */
2313
+ function () { return __awaiter(_this, void 0, void 0, function () {
2314
+ var titleLineEnabled;
2315
+ var _this = this;
2316
+ return __generator(this, function (_a) {
2317
+ switch (_a.label) {
2318
+ case 0:
2319
+ console.log('widget inititated listener triggered');
2320
+ this.widgetElement.addEventListener('on-widget-respond', (/**
2321
+ * @param {?} e
2322
+ * @return {?}
2323
+ */
2324
+ function (e) {
2325
+ /** @type {?} */
2326
+ var type = e.detail.type;
2327
+ switch (type) {
2328
+ case 'onDataLoad':
2329
+ if (e.detail.data)
2330
+ _this.showPanel = true;
2331
+ else
2332
+ _this.showPanel = false;
2333
+ break;
2334
+ case 'onConfigEditClicked':
2335
+ _this.editWidget();
2336
+ break;
2337
+ case 'onEnableDefaultState':
2338
+ _this.setEmptyState(e.detail.data);
2339
+ break;
2340
+ case 'onSetTitleUnderline':
2341
+ if (e.detail.data == true)
2342
+ _this.enableTitleLine = true;
2343
+ else
2344
+ _this.enableTitleLine = _this.enableTitleLineActual;
2345
+ break;
2346
+ case 'onWidgetTitleHidden':
2347
+ if (e.detail.data == true)
2348
+ _this.hideTitle = true;
2349
+ else
2350
+ _this.hideTitle = false;
2351
+ break;
2352
+ case 'onUpdateLockData':
2353
+ _this.setLock(e.detail.data);
2354
+ break;
2355
+ case 'onGlobalFilterApplicableCheck':
2356
+ _this.setInapplicableFilters(e.detail.data, widgetInfo.widgetInstanceId);
2357
+ break;
2358
+ default:
2359
+ break;
2369
2360
  }
2370
- this.moveText = this.translateService.translate('Common.move');
2371
- if (this.translateService.translate('Common.move').length > 6) {
2372
- this.moveText = (this.translateService.translate('Common.move').substring(0, 6) + '...');
2373
- this.moveToolTipValue = this.translateService.translate('Common.move');
2374
- this.moveToolTipWidth = "300px";
2361
+ }));
2362
+ if (typeof (this.widgetElement.titleLineEnabled) != 'undefined') {
2363
+ titleLineEnabled = this.widgetElement.titleLineEnabled();
2364
+ if (titleLineEnabled) {
2365
+ this.enableTitleLine = titleLineEnabled;
2366
+ this.enableTitleLineActual = titleLineEnabled;
2375
2367
  }
2376
- this.excelText = this.translateService.translate('Common.excel');
2377
- if (this.translateService.translate('Common.excel').length > 6) {
2378
- this.excelText = (this.translateService.translate('Common.excel').substring(0, 6) + '...');
2379
- this.excelToolTipValue = this.translateService.translate('Common.excel');
2380
- this.excelToolTipWidth = "300px";
2381
- }
2382
- this.deleteText = this.translateService.translate('Common.delete');
2383
- if (this.translateService.translate('Common.delete').length > 6) {
2384
- this.deleteText = (this.translateService.translate('Common.delete').substring(0, 6) + '...');
2385
- this.deleteToolTipValue = this.translateService.translate('Common.delete');
2386
- this.deleteToolTipWidth = "300px";
2387
- }
2388
- me.isWidgetLoaded = true;
2389
- widgetConfigFilter.appConfig = this.appConfig;
2390
- widgetConfigFilter.widgetInfo = widgetInfo;
2391
- widgetConfigFilter.configChanges = this.getConfigChanges(false);
2392
- widgetConfigFilter.widgetInfo.widgetName = widgetInfo.widgetName;
2393
- widgetConfigFilter.globalFilter = this.globalFilter;
2394
- me.widgetElement.loadContent(widgetConfigFilter);
2395
- return [4 /*yield*/, me.setLock(widgetConfigFilter.config)];
2396
- case 1:
2397
- _a.sent();
2398
- return [4 /*yield*/, me.setDownloadIcon()];
2399
- case 2:
2400
- _a.sent();
2401
- return [2 /*return*/];
2402
- }
2403
- });
2404
- }); }));
2405
- return [2 /*return*/];
2406
- });
2407
- }); }));
2368
+ }
2369
+ this.editText = this.translateService.translate('Common.edit');
2370
+ if (this.translateService.translate('Common.edit').length > 6) {
2371
+ this.editText = (this.translateService.translate('Common.edit').substring(0, 6) + '...');
2372
+ this.editToolTipValue = this.translateService.translate('Common.edit');
2373
+ this.editToolTipWidth = "300px";
2374
+ }
2375
+ this.copyText = this.translateService.translate('Common.copy');
2376
+ if (this.translateService.translate('Common.copy').length > 6) {
2377
+ this.copyText = (this.translateService.translate('Common.copy').substring(0, 6) + '...');
2378
+ this.copyToolTipValue = this.translateService.translate('Common.copy');
2379
+ this.copyToolTipWidth = "300px";
2380
+ }
2381
+ this.moveText = this.translateService.translate('Common.move');
2382
+ if (this.translateService.translate('Common.move').length > 6) {
2383
+ this.moveText = (this.translateService.translate('Common.move').substring(0, 6) + '...');
2384
+ this.moveToolTipValue = this.translateService.translate('Common.move');
2385
+ this.moveToolTipWidth = "300px";
2386
+ }
2387
+ this.excelText = this.translateService.translate('Common.excel');
2388
+ if (this.translateService.translate('Common.excel').length > 6) {
2389
+ this.excelText = (this.translateService.translate('Common.excel').substring(0, 6) + '...');
2390
+ this.excelToolTipValue = this.translateService.translate('Common.excel');
2391
+ this.excelToolTipWidth = "300px";
2392
+ }
2393
+ this.deleteText = this.translateService.translate('Common.delete');
2394
+ if (this.translateService.translate('Common.delete').length > 6) {
2395
+ this.deleteText = (this.translateService.translate('Common.delete').substring(0, 6) + '...');
2396
+ this.deleteToolTipValue = this.translateService.translate('Common.delete');
2397
+ this.deleteToolTipWidth = "300px";
2398
+ }
2399
+ this.isWidgetLoaded = true;
2400
+ widgetConfigFilter.appConfig = this.appConfig;
2401
+ widgetConfigFilter.widgetInfo = widgetInfo;
2402
+ widgetConfigFilter.configChanges = this.getConfigChanges(false);
2403
+ widgetConfigFilter.widgetInfo.widgetName = widgetInfo.widgetName;
2404
+ widgetConfigFilter.globalFilter = this.globalFilter;
2405
+ this.widgetElement.loadContent(widgetConfigFilter);
2406
+ return [4 /*yield*/, this.setLock(widgetConfigFilter.config)];
2407
+ case 1:
2408
+ _a.sent();
2409
+ return [4 /*yield*/, this.setDownloadIcon()];
2410
+ case 2:
2411
+ _a.sent();
2412
+ return [2 /*return*/];
2413
+ }
2414
+ });
2415
+ }); }));
2416
+ }).bind(_this);
2417
+ _this.widgetElementHandler = handler;
2418
+ document.body.addEventListener('widgetinitiated' + widgetInfo.widgetInstanceId, handler);
2408
2419
  _this.ctlWidget.nativeElement.appendChild(_this.widgetElement);
2409
2420
  }));
2410
2421
  }));
@@ -3127,6 +3138,8 @@
3127
3138
  RAWidgetContainer.prototype.WidgetDisplayName;
3128
3139
  /** @type {?} */
3129
3140
  RAWidgetContainer.prototype.enableTitleLineActual;
3141
+ /** @type {?} */
3142
+ RAWidgetContainer.prototype.widgetElementHandler;
3130
3143
  /**
3131
3144
  * @type {?}
3132
3145
  * @private