@schneideress/dashboardframework 20.0.8 → 20.0.10

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.
@@ -4951,7 +4951,8 @@ class RADashboardArea {
4951
4951
  let rect = el.getBoundingClientRect();
4952
4952
  const height = rect.height;
4953
4953
  if (this.hasGrid) {
4954
- const multiplier = Math.max(1, this.widgetList.length / 2);
4954
+ const effectiveCount = (this.widgetList.length % 2 === 1) ? this.widgetList.length + 1 : this.widgetList.length;
4955
+ const multiplier = Math.max(1, effectiveCount / 2);
4955
4956
  this.gridsterHeight = (height + 20) * multiplier + 'px';
4956
4957
  }
4957
4958
  return rect && rect.top < window.innerHeight;
@@ -5167,9 +5168,12 @@ class RADashboardArea {
5167
5168
  }
5168
5169
  this.gridheight = areaHeight;
5169
5170
  if (this.hasGrid) {
5170
- const height = this.gridItem.height; // to handle the height of the gridster in emission report
5171
- if (height)
5172
- this.gridsterHeight = height + 20 + 'px';
5171
+ const baseHeight = this.gridItem.height; // gridster container current height
5172
+ if (baseHeight) {
5173
+ const effectiveCount = (this.widgetList.length % 2 === 1) ? this.widgetList.length + 1 : this.widgetList.length;
5174
+ const multiplier = Math.max(1, effectiveCount / 2);
5175
+ this.gridsterHeight = (baseHeight + 20) * multiplier + 'px';
5176
+ }
5173
5177
  }
5174
5178
  });
5175
5179
  }
@@ -5203,7 +5207,7 @@ class RADashboardArea {
5203
5207
  }
5204
5208
  if (this.isSiteDetailDashboard) {
5205
5209
  this.raDashboardEventBus.publish(RAEvent.UpdateWidgetCount, -1);
5206
- this.raDashboardEventBus.publish(RAEvent.RearrangeClicked, true);
5210
+ this.rearrangeWidgets();
5207
5211
  }
5208
5212
  }
5209
5213
  /**To rearrange widgets position in the dashboard, compactLeft&Up,compactLeft,compactUp,etc*/
@@ -5220,6 +5224,17 @@ class RADashboardArea {
5220
5224
  setTimeout(() => {
5221
5225
  this.setAreaHeight();
5222
5226
  });
5227
+ // Centralized persistence for Site Detail dashboards (desktop only)
5228
+ if (this.isSiteDetailDashboard && this.responsiveService.IsDesktopView) {
5229
+ setTimeout(() => {
5230
+ this.widgetList.forEach(item => {
5231
+ const id = item.widgetInfo?.widgetInstanceId;
5232
+ if (id) {
5233
+ this.updateWidgetPosition(id);
5234
+ }
5235
+ });
5236
+ }, 50);
5237
+ }
5223
5238
  }
5224
5239
  /**To add widget instance to the database with the next available position and to make changes in
5225
5240
  * dashboard area.