@dragonworks/ngx-dashboard 20.3.1 → 20.3.2

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.
@@ -23,7 +23,7 @@ import { DomSanitizer } from '@angular/platform-browser';
23
23
 
24
24
  // Auto-generated by scripts/generate-versions.js
25
25
  // Do not edit manually
26
- const NGX_DASHBOARD_VERSION = '20.3.1';
26
+ const NGX_DASHBOARD_VERSION = '20.3.2';
27
27
 
28
28
  /**
29
29
  * Maximum number of columns supported by the grid.
@@ -1434,18 +1434,24 @@ class CellComponent {
1434
1434
  action: () => this.onEdit(),
1435
1435
  disabled: !this.canEdit(),
1436
1436
  },
1437
- {
1438
- label: $localize `:@@ngx.dashboard.cell.menu.settings:Settings`,
1439
- icon: 'settings',
1440
- action: () => this.onSettings(),
1441
- },
1442
- { divider: true },
1443
- {
1444
- label: $localize `:@@ngx.dashboard.cell.menu.delete:Delete`,
1445
- icon: 'delete',
1446
- action: () => this.onDelete(),
1447
- },
1448
1437
  ];
1438
+ // Add shared state entry if widget implements the method
1439
+ if (this.canEditSharedState()) {
1440
+ items.push({
1441
+ label: $localize `:@@ngx.dashboard.cell.menu.editShared:Edit Shared State`,
1442
+ icon: 'edit_document',
1443
+ action: () => this.onEditSharedState(),
1444
+ });
1445
+ }
1446
+ items.push({
1447
+ label: $localize `:@@ngx.dashboard.cell.menu.settings:Settings`,
1448
+ icon: 'settings',
1449
+ action: () => this.onSettings(),
1450
+ }, { divider: true }, {
1451
+ label: $localize `:@@ngx.dashboard.cell.menu.delete:Delete`,
1452
+ icon: 'delete',
1453
+ action: () => this.onDelete(),
1454
+ });
1449
1455
  // Position menu at exact mouse coordinates
1450
1456
  this.#contextMenuService.show(event.clientX, event.clientY, items);
1451
1457
  }
@@ -1455,6 +1461,9 @@ class CellComponent {
1455
1461
  }
1456
1462
  return false;
1457
1463
  }
1464
+ canEditSharedState() {
1465
+ return !!this.#widgetRef?.instance?.dashboardEditSharedState;
1466
+ }
1458
1467
  onEdit() {
1459
1468
  this.edit.emit(this.widgetId());
1460
1469
  // Call the widget's edit dialog method if it exists
@@ -1462,6 +1471,11 @@ class CellComponent {
1462
1471
  this.#widgetRef.instance.dashboardEditState();
1463
1472
  }
1464
1473
  }
1474
+ onEditSharedState() {
1475
+ if (this.#widgetRef?.instance?.dashboardEditSharedState) {
1476
+ this.#widgetRef.instance.dashboardEditSharedState();
1477
+ }
1478
+ }
1465
1479
  onDelete() {
1466
1480
  this.delete.emit(this.widgetId());
1467
1481
  }