@siemens/dashboards-ng 49.7.0 → 49.9.0

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@siemens/dashboards-ng",
3
3
  "description": "Element Dashboards library.",
4
- "version": "49.7.0",
4
+ "version": "49.9.0",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -20,12 +20,13 @@
20
20
  "peerDependencies": {
21
21
  "@angular/common": "21",
22
22
  "@angular/core": "21",
23
- "@siemens/element-ng": "49.7.0",
24
- "@siemens/element-theme": "49.7.0",
23
+ "@siemens/element-ng": "49.9.0",
24
+ "@siemens/element-theme": "49.9.0",
25
25
  "gridstack": "^12.3.3",
26
26
  "@angular-architects/module-federation": "^20.0.0 || ^21.0.0",
27
27
  "@angular-architects/native-federation": "^21.1.0",
28
- "@module-federation/enhanced": "^2.0.0"
28
+ "@module-federation/enhanced": "^2.0.0",
29
+ "@module-federation/runtime": "^2.0.0"
29
30
  },
30
31
  "peerDependenciesMeta": {
31
32
  "@angular-architects/module-federation": {
@@ -1,10 +1,10 @@
1
1
  import * as _siemens_element_translate_ng_translate from '@siemens/element-translate-ng/translate';
2
2
  import { TranslatableString } from '@siemens/element-translate-ng/translate';
3
3
  import * as _angular_core from '@angular/core';
4
- import { Type, InputSignal, EventEmitter, TemplateRef, OutputEmitterRef, OnInit, OnChanges, ViewContainerRef, SimpleChanges, OnDestroy, InjectionToken, Provider, Injector, EnvironmentInjector, ComponentRef } from '@angular/core';
4
+ import { Type, InputSignal, OutputEmitterRef, EventEmitter, TemplateRef, OnInit, OnChanges, ViewContainerRef, SimpleChanges, OnDestroy, OutputRefSubscription, Injector, EnvironmentInjector, ComponentRef, InjectionToken, Provider } from '@angular/core';
5
5
  import { AccentLineType, MenuItem } from '@siemens/element-ng/common';
6
6
  import { SiDashboardComponent } from '@siemens/element-ng/dashboard';
7
- import { Subject, BehaviorSubject, Observable } from 'rxjs';
7
+ import { Subject, Subscription, Observable, BehaviorSubject } from 'rxjs';
8
8
  import { GridStackOptions, GridStackNode, GridStack, GridItemHTMLElement } from 'gridstack';
9
9
  import { NavigationExtras } from '@angular/router';
10
10
  import { ViewType, ContentActionBarMainItem } from '@siemens/element-ng/content-action-bar';
@@ -42,9 +42,9 @@ interface Widget {
42
42
  /** An optional version string. */
43
43
  version?: string;
44
44
  /** The name of the widget that is presented in the widget catalog. */
45
- name: string;
45
+ name: TranslatableString;
46
46
  /** An optional description that is visible in the widget catalog. */
47
- description?: string;
47
+ description?: TranslatableString;
48
48
  /** A CSS icon class that specifies the widget icon, displayed in the catalog. */
49
49
  iconClass?: string;
50
50
  /** The factory to instantiate a widget instance component that is added to the dashboard. */
@@ -177,7 +177,7 @@ interface WidgetConfig {
177
177
  /**
178
178
  * grid item header text.
179
179
  */
180
- heading?: string;
180
+ heading?: TranslatableString;
181
181
  /** Defines whether the widget instance component can be expanded and enlarged over the dashboard. */
182
182
  expandable?: boolean;
183
183
  /** A widget specific payload object. Placeholder to pass in additional configuration. */
@@ -393,6 +393,14 @@ declare class SiGridstackWrapperComponent implements OnInit, OnChanges {
393
393
  * Module configuration
394
394
  */
395
395
  readonly gridConfig: _angular_core.InputSignal<GridConfig | undefined>;
396
+ /**
397
+ * Map of widget id to widget definition, passed through to widget hosts.
398
+ *
399
+ * @defaultValue new Map()
400
+ */
401
+ readonly widgetCatalogMap: _angular_core.InputSignal<Map<string, {
402
+ componentFactory: WidgetComponentFactory;
403
+ }>>;
396
404
  /**
397
405
  * Emits dashboard grid events.
398
406
  */
@@ -435,7 +443,33 @@ declare class SiGridstackWrapperComponent implements OnInit, OnChanges {
435
443
  private diffWidgetConfigs;
436
444
  private hookEvents;
437
445
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiGridstackWrapperComponent, never>;
438
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<SiGridstackWrapperComponent, "si-gridstack-wrapper", never, { "widgetConfigs": { "alias": "widgetConfigs"; "required": false; "isSignal": true; }; "editable": { "alias": "editable"; "required": false; "isSignal": true; }; "gridConfig": { "alias": "gridConfig"; "required": false; "isSignal": true; }; }, { "gridEvent": "gridEvent"; "widgetInstanceRemove": "widgetInstanceRemove"; "widgetInstanceEdit": "widgetInstanceEdit"; }, never, never, true, never>;
446
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<SiGridstackWrapperComponent, "si-gridstack-wrapper", never, { "widgetConfigs": { "alias": "widgetConfigs"; "required": false; "isSignal": true; }; "editable": { "alias": "editable"; "required": false; "isSignal": true; }; "gridConfig": { "alias": "gridConfig"; "required": false; "isSignal": true; }; "widgetCatalogMap": { "alias": "widgetCatalogMap"; "required": false; "isSignal": true; }; }, { "gridEvent": "gridEvent"; "widgetInstanceRemove": "widgetInstanceRemove"; "widgetInstanceEdit": "widgetInstanceEdit"; }, never, never, true, never>;
447
+ }
448
+
449
+ /**
450
+ * Base class encapsulating common widget editor lifecycle management.
451
+ * Both `SiWidgetCatalogComponent` and `SiWidgetInstanceEditorDialogComponent`
452
+ * extend this class to share editor setup, teardown, and status handling logic.
453
+ */
454
+ declare abstract class SiWidgetEditorBase implements OnDestroy {
455
+ /** Indicates if the current config is valid or not. */
456
+ protected readonly invalidConfig: _angular_core.WritableSignal<boolean>;
457
+ /** Marks the widget configuration as modified. */
458
+ protected readonly widgetConfigModified: _angular_core.WritableSignal<boolean>;
459
+ protected readonly editorWizardState: _angular_core.WritableSignal<WidgetInstanceEditorWizardState | undefined>;
460
+ protected widgetInstanceEditor?: WidgetInstanceEditor;
461
+ protected subscriptions: (Subscription | OutputRefSubscription)[];
462
+ protected readonly editorHost: _angular_core.Signal<ViewContainerRef>;
463
+ protected injector: Injector;
464
+ protected envInjector: EnvironmentInjector;
465
+ ngOnDestroy(): void;
466
+ protected loadWidgetEditor(widgetComponentFactory: WidgetComponentFactory, host: ViewContainerRef): Observable<ComponentRef<WidgetInstanceEditor>>;
467
+ protected initializeEditor(componentRef: ComponentRef<WidgetInstanceEditor>, config: WidgetConfig | Omit<WidgetConfig, 'id'>): void;
468
+ protected tearDownEditor(): void;
469
+ protected isEditorWizard(editor?: WidgetInstanceEditor | WidgetInstanceEditorWizard): editor is WidgetInstanceEditorWizard;
470
+ protected handleStatusChanges(statusChanges: Partial<WidgetConfigStatus>): void;
471
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiWidgetEditorBase, never>;
472
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SiWidgetEditorBase, never, never, {}, {}, never, never, true, never>;
439
473
  }
440
474
 
441
475
  /**
@@ -444,7 +478,7 @@ declare class SiGridstackWrapperComponent implements OnInit, OnChanges {
444
478
  * into its content. The dialog component is accountable for interacting with the dashboard
445
479
  * and offers options for saving changes or terminating the editing process.
446
480
  */
447
- declare class SiWidgetInstanceEditorDialogComponent implements OnInit, OnDestroy {
481
+ declare class SiWidgetInstanceEditorDialogComponent extends SiWidgetEditorBase implements OnInit {
448
482
  /**
449
483
  * Input for the widget instance configuration. It is used to populate the
450
484
  * widget editor.
@@ -464,9 +498,6 @@ declare class SiWidgetInstanceEditorDialogComponent implements OnInit, OnDestroy
464
498
  * Emits when the editor instantiation is completed.
465
499
  */
466
500
  readonly editorSetupCompleted: _angular_core.OutputEmitterRef<void>;
467
- protected readonly editorHost: _angular_core.Signal<ViewContainerRef>;
468
- /** Indicates if the current config is valid or not. If invalid, the save button will be disabled. */
469
- protected readonly invalidConfig: _angular_core.WritableSignal<boolean>;
470
501
  protected readonly showNextButton: _angular_core.Signal<boolean>;
471
502
  protected readonly disableNextButton: _angular_core.Signal<boolean>;
472
503
  protected readonly showPreviousButton: _angular_core.Signal<boolean>;
@@ -480,27 +511,12 @@ declare class SiWidgetInstanceEditorDialogComponent implements OnInit, OnDestroy
480
511
  protected labelDialogSave: _siemens_element_translate_ng_translate.TranslatableString;
481
512
  protected labelDialogDiscard: _siemens_element_translate_ng_translate.TranslatableString;
482
513
  protected labelDialogCancel: _siemens_element_translate_ng_translate.TranslatableString;
483
- /**
484
- * Marks the widget configuration as modified. Is set when widget editor instance
485
- * emits configChange events. Triggers edit discard confirmation dialog when widget config
486
- * is modified but not dialog is canceled.
487
- * */
488
- private readonly widgetConfigModified;
489
- private widgetInstanceEditor?;
490
- private readonly editorWizardState;
491
- private subscriptions;
492
- private injector;
493
- private envInjector;
494
514
  private dialogService;
495
515
  ngOnInit(): void;
496
- ngOnDestroy(): void;
497
516
  protected onCancel(): void;
498
517
  protected onNext(): void;
499
518
  protected onPrevious(): void;
500
519
  protected onSave(): void;
501
- private tearDownEditor;
502
- private isEditorWizard;
503
- private handleStatusChanges;
504
520
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiWidgetInstanceEditorDialogComponent, never>;
505
521
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<SiWidgetInstanceEditorDialogComponent, "si-widget-instance-editor-dialog", never, { "widgetConfig": { "alias": "widgetConfig"; "required": true; "isSignal": true; }; "widget": { "alias": "widget"; "required": true; "isSignal": true; }; }, { "widgetConfig": "widgetConfigChange"; "closed": "closed"; "editorSetupCompleted": "editorSetupCompleted"; }, never, never, true, never>;
506
522
  }
@@ -511,7 +527,6 @@ declare class SiWidgetInstanceEditorDialogComponent implements OnInit, OnDestroy
511
527
  */
512
528
  declare class SiGridComponent implements OnInit, OnChanges, OnDestroy {
513
529
  private storeSubscription?;
514
- private gridService;
515
530
  private modalService;
516
531
  private widgetStorage;
517
532
  private widgetIdProvider;
@@ -541,6 +556,7 @@ declare class SiGridComponent implements OnInit, OnChanges, OnDestroy {
541
556
  *
542
557
  * @defaultValue [] */
543
558
  readonly widgetCatalog: _angular_core.InputSignal<Widget[]>;
559
+ protected readonly widgetCatalogMap: _angular_core.Signal<Map<string, Widget>>;
544
560
  /**
545
561
  * When the user clicks edit on a widget instance, an editor need to appear and the
546
562
  * widget editor component need to be loaded. When the grid is used standalone, it
@@ -750,7 +766,7 @@ declare const provideDashboardToolbarItems: (toolbarItems?: {
750
766
  * selection, a host in which the widget specific editor is loaded. Applications can either
751
767
  * stay with the default catalog or implement their own by extending this class.
752
768
  */
753
- declare class SiWidgetCatalogComponent implements OnInit, OnDestroy {
769
+ declare class SiWidgetCatalogComponent extends SiWidgetEditorBase implements OnInit {
754
770
  /**
755
771
  * Placeholder text for the search input field in the widget catalog.
756
772
  *
@@ -773,7 +789,6 @@ declare class SiWidgetCatalogComponent implements OnInit, OnDestroy {
773
789
  * @defaultValue 'list'
774
790
  */
775
791
  readonly view: _angular_core.WritableSignal<"list" | "editor" | "editor-only">;
776
- protected readonly editorHost: _angular_core.Signal<ViewContainerRef>;
777
792
  /**
778
793
  * Property to provide the available widgets to the catalog. The flexible
779
794
  * dashboard creates the catalog by Angular's `createComponent()` method
@@ -793,6 +808,7 @@ declare class SiWidgetCatalogComponent implements OnInit, OnDestroy {
793
808
  protected readonly selected: _angular_core.WritableSignal<Widget | undefined>;
794
809
  private widgetConfig?;
795
810
  private readonly hasEditor;
811
+ private readonly translateService;
796
812
  protected labelCancel: _siemens_element_translate_ng_translate.TranslatableString;
797
813
  protected labelPrevious: _siemens_element_translate_ng_translate.TranslatableString;
798
814
  protected labelNext: _siemens_element_translate_ng_translate.TranslatableString;
@@ -808,34 +824,17 @@ declare class SiWidgetCatalogComponent implements OnInit, OnDestroy {
808
824
  protected readonly showPreviousButton: _angular_core.Signal<boolean>;
809
825
  protected readonly disableAddButton: _angular_core.Signal<boolean>;
810
826
  protected readonly disableNextButton: _angular_core.Signal<boolean>;
811
- /** Indicates if the current config is valid or not. If invalid, the add button is disabled. */
812
- private readonly invalidConfig;
813
- /**
814
- * Marks the widget configuration as modified. Is set when widget editor instance
815
- * emits configChange events. Triggers edit discard confirmation dialog when widget config
816
- * is modified but not added to the dashboard.
817
- * */
818
- private widgetConfigModified;
819
- private widgetInstanceEditor?;
820
- private readonly editorWizardState;
821
- private subscriptions;
822
827
  private dialogService;
823
- private injector;
824
- private envInjector;
825
828
  private readonly widgetCdkListbox;
826
829
  ngOnInit(): void;
827
- ngOnDestroy(): void;
828
830
  protected onSearch(searchTerm?: string): void;
829
831
  protected onCancel(): void;
830
832
  protected onNext(): void;
831
833
  protected onPrevious(): void;
832
834
  private setupWidgetInstanceEditor;
833
- private tearDownEditor;
834
835
  private setupCatalog;
835
836
  protected onAddWidget(): void;
836
837
  protected selectWidget(widget?: Widget): void;
837
- private isEditorWizard;
838
- private handleStatusChanges;
839
838
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiWidgetCatalogComponent, never>;
840
839
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<SiWidgetCatalogComponent, "si-widget-catalog", never, { "searchPlaceholder": { "alias": "searchPlaceholder"; "required": false; "isSignal": true; }; }, { "closed": "closed"; }, never, never, true, never>;
841
840
  }
@@ -953,7 +952,7 @@ declare class SiFlexibleDashboardComponent implements OnInit, OnChanges, OnDestr
953
952
  readonly primaryEditActions$: BehaviorSubject<(MenuItem | DashboardToolbarItem)[]>;
954
953
  /**
955
954
  * The secondary action menu items shown in the edit mode of the dashboard. When all menu items are more than
956
- * three, they will be places in the secondary menu of the content action bar.
955
+ * three, they will be placed in the secondary menu of the content action bar.
957
956
  */
958
957
  readonly secondaryEditActions$: BehaviorSubject<(MenuItem | DashboardToolbarItem)[]>;
959
958
  /**