@schneideress/dashboardframework 0.0.30 → 0.0.32

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.
@@ -960,7 +960,7 @@
960
960
  RADashboardArea.decorators = [
961
961
  { type: core.Component, args: [{
962
962
  selector: 'ra-dashboard-area',
963
- template: "<div #gridWrapper class=\"wrap gridster\" [style.height.px]=\"gridheight\">\r\n<!-- <div #gridWrapper class=\"wrap gridster\"> -->\r\n <gridster [options]=\"options\" style=\"height:100%;\">\r\n <gridster-item [item]=\"item\" *ngFor=\"let item of widgetList\">\r\n <ra-widget-container [app-config]=\"appConfig\" [event-bus]=\"raDashboardEventBus\" (widgetDeleted)=\"deleteWidget($event)\" [data]=\"item\"\r\n [global-filter]=\"globalFilter\" [widget-instance-id]=\"item.widgetInstanceId\"></ra-widget-container>\r\n </gridster-item>\r\n </gridster>\r\n <notifier-container></notifier-container>\r\n</div>\r\n\r\n",
963
+ template: "<div #gridWrapper class=\"wrap gridster\" [style.height.px]=\"gridheight\">\r\n<!-- <div #gridWrapper class=\"wrap gridster\"> -->\r\n <gridster [options]=\"options\" style=\"height:100%;\">\r\n <gridster-item [item]=\"item\" *ngFor=\"let item of widgetList\">\r\n <ra-widget-container [app-config]=\"appConfig\" [event-bus]=\"raDashboardEventBus\" (widgetDeleted)=\"deleteWidget($event)\" [data]=\"item\"\r\n [global-filter]=\"globalFilter\" [widget-width]=\"item.cols\" [widget-instance-id]=\"item.widgetInstanceId\"></ra-widget-container>\r\n </gridster-item>\r\n </gridster>\r\n <notifier-container></notifier-container>\r\n</div>\r\n\r\n",
964
964
  styles: ["gridster{width:inherit;resize:height;display:flex}gridster-item{background:#fff!important}.dvheader{width:100%;height:35px;background:#000;color:#fff;padding:7px 3px 5px 6px;text-transform:uppercase}"]
965
965
  }] }
966
966
  ];
@@ -995,6 +995,7 @@
995
995
  this.translateService = translateService;
996
996
  this.ngZone = ngZone;
997
997
  this.notifier = notifier;
998
+ this.isWidgetLoaded = false;
998
999
  this.isIEOrEdge = /msie\s|trident\/|edge\//i.test(window.navigator.userAgent);
999
1000
  this.widgetDeleted = new core.EventEmitter();
1000
1001
  }
@@ -1025,6 +1026,11 @@
1025
1026
  if (this.widgetElement && changes.globalFilter && changes.globalFilter.currentValue != changes.globalFilter.previousValue) {
1026
1027
  this.refreshWidget(this.data.widgetInfo);
1027
1028
  }
1029
+ if (changes.widgetWidth && changes.widgetWidth.currentValue != changes.widgetWidth.previousValue) {
1030
+ this.data.widgetInfo.isDimensionUpdate = true;
1031
+ this.refreshWidget(this.data.widgetInfo);
1032
+ this.data.widgetInfo.isDimensionUpdate = false;
1033
+ }
1028
1034
  };
1029
1035
  /**
1030
1036
  * @return {?}
@@ -1160,7 +1166,7 @@
1160
1166
  * @return {?}
1161
1167
  */
1162
1168
  function () {
1163
- console.log('widget initialized ' + widgetInfo.widgetInstanceId);
1169
+ widgetContainer.isWidgetLoaded = true;
1164
1170
  widgetConfigFilter.appConfig = _this.appConfig;
1165
1171
  widgetConfigFilter.widgetInfo = (/** @type {?} */ ({}));
1166
1172
  widgetConfigFilter.widgetInfo.widgetName = widgetInfo.widgetName;
@@ -1190,7 +1196,9 @@
1190
1196
  appConfig: this.appConfig,
1191
1197
  widgetInfo: widgetInfo
1192
1198
  }));
1193
- widgetContainerContext.widgetElement.loadContent(widgetConfigFilter);
1199
+ if (widgetContainerContext.isWidgetLoaded) {
1200
+ widgetContainerContext.widgetElement.loadContent(widgetConfigFilter);
1201
+ }
1194
1202
  };
1195
1203
  RAWidgetContainer.decorators = [
1196
1204
  { type: core.Component, args: [{
@@ -1214,6 +1222,7 @@
1214
1222
  data: [{ type: core.Input, args: ['data',] }],
1215
1223
  raDashboardEventBus: [{ type: core.Input, args: ['event-bus',] }],
1216
1224
  appConfig: [{ type: core.Input, args: ['app-config',] }],
1225
+ widgetWidth: [{ type: core.Input, args: ['widget-width',] }],
1217
1226
  widgetDeleted: [{ type: core.Output }]
1218
1227
  };
1219
1228
  return RAWidgetContainer;