@siemens/dashboards-ng 48.10.0 → 49.0.0-rc.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.
- package/README.md +169 -21
- package/fesm2022/siemens-dashboards-ng-module-federation.mjs.map +1 -1
- package/fesm2022/siemens-dashboards-ng-native-federation-mf-bridge.mjs +38 -0
- package/fesm2022/siemens-dashboards-ng-native-federation-mf-bridge.mjs.map +1 -0
- package/fesm2022/siemens-dashboards-ng-native-federation.mjs +39 -0
- package/fesm2022/siemens-dashboards-ng-native-federation.mjs.map +1 -0
- package/fesm2022/siemens-dashboards-ng.mjs +180 -178
- package/fesm2022/siemens-dashboards-ng.mjs.map +1 -1
- package/module-federation/package.json +2 -1
- package/native-federation/mf-bridge/package.json +4 -0
- package/native-federation/package.json +4 -0
- package/package.json +32 -11
- package/translate/package.json +2 -1
- package/types/siemens-dashboards-ng-native-federation-mf-bridge.d.ts +9 -0
- package/types/siemens-dashboards-ng-native-federation.d.ts +3 -0
- package/{index.d.ts → types/siemens-dashboards-ng.d.ts} +119 -84
- /package/{module-federation/index.d.ts → types/siemens-dashboards-ng-module-federation.d.ts} +0 -0
- /package/{translate/index.d.ts → types/siemens-dashboards-ng-translate.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@siemens/dashboards-ng",
|
|
3
3
|
"description": "Element Dashboards library.",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "49.0.0-rc.2",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -18,29 +18,50 @@
|
|
|
18
18
|
"bugs": "https://github.com/siemens/element/issues/new",
|
|
19
19
|
"type": "module",
|
|
20
20
|
"peerDependencies": {
|
|
21
|
-
"@angular/common": "
|
|
22
|
-
"@angular/core": "
|
|
23
|
-
"@
|
|
24
|
-
"@siemens/element-
|
|
25
|
-
"
|
|
26
|
-
"
|
|
21
|
+
"@angular/common": "21",
|
|
22
|
+
"@angular/core": "21",
|
|
23
|
+
"@siemens/element-ng": "49.0.0-rc.2",
|
|
24
|
+
"@siemens/element-theme": "49.0.0-rc.2",
|
|
25
|
+
"gridstack": "^12.3.3",
|
|
26
|
+
"@angular-architects/module-federation": "^20.0.0",
|
|
27
|
+
"@angular-architects/native-federation": "^21.1.0",
|
|
28
|
+
"@module-federation/enhanced": "^2.0.0"
|
|
29
|
+
},
|
|
30
|
+
"peerDependenciesMeta": {
|
|
31
|
+
"@angular-architects/module-federation": {
|
|
32
|
+
"optional": true
|
|
33
|
+
},
|
|
34
|
+
"@angular-architects/native-federation": {
|
|
35
|
+
"optional": true
|
|
36
|
+
},
|
|
37
|
+
"@module-federation/enhanced": {
|
|
38
|
+
"optional": true
|
|
39
|
+
}
|
|
27
40
|
},
|
|
28
41
|
"module": "fesm2022/siemens-dashboards-ng.mjs",
|
|
29
|
-
"typings": "
|
|
42
|
+
"typings": "types/siemens-dashboards-ng.d.ts",
|
|
30
43
|
"exports": {
|
|
31
44
|
"./package.json": {
|
|
32
45
|
"default": "./package.json"
|
|
33
46
|
},
|
|
34
47
|
".": {
|
|
35
|
-
"types": "./
|
|
48
|
+
"types": "./types/siemens-dashboards-ng.d.ts",
|
|
36
49
|
"default": "./fesm2022/siemens-dashboards-ng.mjs"
|
|
37
50
|
},
|
|
38
51
|
"./module-federation": {
|
|
39
|
-
"types": "./module-federation
|
|
52
|
+
"types": "./types/siemens-dashboards-ng-module-federation.d.ts",
|
|
40
53
|
"default": "./fesm2022/siemens-dashboards-ng-module-federation.mjs"
|
|
41
54
|
},
|
|
55
|
+
"./native-federation": {
|
|
56
|
+
"types": "./types/siemens-dashboards-ng-native-federation.d.ts",
|
|
57
|
+
"default": "./fesm2022/siemens-dashboards-ng-native-federation.mjs"
|
|
58
|
+
},
|
|
59
|
+
"./native-federation/mf-bridge": {
|
|
60
|
+
"types": "./types/siemens-dashboards-ng-native-federation-mf-bridge.d.ts",
|
|
61
|
+
"default": "./fesm2022/siemens-dashboards-ng-native-federation-mf-bridge.mjs"
|
|
62
|
+
},
|
|
42
63
|
"./translate": {
|
|
43
|
-
"types": "./translate
|
|
64
|
+
"types": "./types/siemens-dashboards-ng-translate.d.ts",
|
|
44
65
|
"default": "./fesm2022/siemens-dashboards-ng-translate.mjs"
|
|
45
66
|
}
|
|
46
67
|
},
|
package/translate/package.json
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ModuleFederation } from '@module-federation/runtime';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Use this when having native federation shell and remote module is using module federation.
|
|
5
|
+
* @param mfInstance - The ModuleFederation instance returned by `createInstance` from '\@module-federation/runtime'
|
|
6
|
+
*/
|
|
7
|
+
declare const registerModuleFederatedWidgetLoader: (mfInstance: ModuleFederation) => void;
|
|
8
|
+
|
|
9
|
+
export { registerModuleFederatedWidgetLoader };
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _siemens_element_translate_ng_translate from '@siemens/element-translate-ng/translate';
|
|
2
|
+
import { TranslatableString } from '@siemens/element-translate-ng/translate';
|
|
2
3
|
import * as _angular_core from '@angular/core';
|
|
3
|
-
import { InjectionToken, Type, InputSignal, OutputEmitterRef, EventEmitter, TemplateRef, OnInit, OnChanges, ViewContainerRef, SimpleChanges, OnDestroy, Injector, EnvironmentInjector, ComponentRef
|
|
4
|
+
import { InjectionToken, Type, InputSignal, OutputEmitterRef, EventEmitter, TemplateRef, OnInit, OnChanges, ViewContainerRef, SimpleChanges, OnDestroy, Injector, EnvironmentInjector, ComponentRef } from '@angular/core';
|
|
4
5
|
import { AccentLineType, MenuItem } from '@siemens/element-ng/common';
|
|
5
6
|
import { SiDashboardComponent } from '@siemens/element-ng/dashboard';
|
|
6
7
|
import { Subject, BehaviorSubject, Observable } from 'rxjs';
|
|
7
8
|
import { GridStackOptions, GridStackNode, GridStack, GridItemHTMLElement } from 'gridstack';
|
|
8
9
|
import { NavigationExtras } from '@angular/router';
|
|
9
|
-
import { TranslatableString } from '@siemens/element-translate-ng/translate';
|
|
10
|
-
import { SiLoadingService } from '@siemens/element-ng/loading-spinner';
|
|
11
10
|
import { ViewType, ContentActionBarMainItem } from '@siemens/element-ng/content-action-bar';
|
|
12
11
|
import { MenuItem as MenuItem$1 } from '@siemens/element-ng/menu';
|
|
13
12
|
export * from '@siemens/dashboards-ng/translate';
|
|
@@ -44,10 +43,6 @@ type Config = {
|
|
|
44
43
|
* in your app configuration.
|
|
45
44
|
*/
|
|
46
45
|
declare const SI_DASHBOARD_CONFIGURATION: InjectionToken<Config>;
|
|
47
|
-
/**
|
|
48
|
-
* @deprecated Use SI_DASHBOARD_CONFIGURATION instead.
|
|
49
|
-
*/
|
|
50
|
-
declare const CONFIG_TOKEN: InjectionToken<Config>;
|
|
51
46
|
|
|
52
47
|
/**
|
|
53
48
|
* Copyright (c) Siemens 2016 - 2025
|
|
@@ -77,8 +72,8 @@ interface Widget {
|
|
|
77
72
|
/** Optional default payload object that is copied into every widget instance {@link WidgetConfig}. */
|
|
78
73
|
payload?: any;
|
|
79
74
|
}
|
|
80
|
-
/** Factory type that is either a {@link WidgetComponentTypeFactory}, {@link FederatedModule} or {@link WebComponent}. */
|
|
81
|
-
type WidgetComponentFactory = WidgetComponentTypeFactory | FederatedModule | WebComponent;
|
|
75
|
+
/** Factory type that is either a {@link WidgetComponentTypeFactory}, {@link FederatedModule}, {@link FederatedBridgeModule} or {@link WebComponent}. */
|
|
76
|
+
type WidgetComponentFactory = WidgetComponentTypeFactory | FederatedModule | WebComponent | FederatedBridgeModule;
|
|
82
77
|
type CommonFactoryFields = {
|
|
83
78
|
componentName: string;
|
|
84
79
|
editorComponentName?: string;
|
|
@@ -105,8 +100,20 @@ type StandaloneOptions = WidgetComponentTypeBaseConfig & {
|
|
|
105
100
|
moduleLoader?: never;
|
|
106
101
|
};
|
|
107
102
|
type WidgetComponentTypeFactory = CommonFactoryFields & (ModuleOptions | StandaloneOptions);
|
|
103
|
+
/**
|
|
104
|
+
* Factory configuration for loading widget components from a federated module.
|
|
105
|
+
* Supports both Module Federation and Native Federation patterns for micro-frontend architectures.
|
|
106
|
+
* Use this when the widget component is hosted in a separate, independently deployed application.
|
|
107
|
+
*/
|
|
108
108
|
type FederatedModule = CommonFactoryFields & LoadRemoteModuleOptions & {
|
|
109
|
-
factoryType: 'module-federation';
|
|
109
|
+
factoryType: 'module-federation' | 'native-federation';
|
|
110
|
+
[index: string]: any;
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* Use this when having native federation shell and remote module is using module federation.
|
|
114
|
+
*/
|
|
115
|
+
type FederatedBridgeModule = CommonFactoryFields & LoadRemoteBridgeOptions & {
|
|
116
|
+
factoryType: 'native-federation-module-bridge';
|
|
110
117
|
[index: string]: any;
|
|
111
118
|
};
|
|
112
119
|
type WebComponent = CommonFactoryFields & {
|
|
@@ -196,13 +203,6 @@ interface WidgetConfig {
|
|
|
196
203
|
actionBarViewType?: ViewType;
|
|
197
204
|
isNotRemovable?: boolean;
|
|
198
205
|
immutable?: boolean;
|
|
199
|
-
/**
|
|
200
|
-
* Widget instance editor components can use this property to indicate an invalid configuration.
|
|
201
|
-
* True if the config is invalid. False, undefined or null indicate a valid configuration.
|
|
202
|
-
*
|
|
203
|
-
* @deprecated Use the statusChanges emitter to notify about configuration status changes.
|
|
204
|
-
*/
|
|
205
|
-
invalid?: boolean;
|
|
206
206
|
/**
|
|
207
207
|
* Optional configuration for an image to be displayed on the widget instance.
|
|
208
208
|
*/
|
|
@@ -355,6 +355,17 @@ declare const createWidgetConfig: (widget: Widget) => Omit<WidgetConfig, "id">;
|
|
|
355
355
|
* We take it over into this file to prevent adding a hard dependency.
|
|
356
356
|
*/
|
|
357
357
|
type LoadRemoteModuleOptions = LoadRemoteModuleScriptOptions | LoadRemoteModuleEsmOptions | LoadRemoteModuleManifestOptions;
|
|
358
|
+
/**
|
|
359
|
+
* Definition is based on `@module-federation/enhanced` loadRemote options.
|
|
360
|
+
* We take it over into this file to prevent adding a hard dependency.
|
|
361
|
+
*/
|
|
362
|
+
type LoadRemoteBridgeOptions = {
|
|
363
|
+
id: string;
|
|
364
|
+
options?: {
|
|
365
|
+
loadFactory?: boolean | undefined;
|
|
366
|
+
from: 'build' | 'runtime';
|
|
367
|
+
} | undefined;
|
|
368
|
+
};
|
|
358
369
|
type LoadRemoteModuleScriptOptions = {
|
|
359
370
|
type?: 'script';
|
|
360
371
|
remoteEntry?: string;
|
|
@@ -462,15 +473,15 @@ declare class SiWidgetInstanceEditorDialogComponent implements OnInit, OnDestroy
|
|
|
462
473
|
protected readonly disableNextButton: _angular_core.Signal<boolean>;
|
|
463
474
|
protected readonly showPreviousButton: _angular_core.Signal<boolean>;
|
|
464
475
|
protected readonly disablePreviousButton: _angular_core.Signal<boolean>;
|
|
465
|
-
protected labelSave:
|
|
466
|
-
protected labelCancel:
|
|
467
|
-
protected labelPrevious:
|
|
468
|
-
protected labelNext:
|
|
469
|
-
protected labelDialogMessage:
|
|
470
|
-
protected labelDialogHeading:
|
|
471
|
-
protected labelDialogSave:
|
|
472
|
-
protected labelDialogDiscard:
|
|
473
|
-
protected labelDialogCancel:
|
|
476
|
+
protected labelSave: _siemens_element_translate_ng_translate.TranslatableString;
|
|
477
|
+
protected labelCancel: _siemens_element_translate_ng_translate.TranslatableString;
|
|
478
|
+
protected labelPrevious: _siemens_element_translate_ng_translate.TranslatableString;
|
|
479
|
+
protected labelNext: _siemens_element_translate_ng_translate.TranslatableString;
|
|
480
|
+
protected labelDialogMessage: _siemens_element_translate_ng_translate.TranslatableString;
|
|
481
|
+
protected labelDialogHeading: _siemens_element_translate_ng_translate.TranslatableString;
|
|
482
|
+
protected labelDialogSave: _siemens_element_translate_ng_translate.TranslatableString;
|
|
483
|
+
protected labelDialogDiscard: _siemens_element_translate_ng_translate.TranslatableString;
|
|
484
|
+
protected labelDialogCancel: _siemens_element_translate_ng_translate.TranslatableString;
|
|
474
485
|
/**
|
|
475
486
|
* Marks the widget configuration as modified. Is set when widget editor instance
|
|
476
487
|
* emits configChange events. Triggers edit discard confirmation dialog when widget config
|
|
@@ -496,7 +507,6 @@ declare class SiWidgetInstanceEditorDialogComponent implements OnInit, OnDestroy
|
|
|
496
507
|
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>;
|
|
497
508
|
}
|
|
498
509
|
|
|
499
|
-
declare const NEW_WIDGET_PREFIX = "new-widget-";
|
|
500
510
|
/**
|
|
501
511
|
* The grid component is the actual component on which the widget instances are placed and visualized. You can think of
|
|
502
512
|
* a headless dashboard, without a title, toolbar or edit buttons.
|
|
@@ -506,6 +516,7 @@ declare class SiGridComponent implements OnInit, OnChanges, OnDestroy {
|
|
|
506
516
|
private gridService;
|
|
507
517
|
private modalService;
|
|
508
518
|
private widgetStorage;
|
|
519
|
+
private widgetIdProvider;
|
|
509
520
|
/**
|
|
510
521
|
* Configuration options for a grid instance. Default is the optional
|
|
511
522
|
* value from the {@link SI_DASHBOARD_CONFIGURATION}.
|
|
@@ -612,13 +623,6 @@ declare class SiGridComponent implements OnInit, OnChanges, OnDestroy {
|
|
|
612
623
|
markedForRemoval: WidgetConfig[];
|
|
613
624
|
/** @defaultValue viewChild.required(SiGridstackWrapperComponent) */
|
|
614
625
|
readonly gridStackWrapper: _angular_core.Signal<SiGridstackWrapperComponent>;
|
|
615
|
-
/**
|
|
616
|
-
* Service used to indicate load and save indication.
|
|
617
|
-
* @deprecated Use `isLoading` instead.
|
|
618
|
-
*
|
|
619
|
-
* @defaultValue inject(SiLoadingService)
|
|
620
|
-
*/
|
|
621
|
-
loadingService: SiLoadingService;
|
|
622
626
|
/**
|
|
623
627
|
* Indication for load and save operations.
|
|
624
628
|
*/
|
|
@@ -729,7 +733,7 @@ declare class SiWidgetCatalogComponent implements OnInit, OnDestroy {
|
|
|
729
733
|
* t(() => $localize`:@@DASHBOARD.WIDGET_LIBRARY.SEARCH_PLACEHOLDER:Search widget`)
|
|
730
734
|
* ```
|
|
731
735
|
*/
|
|
732
|
-
readonly searchPlaceholder: _angular_core.InputSignal<
|
|
736
|
+
readonly searchPlaceholder: _angular_core.InputSignal<_siemens_element_translate_ng_translate.TranslatableString>;
|
|
733
737
|
/**
|
|
734
738
|
* Emits when the catalog is `closed`, either by canceling or by adding or saving
|
|
735
739
|
* a widget configuration. On cancel `undefined` is emitted, otherwise the related
|
|
@@ -763,16 +767,16 @@ declare class SiWidgetCatalogComponent implements OnInit, OnDestroy {
|
|
|
763
767
|
protected readonly selected: _angular_core.WritableSignal<Widget | undefined>;
|
|
764
768
|
private widgetConfig?;
|
|
765
769
|
private readonly hasEditor;
|
|
766
|
-
protected labelCancel:
|
|
767
|
-
protected labelPrevious:
|
|
768
|
-
protected labelNext:
|
|
769
|
-
protected labelAdd:
|
|
770
|
-
protected labelEmpty:
|
|
771
|
-
protected labelDialogHeading:
|
|
772
|
-
protected labelDialogCancel:
|
|
773
|
-
protected labelDialogMessage:
|
|
774
|
-
protected labelDialogDiscard:
|
|
775
|
-
protected labelWidgetCatalogList:
|
|
770
|
+
protected labelCancel: _siemens_element_translate_ng_translate.TranslatableString;
|
|
771
|
+
protected labelPrevious: _siemens_element_translate_ng_translate.TranslatableString;
|
|
772
|
+
protected labelNext: _siemens_element_translate_ng_translate.TranslatableString;
|
|
773
|
+
protected labelAdd: _siemens_element_translate_ng_translate.TranslatableString;
|
|
774
|
+
protected labelEmpty: _siemens_element_translate_ng_translate.TranslatableString;
|
|
775
|
+
protected labelDialogHeading: _siemens_element_translate_ng_translate.TranslatableString;
|
|
776
|
+
protected labelDialogCancel: _siemens_element_translate_ng_translate.TranslatableString;
|
|
777
|
+
protected labelDialogMessage: _siemens_element_translate_ng_translate.TranslatableString;
|
|
778
|
+
protected labelDialogDiscard: _siemens_element_translate_ng_translate.TranslatableString;
|
|
779
|
+
protected labelWidgetCatalogList: _siemens_element_translate_ng_translate.TranslatableString;
|
|
776
780
|
protected readonly showAddButton: _angular_core.Signal<boolean>;
|
|
777
781
|
protected readonly showNextButton: _angular_core.Signal<boolean>;
|
|
778
782
|
protected readonly showPreviousButton: _angular_core.Signal<boolean>;
|
|
@@ -885,7 +889,7 @@ declare class SiFlexibleDashboardComponent implements OnInit, OnChanges, OnDestr
|
|
|
885
889
|
* t(() => $localize`:@@DASHBOARD.WIDGET_LIBRARY.SEARCH_PLACEHOLDER:Search widget`)
|
|
886
890
|
* ```
|
|
887
891
|
*/
|
|
888
|
-
readonly searchPlaceholder: _angular_core.InputSignal<
|
|
892
|
+
readonly searchPlaceholder: _angular_core.InputSignal<_siemens_element_translate_ng_translate.TranslatableString>;
|
|
889
893
|
/**
|
|
890
894
|
* The grid component is the actual container for the widgets.
|
|
891
895
|
*/
|
|
@@ -904,9 +908,9 @@ declare class SiFlexibleDashboardComponent implements OnInit, OnChanges, OnDestr
|
|
|
904
908
|
* again and emits `false`.
|
|
905
909
|
*/
|
|
906
910
|
readonly isModified: _angular_core.OutputEmitterRef<boolean>;
|
|
907
|
-
protected labelAddWidget:
|
|
908
|
-
protected labelEditor:
|
|
909
|
-
protected labelCatalog:
|
|
911
|
+
protected labelAddWidget: _siemens_element_translate_ng_translate.TranslatableString;
|
|
912
|
+
protected labelEditor: _siemens_element_translate_ng_translate.TranslatableString;
|
|
913
|
+
protected labelCatalog: _siemens_element_translate_ng_translate.TranslatableString;
|
|
910
914
|
protected addWidgetInstanceAction: DashboardToolbarItem;
|
|
911
915
|
/**
|
|
912
916
|
* The primary action menu items shown in the edit mode of the dashboard.
|
|
@@ -973,14 +977,20 @@ declare abstract class SiWidgetStorage {
|
|
|
973
977
|
*/
|
|
974
978
|
abstract load(dashboardId?: string): Observable<WidgetConfig[]>;
|
|
975
979
|
/**
|
|
976
|
-
* Saves the given widget configuration.
|
|
977
|
-
*
|
|
980
|
+
* Saves the given widget configuration. New widgets have `id`
|
|
981
|
+
* generated through the `SiWidgetIdProvider.generateWidgetId` implementation
|
|
982
|
+
* and if ids comes from backend then it is in the responsibility of the implementor to update
|
|
983
|
+
* the ids of the new widgets with the ids returned from backend upon save. In addition,
|
|
978
984
|
* the implementor needs to check if objects that have been available before are missing. These
|
|
979
985
|
* widgets have been removed by the user. As a result of this method, the observables returned
|
|
980
986
|
* by the `load()` method should emit the new widget config objects, before also returning them.
|
|
981
|
-
* @param
|
|
987
|
+
* @param modifiedWidgets - The existing widget config objects to be saved.
|
|
988
|
+
* @param addedWidgets - The new widget config objects to be saved.
|
|
989
|
+
* @param removedWidgets - The widget config objects that have been removed.
|
|
990
|
+
* @param dashboardId - The id of the dashboard if present to allow dashboard specific storage.
|
|
991
|
+
* @returns An observable that emits the saved widget config objects with their ids.
|
|
982
992
|
*/
|
|
983
|
-
abstract save(
|
|
993
|
+
abstract save(modifiedWidgets: WidgetConfig[], addedWidgets: WidgetConfig[], removedWidgets?: WidgetConfig[], dashboardId?: string): Observable<WidgetConfig[]>;
|
|
984
994
|
/**
|
|
985
995
|
* Optional method to provide primary and secondary toolbar menu items.
|
|
986
996
|
* @param dashboardId - The id of the dashboard if present to allow dashboard specific menu items.
|
|
@@ -1020,11 +1030,62 @@ declare class SiDefaultWidgetStorage extends SiWidgetStorage {
|
|
|
1020
1030
|
private widgets?;
|
|
1021
1031
|
constructor();
|
|
1022
1032
|
load(dashboardId?: string): Observable<WidgetConfig[]>;
|
|
1023
|
-
save(
|
|
1024
|
-
protected update(
|
|
1033
|
+
save(modifiedWidgets: WidgetConfig[], addedWidgets: WidgetConfig[], removedWidgets?: WidgetConfig[], dashboardId?: string): Observable<WidgetConfig[]>;
|
|
1034
|
+
protected update(widgetConfigs: WidgetConfig[], dashboardId?: string): void;
|
|
1025
1035
|
protected loadFromStorage(dashboardId?: string): WidgetConfig[];
|
|
1026
1036
|
}
|
|
1027
1037
|
|
|
1038
|
+
/**
|
|
1039
|
+
* Copyright (c) Siemens 2016 - 2025
|
|
1040
|
+
* SPDX-License-Identifier: MIT
|
|
1041
|
+
*/
|
|
1042
|
+
|
|
1043
|
+
/**
|
|
1044
|
+
* Injection token to optionally inject the {@link SiWidgetIdProvider} implementation
|
|
1045
|
+
* to provide custom widget id generation logic. The default implementation
|
|
1046
|
+
* is {@link SiWidgetDefaultIdProvider}.
|
|
1047
|
+
*
|
|
1048
|
+
* * @example
|
|
1049
|
+
* The following shows how to provide your own widget id provider.
|
|
1050
|
+
* ```
|
|
1051
|
+
* providers: [..., { provide: SI_WIDGET_ID_PROVIDER, useClass: CustomWidgetIdProvider }]
|
|
1052
|
+
* ```
|
|
1053
|
+
*
|
|
1054
|
+
*/
|
|
1055
|
+
declare const SI_WIDGET_ID_PROVIDER: InjectionToken<SiWidgetIdProvider>;
|
|
1056
|
+
/**
|
|
1057
|
+
* Abstract class to provide widget id generation logic.
|
|
1058
|
+
*/
|
|
1059
|
+
declare abstract class SiWidgetIdProvider {
|
|
1060
|
+
/**
|
|
1061
|
+
* Generates a transient widget id for newly added widgets in edit mode.
|
|
1062
|
+
*
|
|
1063
|
+
* @param widget - The widget instance config without any id.
|
|
1064
|
+
* @param dashboardId - The id of the dashboard where the widget is added.
|
|
1065
|
+
* @returns A transient widget id as a string.
|
|
1066
|
+
*/
|
|
1067
|
+
abstract generateWidgetId(widget: Omit<WidgetConfig, 'id'>, dashboardId?: string): string;
|
|
1068
|
+
}
|
|
1069
|
+
/**
|
|
1070
|
+
* The default implementation of the {@link SiWidgetIdProvider} which
|
|
1071
|
+
* generates random widget ids.
|
|
1072
|
+
*/
|
|
1073
|
+
declare class SiWidgetDefaultIdProvider extends SiWidgetIdProvider {
|
|
1074
|
+
/**
|
|
1075
|
+
* Generates a unique widget id.
|
|
1076
|
+
*
|
|
1077
|
+
* The method uses `crypto.randomUUID()` which generates a RFC4122 version 4 UUID
|
|
1078
|
+
* (a cryptographically secure random identifier with 122 bits of entropy).
|
|
1079
|
+
*
|
|
1080
|
+
* @param widget - The widget instance config without any id.
|
|
1081
|
+
* @param dashboardId - The id of the dashboard where the widget is added.
|
|
1082
|
+
* @returns A unique widget id string in the format `crypto.randomUUID()`.
|
|
1083
|
+
*/
|
|
1084
|
+
generateWidgetId(widget: Omit<WidgetConfig, 'id'>, dashboardId?: string): string;
|
|
1085
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiWidgetDefaultIdProvider, never>;
|
|
1086
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<SiWidgetDefaultIdProvider>;
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1028
1089
|
/**
|
|
1029
1090
|
* Copyright (c) Siemens 2016 - 2025
|
|
1030
1091
|
* SPDX-License-Identifier: MIT
|
|
@@ -1042,37 +1103,11 @@ declare const widgetFactoryRegistry: {
|
|
|
1042
1103
|
declare const setupWidgetInstance: (widgetComponentFactory: WidgetComponentFactory, host: ViewContainerRef, injector: Injector, envInjector: EnvironmentInjector) => Observable<ComponentRef<WidgetInstance>>;
|
|
1043
1104
|
declare const setupWidgetEditor: (widgetComponentFactory: WidgetComponentFactory, host: ViewContainerRef, injector: Injector, envInjector: EnvironmentInjector) => Observable<ComponentRef<WidgetInstanceEditor>>;
|
|
1044
1105
|
|
|
1045
|
-
/**
|
|
1046
|
-
* Copyright (c) Siemens 2016 - 2025
|
|
1047
|
-
* SPDX-License-Identifier: MIT
|
|
1048
|
-
*/
|
|
1049
|
-
|
|
1050
1106
|
declare class SiDashboardsNgModule {
|
|
1051
|
-
/**
|
|
1052
|
-
* @deprecated The module configuration `forRoot` is not needed any more. You can use the injection tokens
|
|
1053
|
-
* `SI_DASHBOARD_CONFIGURATION` and `SI_WIDGET_STORE` direct in your app configuration. We migrated to standalone
|
|
1054
|
-
* components already and will delete this module definition later.
|
|
1055
|
-
*/
|
|
1056
|
-
static forRoot({ config, dashboardApi }: {
|
|
1057
|
-
config?: Config;
|
|
1058
|
-
/**
|
|
1059
|
-
* Provide a custom widget storage.
|
|
1060
|
-
*
|
|
1061
|
-
* @deprecated Use the provider tokens in your app config instead.
|
|
1062
|
-
*
|
|
1063
|
-
* @example
|
|
1064
|
-
* ```typescript
|
|
1065
|
-
* const appConfig: ApplicationConfig = {
|
|
1066
|
-
* providers: [{provide: SI_WIDGET_STORE, useClass: YourWidgetStorage}]
|
|
1067
|
-
* }
|
|
1068
|
-
* ```
|
|
1069
|
-
*/
|
|
1070
|
-
dashboardApi?: Provider;
|
|
1071
|
-
}): ModuleWithProviders<SiDashboardsNgModule>;
|
|
1072
1107
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiDashboardsNgModule, never>;
|
|
1073
1108
|
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<SiDashboardsNgModule, never, [typeof SiFlexibleDashboardComponent, typeof SiGridComponent, typeof SiWidgetCatalogComponent, typeof SiWidgetInstanceEditorDialogComponent], [typeof SiFlexibleDashboardComponent, typeof SiGridComponent, typeof SiWidgetCatalogComponent, typeof SiWidgetInstanceEditorDialogComponent]>;
|
|
1074
1109
|
static ɵinj: _angular_core.ɵɵInjectorDeclaration<SiDashboardsNgModule>;
|
|
1075
1110
|
}
|
|
1076
1111
|
|
|
1077
|
-
export {
|
|
1078
|
-
export type { Config, DashboardToolbarItem, DashboardToolbarItemAction, DashboardToolbarItemLink, DashboardToolbarItemRouterLink, FederatedModule, GridConfig, LoadRemoteModuleEsmOptions, LoadRemoteModuleManifestOptions, LoadRemoteModuleOptions, LoadRemoteModuleScriptOptions, ObjectFit, SetupComponentFn, WebComponent, Widget, WidgetComponentFactory, WidgetComponentTypeFactory, WidgetConfig, WidgetConfigEvent, WidgetConfigStatus, WidgetImage, WidgetInstance, WidgetInstanceEditor, WidgetInstanceEditorWizard, WidgetInstanceEditorWizardState, WidgetPositionConfig };
|
|
1112
|
+
export { DEFAULT_GRIDSTACK_OPTIONS, DEFAULT_WIDGET_STORAGE_TOKEN, SI_DASHBOARD_CONFIGURATION, SI_WIDGET_ID_PROVIDER, SI_WIDGET_STORE, STORAGE_KEY, SiDashboardsNgModule, SiDefaultWidgetStorage, SiFlexibleDashboardComponent, SiGridComponent, SiWidgetCatalogComponent, SiWidgetDefaultIdProvider, SiWidgetIdProvider, SiWidgetInstanceEditorDialogComponent, SiWidgetStorage, SiDashboardsNgModule as SimplDashboardsNgModule, createWidgetConfig, setupWidgetEditor, setupWidgetInstance, widgetFactoryRegistry };
|
|
1113
|
+
export type { Config, DashboardToolbarItem, DashboardToolbarItemAction, DashboardToolbarItemLink, DashboardToolbarItemRouterLink, FederatedBridgeModule, FederatedModule, GridConfig, LoadRemoteBridgeOptions, LoadRemoteModuleEsmOptions, LoadRemoteModuleManifestOptions, LoadRemoteModuleOptions, LoadRemoteModuleScriptOptions, ObjectFit, SetupComponentFn, WebComponent, Widget, WidgetComponentFactory, WidgetComponentTypeFactory, WidgetConfig, WidgetConfigEvent, WidgetConfigStatus, WidgetImage, WidgetInstance, WidgetInstanceEditor, WidgetInstanceEditorWizard, WidgetInstanceEditorWizardState, WidgetPositionConfig };
|
/package/{module-federation/index.d.ts → types/siemens-dashboards-ng-module-federation.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|