@spike-rabbit/dashboards-ng 49.0.0 → 49.13.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/LICENSE.md +1 -1
- package/README.md +190 -44
- package/fesm2022/spike-rabbit-dashboards-ng-module-federation.mjs +15 -22
- package/fesm2022/spike-rabbit-dashboards-ng-module-federation.mjs.map +1 -1
- package/fesm2022/spike-rabbit-dashboards-ng-native-federation-mf-bridge.mjs +31 -0
- package/fesm2022/spike-rabbit-dashboards-ng-native-federation-mf-bridge.mjs.map +1 -0
- package/fesm2022/spike-rabbit-dashboards-ng-native-federation.mjs +30 -0
- package/fesm2022/spike-rabbit-dashboards-ng-native-federation.mjs.map +1 -0
- package/fesm2022/spike-rabbit-dashboards-ng-translate.mjs +1 -1
- package/fesm2022/spike-rabbit-dashboards-ng-translate.mjs.map +1 -1
- package/fesm2022/spike-rabbit-dashboards-ng.mjs +936 -712
- package/fesm2022/spike-rabbit-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 +40 -16
- package/translate/package.json +2 -1
- package/types/spike-rabbit-dashboards-ng-native-federation-mf-bridge.d.ts +9 -0
- package/types/spike-rabbit-dashboards-ng-native-federation.d.ts +3 -0
- package/{translate/index.d.ts → types/spike-rabbit-dashboards-ng-translate.d.ts} +8 -1
- package/{index.d.ts → types/spike-rabbit-dashboards-ng.d.ts} +337 -189
- package/template-i18n.json +0 -35
- /package/{module-federation/index.d.ts → types/spike-rabbit-dashboards-ng-module-federation.d.ts} +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import * as _spike_rabbit_element_translate_ng_translate from '@spike-rabbit/element-translate-ng/translate';
|
|
2
|
+
import { TranslatableString } from '@spike-rabbit/element-translate-ng/translate';
|
|
1
3
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import {
|
|
4
|
+
import { Type, InputSignal, OutputEmitterRef, EventEmitter, TemplateRef, OnInit, OnChanges, SimpleChanges, OnDestroy, OutputRefSubscription, ViewContainerRef, Injector, EnvironmentInjector, ComponentRef, InjectionToken, Provider } from '@angular/core';
|
|
3
5
|
import { AccentLineType, MenuItem } from '@spike-rabbit/element-ng/common';
|
|
4
6
|
import { SiDashboardComponent } from '@spike-rabbit/element-ng/dashboard';
|
|
5
|
-
import { Subject,
|
|
7
|
+
import { Subject, Subscription, Observable, BehaviorSubject } from 'rxjs';
|
|
6
8
|
import { GridStackOptions, GridStackNode, GridStack, GridItemHTMLElement } from 'gridstack';
|
|
7
9
|
import { NavigationExtras } from '@angular/router';
|
|
8
|
-
import { TranslatableString } from '@spike-rabbit/element-translate-ng/translate';
|
|
9
|
-
import { SiLoadingService } from '@spike-rabbit/element-ng/loading-spinner';
|
|
10
10
|
import { ViewType, ContentActionBarMainItem } from '@spike-rabbit/element-ng/content-action-bar';
|
|
11
11
|
import { MenuItem as MenuItem$1 } from '@spike-rabbit/element-ng/menu';
|
|
12
12
|
export * from '@spike-rabbit/dashboards-ng/translate';
|
|
@@ -27,29 +27,7 @@ interface GridConfig {
|
|
|
27
27
|
declare const DEFAULT_GRIDSTACK_OPTIONS: GridStackOptions;
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
|
-
* Copyright (c) Siemens 2016 -
|
|
31
|
-
* SPDX-License-Identifier: MIT
|
|
32
|
-
*/
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Dashboard configuration object. Inject globally using the {@link SI_DASHBOARD_CONFIGURATION}
|
|
36
|
-
* or configure individual dashboard instances.
|
|
37
|
-
*/
|
|
38
|
-
type Config = {
|
|
39
|
-
grid?: GridConfig;
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* Injection token to configure dashboards. Use `{ provide: SI_DASHBOARD_CONFIGURATION, useValue: config }`
|
|
43
|
-
* in your app configuration.
|
|
44
|
-
*/
|
|
45
|
-
declare const SI_DASHBOARD_CONFIGURATION: InjectionToken<Config>;
|
|
46
|
-
/**
|
|
47
|
-
* @deprecated Use SI_DASHBOARD_CONFIGURATION instead.
|
|
48
|
-
*/
|
|
49
|
-
declare const CONFIG_TOKEN: InjectionToken<Config>;
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Copyright (c) Siemens 2016 - 2025
|
|
30
|
+
* Copyright (c) Siemens 2016 - 2026
|
|
53
31
|
* SPDX-License-Identifier: MIT
|
|
54
32
|
*/
|
|
55
33
|
|
|
@@ -64,9 +42,9 @@ interface Widget {
|
|
|
64
42
|
/** An optional version string. */
|
|
65
43
|
version?: string;
|
|
66
44
|
/** The name of the widget that is presented in the widget catalog. */
|
|
67
|
-
name:
|
|
45
|
+
name: TranslatableString;
|
|
68
46
|
/** An optional description that is visible in the widget catalog. */
|
|
69
|
-
description?:
|
|
47
|
+
description?: TranslatableString;
|
|
70
48
|
/** A CSS icon class that specifies the widget icon, displayed in the catalog. */
|
|
71
49
|
iconClass?: string;
|
|
72
50
|
/** The factory to instantiate a widget instance component that is added to the dashboard. */
|
|
@@ -76,8 +54,8 @@ interface Widget {
|
|
|
76
54
|
/** Optional default payload object that is copied into every widget instance {@link WidgetConfig}. */
|
|
77
55
|
payload?: any;
|
|
78
56
|
}
|
|
79
|
-
/** Factory type that is either a {@link WidgetComponentTypeFactory}, {@link FederatedModule} or {@link WebComponent}. */
|
|
80
|
-
type WidgetComponentFactory = WidgetComponentTypeFactory | FederatedModule | WebComponent;
|
|
57
|
+
/** Factory type that is either a {@link WidgetComponentTypeFactory}, {@link FederatedModule}, {@link FederatedBridgeModule} or {@link WebComponent}. */
|
|
58
|
+
type WidgetComponentFactory = WidgetComponentTypeFactory | FederatedModule | WebComponent | FederatedBridgeModule;
|
|
81
59
|
type CommonFactoryFields = {
|
|
82
60
|
componentName: string;
|
|
83
61
|
editorComponentName?: string;
|
|
@@ -87,14 +65,37 @@ type CommonFactoryFields = {
|
|
|
87
65
|
*/
|
|
88
66
|
editorModalClass?: string;
|
|
89
67
|
};
|
|
90
|
-
type
|
|
68
|
+
type WidgetComponentTypeBaseConfig = {
|
|
91
69
|
factoryType?: 'default';
|
|
70
|
+
[index: string]: any;
|
|
71
|
+
};
|
|
72
|
+
/** Use when component is not standalone and part of a module */
|
|
73
|
+
type ModuleOptions = WidgetComponentTypeBaseConfig & {
|
|
92
74
|
moduleName: string;
|
|
93
75
|
moduleLoader: (name: string) => Promise<any>;
|
|
94
|
-
|
|
76
|
+
componentLoader?: never;
|
|
95
77
|
};
|
|
78
|
+
/** Use when component is standalone */
|
|
79
|
+
type StandaloneOptions = WidgetComponentTypeBaseConfig & {
|
|
80
|
+
componentLoader: <T = unknown>(componentName: string) => Promise<Type<T>>;
|
|
81
|
+
moduleName?: never;
|
|
82
|
+
moduleLoader?: never;
|
|
83
|
+
};
|
|
84
|
+
type WidgetComponentTypeFactory = CommonFactoryFields & (ModuleOptions | StandaloneOptions);
|
|
85
|
+
/**
|
|
86
|
+
* Factory configuration for loading widget components from a federated module.
|
|
87
|
+
* Supports both Module Federation and Native Federation patterns for micro-frontend architectures.
|
|
88
|
+
* Use this when the widget component is hosted in a separate, independently deployed application.
|
|
89
|
+
*/
|
|
96
90
|
type FederatedModule = CommonFactoryFields & LoadRemoteModuleOptions & {
|
|
97
|
-
factoryType: 'module-federation';
|
|
91
|
+
factoryType: 'module-federation' | 'native-federation';
|
|
92
|
+
[index: string]: any;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Use this when having native federation shell and remote module is using module federation.
|
|
96
|
+
*/
|
|
97
|
+
type FederatedBridgeModule = CommonFactoryFields & LoadRemoteBridgeOptions & {
|
|
98
|
+
factoryType: 'native-federation-module-bridge';
|
|
98
99
|
[index: string]: any;
|
|
99
100
|
};
|
|
100
101
|
type WebComponent = CommonFactoryFields & {
|
|
@@ -176,7 +177,7 @@ interface WidgetConfig {
|
|
|
176
177
|
/**
|
|
177
178
|
* grid item header text.
|
|
178
179
|
*/
|
|
179
|
-
heading?:
|
|
180
|
+
heading?: TranslatableString;
|
|
180
181
|
/** Defines whether the widget instance component can be expanded and enlarged over the dashboard. */
|
|
181
182
|
expandable?: boolean;
|
|
182
183
|
/** A widget specific payload object. Placeholder to pass in additional configuration. */
|
|
@@ -184,13 +185,6 @@ interface WidgetConfig {
|
|
|
184
185
|
actionBarViewType?: ViewType;
|
|
185
186
|
isNotRemovable?: boolean;
|
|
186
187
|
immutable?: boolean;
|
|
187
|
-
/**
|
|
188
|
-
* Widget instance editor components can use this property to indicate an invalid configuration.
|
|
189
|
-
* True if the config is invalid. False, undefined or null indicate a valid configuration.
|
|
190
|
-
*
|
|
191
|
-
* @deprecated Use the statusChanges emitter to notify about configuration status changes.
|
|
192
|
-
*/
|
|
193
|
-
invalid?: boolean;
|
|
194
188
|
/**
|
|
195
189
|
* Optional configuration for an image to be displayed on the widget instance.
|
|
196
190
|
*/
|
|
@@ -343,11 +337,27 @@ declare const createWidgetConfig: (widget: Widget) => Omit<WidgetConfig, "id">;
|
|
|
343
337
|
* We take it over into this file to prevent adding a hard dependency.
|
|
344
338
|
*/
|
|
345
339
|
type LoadRemoteModuleOptions = LoadRemoteModuleScriptOptions | LoadRemoteModuleEsmOptions | LoadRemoteModuleManifestOptions;
|
|
340
|
+
/**
|
|
341
|
+
* Definition is based on `@module-federation/enhanced` loadRemote options.
|
|
342
|
+
* We take it over into this file to prevent adding a hard dependency.
|
|
343
|
+
*/
|
|
344
|
+
type LoadRemoteBridgeOptions = {
|
|
345
|
+
id: string;
|
|
346
|
+
options?: {
|
|
347
|
+
loadFactory?: boolean | undefined;
|
|
348
|
+
from: 'build' | 'runtime';
|
|
349
|
+
} | undefined;
|
|
350
|
+
};
|
|
346
351
|
type LoadRemoteModuleScriptOptions = {
|
|
347
352
|
type?: 'script';
|
|
348
353
|
remoteEntry?: string;
|
|
349
354
|
remoteName: string;
|
|
350
355
|
exposedModule: string;
|
|
356
|
+
/**
|
|
357
|
+
* Optional nonce value applied to the script element for Content Security Policy (CSP) support.
|
|
358
|
+
* Supported in Module Federation v21.2.0+; safely ignored by earlier versions.
|
|
359
|
+
*/
|
|
360
|
+
nonce?: string;
|
|
351
361
|
};
|
|
352
362
|
type LoadRemoteModuleEsmOptions = {
|
|
353
363
|
type: 'module';
|
|
@@ -366,7 +376,7 @@ interface GridWrapperEvent {
|
|
|
366
376
|
grid: GridStack;
|
|
367
377
|
el?: GridItemHTMLElement;
|
|
368
378
|
}
|
|
369
|
-
declare class SiGridstackWrapperComponent implements OnInit, OnChanges
|
|
379
|
+
declare class SiGridstackWrapperComponent implements OnInit, OnChanges {
|
|
370
380
|
/**
|
|
371
381
|
* Grid items to render inside the gridstack
|
|
372
382
|
*
|
|
@@ -383,6 +393,14 @@ declare class SiGridstackWrapperComponent implements OnInit, OnChanges, OnDestro
|
|
|
383
393
|
* Module configuration
|
|
384
394
|
*/
|
|
385
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
|
+
}>>;
|
|
386
404
|
/**
|
|
387
405
|
* Emits dashboard grid events.
|
|
388
406
|
*/
|
|
@@ -395,31 +413,53 @@ declare class SiGridstackWrapperComponent implements OnInit, OnChanges, OnDestro
|
|
|
395
413
|
* Emits the id of a widget instance that shall be edited.
|
|
396
414
|
*/
|
|
397
415
|
readonly widgetInstanceEdit: _angular_core.OutputEmitterRef<WidgetConfig>;
|
|
398
|
-
readonly
|
|
399
|
-
private
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
private readonly
|
|
403
|
-
private
|
|
404
|
-
private
|
|
405
|
-
private
|
|
406
|
-
|
|
416
|
+
private readonly widgetHosts;
|
|
417
|
+
private readonly widgetHostsMap;
|
|
418
|
+
protected readonly a11yWidgetsListLabel: _spike_rabbit_element_translate_ng_translate.TranslatableString;
|
|
419
|
+
protected grid?: GridStack;
|
|
420
|
+
private readonly ngZone;
|
|
421
|
+
private readonly elementRef;
|
|
422
|
+
private readonly injector;
|
|
423
|
+
private readonly platformId;
|
|
424
|
+
private readonly isBrowser;
|
|
425
|
+
private readonly destroyRef;
|
|
426
|
+
ngOnChanges(changes: SimpleChanges<this>): void;
|
|
407
427
|
ngOnInit(): void;
|
|
408
|
-
|
|
409
|
-
mount(items: WidgetConfig[]): void;
|
|
410
|
-
unmount(items: WidgetConfig[]): void;
|
|
411
|
-
getLayout(): WidgetPositionConfig[];
|
|
412
|
-
private updateLayout;
|
|
413
|
-
private addToView;
|
|
414
|
-
private removeFromView;
|
|
428
|
+
private startBatch;
|
|
415
429
|
/**
|
|
416
|
-
*
|
|
417
|
-
*
|
|
430
|
+
*
|
|
431
|
+
* Returns the position of a specific widget in the grid.
|
|
418
432
|
*/
|
|
419
|
-
|
|
433
|
+
getWidgetLayout(widgetId: string): WidgetPositionConfig | undefined;
|
|
420
434
|
private hookEvents;
|
|
421
435
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiGridstackWrapperComponent, never>;
|
|
422
|
-
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>;
|
|
436
|
+
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>;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* Base class encapsulating common widget editor lifecycle management.
|
|
441
|
+
* Both `SiWidgetCatalogComponent` and `SiWidgetInstanceEditorDialogComponent`
|
|
442
|
+
* extend this class to share editor setup, teardown, and status handling logic.
|
|
443
|
+
*/
|
|
444
|
+
declare abstract class SiWidgetEditorBase implements OnDestroy {
|
|
445
|
+
/** Indicates if the current config is valid or not. */
|
|
446
|
+
protected readonly invalidConfig: _angular_core.WritableSignal<boolean>;
|
|
447
|
+
/** Marks the widget configuration as modified. */
|
|
448
|
+
protected readonly widgetConfigModified: _angular_core.WritableSignal<boolean>;
|
|
449
|
+
protected readonly editorWizardState: _angular_core.WritableSignal<WidgetInstanceEditorWizardState | undefined>;
|
|
450
|
+
protected widgetInstanceEditor?: WidgetInstanceEditor;
|
|
451
|
+
protected subscriptions: (Subscription | OutputRefSubscription)[];
|
|
452
|
+
protected readonly editorHost: _angular_core.Signal<ViewContainerRef>;
|
|
453
|
+
protected injector: Injector;
|
|
454
|
+
protected envInjector: EnvironmentInjector;
|
|
455
|
+
ngOnDestroy(): void;
|
|
456
|
+
protected loadWidgetEditor(widgetComponentFactory: WidgetComponentFactory, host: ViewContainerRef): Observable<ComponentRef<WidgetInstanceEditor>>;
|
|
457
|
+
protected initializeEditor(componentRef: ComponentRef<WidgetInstanceEditor>, config: WidgetConfig | Omit<WidgetConfig, 'id'>): void;
|
|
458
|
+
protected tearDownEditor(): void;
|
|
459
|
+
protected isEditorWizard(editor?: WidgetInstanceEditor | WidgetInstanceEditorWizard): editor is WidgetInstanceEditorWizard;
|
|
460
|
+
protected handleStatusChanges(statusChanges: Partial<WidgetConfigStatus>): void;
|
|
461
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiWidgetEditorBase, never>;
|
|
462
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SiWidgetEditorBase, never, never, {}, {}, never, never, true, never>;
|
|
423
463
|
}
|
|
424
464
|
|
|
425
465
|
/**
|
|
@@ -428,7 +468,7 @@ declare class SiGridstackWrapperComponent implements OnInit, OnChanges, OnDestro
|
|
|
428
468
|
* into its content. The dialog component is accountable for interacting with the dashboard
|
|
429
469
|
* and offers options for saving changes or terminating the editing process.
|
|
430
470
|
*/
|
|
431
|
-
declare class SiWidgetInstanceEditorDialogComponent implements OnInit
|
|
471
|
+
declare class SiWidgetInstanceEditorDialogComponent extends SiWidgetEditorBase implements OnInit {
|
|
432
472
|
/**
|
|
433
473
|
* Input for the widget instance configuration. It is used to populate the
|
|
434
474
|
* widget editor.
|
|
@@ -448,57 +488,38 @@ declare class SiWidgetInstanceEditorDialogComponent implements OnInit, OnDestroy
|
|
|
448
488
|
* Emits when the editor instantiation is completed.
|
|
449
489
|
*/
|
|
450
490
|
readonly editorSetupCompleted: _angular_core.OutputEmitterRef<void>;
|
|
451
|
-
protected readonly editorHost: _angular_core.Signal<ViewContainerRef>;
|
|
452
|
-
/** Indicates if the current config is valid or not. If invalid, the save button will be disabled. */
|
|
453
|
-
protected readonly invalidConfig: _angular_core.WritableSignal<boolean>;
|
|
454
491
|
protected readonly showNextButton: _angular_core.Signal<boolean>;
|
|
455
492
|
protected readonly disableNextButton: _angular_core.Signal<boolean>;
|
|
456
493
|
protected readonly showPreviousButton: _angular_core.Signal<boolean>;
|
|
457
494
|
protected readonly disablePreviousButton: _angular_core.Signal<boolean>;
|
|
458
|
-
protected labelSave:
|
|
459
|
-
protected labelCancel:
|
|
460
|
-
protected labelPrevious:
|
|
461
|
-
protected labelNext:
|
|
462
|
-
protected labelDialogMessage:
|
|
463
|
-
protected labelDialogHeading:
|
|
464
|
-
protected labelDialogSave:
|
|
465
|
-
protected labelDialogDiscard:
|
|
466
|
-
protected labelDialogCancel:
|
|
467
|
-
/**
|
|
468
|
-
* Marks the widget configuration as modified. Is set when widget editor instance
|
|
469
|
-
* emits configChange events. Triggers edit discard confirmation dialog when widget config
|
|
470
|
-
* is modified but not dialog is canceled.
|
|
471
|
-
* */
|
|
472
|
-
private readonly widgetConfigModified;
|
|
473
|
-
private widgetInstanceEditor?;
|
|
474
|
-
private readonly editorWizardState;
|
|
475
|
-
private subscriptions;
|
|
476
|
-
private injector;
|
|
477
|
-
private envInjector;
|
|
495
|
+
protected labelSave: _spike_rabbit_element_translate_ng_translate.TranslatableString;
|
|
496
|
+
protected labelCancel: _spike_rabbit_element_translate_ng_translate.TranslatableString;
|
|
497
|
+
protected labelPrevious: _spike_rabbit_element_translate_ng_translate.TranslatableString;
|
|
498
|
+
protected labelNext: _spike_rabbit_element_translate_ng_translate.TranslatableString;
|
|
499
|
+
protected labelDialogMessage: _spike_rabbit_element_translate_ng_translate.TranslatableString;
|
|
500
|
+
protected labelDialogHeading: _spike_rabbit_element_translate_ng_translate.TranslatableString;
|
|
501
|
+
protected labelDialogSave: _spike_rabbit_element_translate_ng_translate.TranslatableString;
|
|
502
|
+
protected labelDialogDiscard: _spike_rabbit_element_translate_ng_translate.TranslatableString;
|
|
503
|
+
protected labelDialogCancel: _spike_rabbit_element_translate_ng_translate.TranslatableString;
|
|
478
504
|
private dialogService;
|
|
479
505
|
ngOnInit(): void;
|
|
480
|
-
ngOnDestroy(): void;
|
|
481
506
|
protected onCancel(): void;
|
|
482
507
|
protected onNext(): void;
|
|
483
508
|
protected onPrevious(): void;
|
|
484
509
|
protected onSave(): void;
|
|
485
|
-
private tearDownEditor;
|
|
486
|
-
private isEditorWizdard;
|
|
487
|
-
private handleStatusChanges;
|
|
488
510
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiWidgetInstanceEditorDialogComponent, never>;
|
|
489
511
|
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>;
|
|
490
512
|
}
|
|
491
513
|
|
|
492
|
-
declare const NEW_WIDGET_PREFIX = "new-widget-";
|
|
493
514
|
/**
|
|
494
515
|
* The grid component is the actual component on which the widget instances are placed and visualized. You can think of
|
|
495
516
|
* a headless dashboard, without a title, toolbar or edit buttons.
|
|
496
517
|
*/
|
|
497
518
|
declare class SiGridComponent implements OnInit, OnChanges, OnDestroy {
|
|
498
519
|
private storeSubscription?;
|
|
499
|
-
private gridService;
|
|
500
520
|
private modalService;
|
|
501
521
|
private widgetStorage;
|
|
522
|
+
private widgetIdProvider;
|
|
502
523
|
/**
|
|
503
524
|
* Configuration options for a grid instance. Default is the optional
|
|
504
525
|
* value from the {@link SI_DASHBOARD_CONFIGURATION}.
|
|
@@ -513,14 +534,6 @@ declare class SiGridComponent implements OnInit, OnChanges, OnDestroy {
|
|
|
513
534
|
* @defaultValue false
|
|
514
535
|
*/
|
|
515
536
|
readonly editable: _angular_core.ModelSignal<boolean>;
|
|
516
|
-
/**
|
|
517
|
-
* This is the internal owner of the current editable state and is used to track if
|
|
518
|
-
* editable or not. Not editable can be changed by either calling the `edit()` api
|
|
519
|
-
* method or by setting the `editable` input. When setting the input, the `ngOnChanges(...)`
|
|
520
|
-
* hook is used to call the `edit()` method. Similar, to get from editable to not editable,
|
|
521
|
-
* `cancel()` or `save()` is used and can be triggered from `ngOnChanges(...)`.
|
|
522
|
-
*/
|
|
523
|
-
private editableInternal;
|
|
524
537
|
/**
|
|
525
538
|
* An optional, but recommended dashboard id that is used in persistence and passed
|
|
526
539
|
* to the widget store for saving and loading data.
|
|
@@ -533,6 +546,7 @@ declare class SiGridComponent implements OnInit, OnChanges, OnDestroy {
|
|
|
533
546
|
*
|
|
534
547
|
* @defaultValue [] */
|
|
535
548
|
readonly widgetCatalog: _angular_core.InputSignal<Widget[]>;
|
|
549
|
+
protected readonly widgetCatalogMap: _angular_core.Signal<Map<string, Widget>>;
|
|
536
550
|
/**
|
|
537
551
|
* When the user clicks edit on a widget instance, an editor need to appear and the
|
|
538
552
|
* widget editor component need to be loaded. When the grid is used standalone, it
|
|
@@ -605,20 +619,13 @@ declare class SiGridComponent implements OnInit, OnChanges, OnDestroy {
|
|
|
605
619
|
markedForRemoval: WidgetConfig[];
|
|
606
620
|
/** @defaultValue viewChild.required(SiGridstackWrapperComponent) */
|
|
607
621
|
readonly gridStackWrapper: _angular_core.Signal<SiGridstackWrapperComponent>;
|
|
608
|
-
/**
|
|
609
|
-
* Service used to indicate load and save indication.
|
|
610
|
-
* @deprecated Use `isLoading` instead.
|
|
611
|
-
*
|
|
612
|
-
* @defaultValue inject(SiLoadingService)
|
|
613
|
-
*/
|
|
614
|
-
loadingService: SiLoadingService;
|
|
615
622
|
/**
|
|
616
623
|
* Indication for load and save operations.
|
|
617
624
|
*/
|
|
618
625
|
readonly isLoading: BehaviorSubject<boolean>;
|
|
619
626
|
protected initialLoad: boolean;
|
|
620
627
|
protected get showEmptyState(): boolean;
|
|
621
|
-
ngOnChanges(changes: SimpleChanges): void;
|
|
628
|
+
ngOnChanges(changes: SimpleChanges<this>): void;
|
|
622
629
|
ngOnInit(): void;
|
|
623
630
|
ngOnDestroy(): void;
|
|
624
631
|
/**
|
|
@@ -666,13 +673,15 @@ declare class SiGridComponent implements OnInit, OnChanges, OnDestroy {
|
|
|
666
673
|
protected handleGridEvent(event: GridWrapperEvent): void;
|
|
667
674
|
private loadAndSubscribeWidgets;
|
|
668
675
|
private updateWidgetPositions;
|
|
676
|
+
private resetEditState;
|
|
677
|
+
private restoreSavedState;
|
|
669
678
|
private setModified;
|
|
670
679
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiGridComponent, never>;
|
|
671
680
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SiGridComponent, "si-grid", never, { "gridConfig": { "alias": "gridConfig"; "required": false; "isSignal": true; }; "editable": { "alias": "editable"; "required": false; "isSignal": true; }; "dashboardId": { "alias": "dashboardId"; "required": false; "isSignal": true; }; "widgetCatalog": { "alias": "widgetCatalog"; "required": false; "isSignal": true; }; "emitWidgetInstanceEditEvents": { "alias": "emitWidgetInstanceEditEvents"; "required": false; "isSignal": true; }; "hideProgressIndicator": { "alias": "hideProgressIndicator"; "required": false; "isSignal": true; }; "widgetInstanceEditorDialogComponent": { "alias": "widgetInstanceEditorDialogComponent"; "required": false; "isSignal": true; }; }, { "editable": "editableChange"; "isModified": "isModified"; "widgetInstanceEdit": "widgetInstanceEdit"; }, never, ["[empty-state]"], true, never>;
|
|
672
681
|
}
|
|
673
682
|
|
|
674
683
|
/**
|
|
675
|
-
* Copyright (c) Siemens 2016 -
|
|
684
|
+
* Copyright (c) Siemens 2016 - 2026
|
|
676
685
|
* SPDX-License-Identifier: MIT
|
|
677
686
|
*/
|
|
678
687
|
|
|
@@ -707,13 +716,47 @@ interface DashboardToolbarItemLink {
|
|
|
707
716
|
/** Union type for all possible items in the dashboard toolbar. */
|
|
708
717
|
type DashboardToolbarItem = DashboardToolbarItemAction | DashboardToolbarItemRouterLink | DashboardToolbarItemLink;
|
|
709
718
|
|
|
719
|
+
/**
|
|
720
|
+
* Copyright (c) Siemens 2016 - 2026
|
|
721
|
+
* SPDX-License-Identifier: MIT
|
|
722
|
+
*/
|
|
723
|
+
|
|
724
|
+
/**
|
|
725
|
+
* Dashboard configuration object. Inject globally using the {@link SI_DASHBOARD_CONFIGURATION}
|
|
726
|
+
* or configure individual dashboard instances.
|
|
727
|
+
*/
|
|
728
|
+
type Config = {
|
|
729
|
+
grid?: GridConfig;
|
|
730
|
+
};
|
|
731
|
+
/**
|
|
732
|
+
* Injection token to configure dashboards. Use `{ provide: SI_DASHBOARD_CONFIGURATION, useValue: config }`
|
|
733
|
+
* in your app configuration.
|
|
734
|
+
*/
|
|
735
|
+
declare const SI_DASHBOARD_CONFIGURATION: InjectionToken<Config>;
|
|
736
|
+
/**
|
|
737
|
+
* Injection token to configure global toolbar menu items.
|
|
738
|
+
*/
|
|
739
|
+
declare const SI_DASHBOARD_TOOLBAR_ITEMS: InjectionToken<{
|
|
740
|
+
primary: DashboardToolbarItem[];
|
|
741
|
+
secondary: DashboardToolbarItem[];
|
|
742
|
+
}>;
|
|
743
|
+
/**
|
|
744
|
+
* provider function to configure global toolbar menu items.
|
|
745
|
+
* @param toolbarItems - primary and secondary edit actions which are common to all
|
|
746
|
+
* dashboard instances on application.
|
|
747
|
+
*/
|
|
748
|
+
declare const provideDashboardToolbarItems: (toolbarItems?: {
|
|
749
|
+
primary?: DashboardToolbarItem[];
|
|
750
|
+
secondary?: DashboardToolbarItem[];
|
|
751
|
+
}) => Provider;
|
|
752
|
+
|
|
710
753
|
/**
|
|
711
754
|
* Default widget catalog implementation to show all available widgets that can be added
|
|
712
755
|
* to a dashboard. It consists of a list view, that lists all available widgets and after
|
|
713
756
|
* selection, a host in which the widget specific editor is loaded. Applications can either
|
|
714
757
|
* stay with the default catalog or implement their own by extending this class.
|
|
715
758
|
*/
|
|
716
|
-
declare class SiWidgetCatalogComponent implements OnInit
|
|
759
|
+
declare class SiWidgetCatalogComponent extends SiWidgetEditorBase implements OnInit {
|
|
717
760
|
/**
|
|
718
761
|
* Placeholder text for the search input field in the widget catalog.
|
|
719
762
|
*
|
|
@@ -722,7 +765,7 @@ declare class SiWidgetCatalogComponent implements OnInit, OnDestroy {
|
|
|
722
765
|
* t(() => $localize`:@@DASHBOARD.WIDGET_LIBRARY.SEARCH_PLACEHOLDER:Search widget`)
|
|
723
766
|
* ```
|
|
724
767
|
*/
|
|
725
|
-
readonly searchPlaceholder: _angular_core.InputSignal<
|
|
768
|
+
readonly searchPlaceholder: _angular_core.InputSignal<_spike_rabbit_element_translate_ng_translate.TranslatableString>;
|
|
726
769
|
/**
|
|
727
770
|
* Emits when the catalog is `closed`, either by canceling or by adding or saving
|
|
728
771
|
* a widget configuration. On cancel `undefined` is emitted, otherwise the related
|
|
@@ -736,7 +779,6 @@ declare class SiWidgetCatalogComponent implements OnInit, OnDestroy {
|
|
|
736
779
|
* @defaultValue 'list'
|
|
737
780
|
*/
|
|
738
781
|
readonly view: _angular_core.WritableSignal<"list" | "editor" | "editor-only">;
|
|
739
|
-
protected readonly editorHost: _angular_core.Signal<ViewContainerRef>;
|
|
740
782
|
/**
|
|
741
783
|
* Property to provide the available widgets to the catalog. The flexible
|
|
742
784
|
* dashboard creates the catalog by Angular's `createComponent()` method
|
|
@@ -756,48 +798,33 @@ declare class SiWidgetCatalogComponent implements OnInit, OnDestroy {
|
|
|
756
798
|
protected readonly selected: _angular_core.WritableSignal<Widget | undefined>;
|
|
757
799
|
private widgetConfig?;
|
|
758
800
|
private readonly hasEditor;
|
|
759
|
-
|
|
760
|
-
protected
|
|
761
|
-
protected
|
|
762
|
-
protected
|
|
763
|
-
protected
|
|
764
|
-
protected
|
|
765
|
-
protected
|
|
766
|
-
protected
|
|
767
|
-
protected
|
|
801
|
+
private readonly translateService;
|
|
802
|
+
protected labelCancel: _spike_rabbit_element_translate_ng_translate.TranslatableString;
|
|
803
|
+
protected labelPrevious: _spike_rabbit_element_translate_ng_translate.TranslatableString;
|
|
804
|
+
protected labelNext: _spike_rabbit_element_translate_ng_translate.TranslatableString;
|
|
805
|
+
protected labelAdd: _spike_rabbit_element_translate_ng_translate.TranslatableString;
|
|
806
|
+
protected labelEmpty: _spike_rabbit_element_translate_ng_translate.TranslatableString;
|
|
807
|
+
protected labelDialogHeading: _spike_rabbit_element_translate_ng_translate.TranslatableString;
|
|
808
|
+
protected labelDialogCancel: _spike_rabbit_element_translate_ng_translate.TranslatableString;
|
|
809
|
+
protected labelDialogMessage: _spike_rabbit_element_translate_ng_translate.TranslatableString;
|
|
810
|
+
protected labelDialogDiscard: _spike_rabbit_element_translate_ng_translate.TranslatableString;
|
|
811
|
+
protected labelWidgetCatalogList: _spike_rabbit_element_translate_ng_translate.TranslatableString;
|
|
768
812
|
protected readonly showAddButton: _angular_core.Signal<boolean>;
|
|
769
813
|
protected readonly showNextButton: _angular_core.Signal<boolean>;
|
|
770
814
|
protected readonly showPreviousButton: _angular_core.Signal<boolean>;
|
|
771
815
|
protected readonly disableAddButton: _angular_core.Signal<boolean>;
|
|
772
816
|
protected readonly disableNextButton: _angular_core.Signal<boolean>;
|
|
773
|
-
/** Indicates if the current config is valid or not. If invalid, the add button is disabled. */
|
|
774
|
-
private readonly invalidConfig;
|
|
775
|
-
/**
|
|
776
|
-
* Marks the widget configuration as modified. Is set when widget editor instance
|
|
777
|
-
* emits configChange events. Triggers edit discard confirmation dialog when widget config
|
|
778
|
-
* is modified but not added to the dashboard.
|
|
779
|
-
* */
|
|
780
|
-
private widgetConfigModified;
|
|
781
|
-
private widgetInstanceEditor?;
|
|
782
|
-
private readonly editorWizardState;
|
|
783
|
-
private widgetInstanceEditorRef?;
|
|
784
|
-
private subscriptions;
|
|
785
817
|
private dialogService;
|
|
786
|
-
private
|
|
787
|
-
private envInjector;
|
|
818
|
+
private readonly widgetCdkListbox;
|
|
788
819
|
ngOnInit(): void;
|
|
789
|
-
ngOnDestroy(): void;
|
|
790
820
|
protected onSearch(searchTerm?: string): void;
|
|
791
821
|
protected onCancel(): void;
|
|
792
822
|
protected onNext(): void;
|
|
793
823
|
protected onPrevious(): void;
|
|
794
824
|
private setupWidgetInstanceEditor;
|
|
795
|
-
private tearDownEditor;
|
|
796
825
|
private setupCatalog;
|
|
797
826
|
protected onAddWidget(): void;
|
|
798
827
|
protected selectWidget(widget?: Widget): void;
|
|
799
|
-
private isEditorWizdard;
|
|
800
|
-
private handleStatusChanges;
|
|
801
828
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiWidgetCatalogComponent, never>;
|
|
802
829
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SiWidgetCatalogComponent, "si-widget-catalog", never, { "searchPlaceholder": { "alias": "searchPlaceholder"; "required": false; "isSignal": true; }; }, { "closed": "closed"; }, never, never, true, never>;
|
|
803
830
|
}
|
|
@@ -876,7 +903,17 @@ declare class SiFlexibleDashboardComponent implements OnInit, OnChanges, OnDestr
|
|
|
876
903
|
* t(() => $localize`:@@DASHBOARD.WIDGET_LIBRARY.SEARCH_PLACEHOLDER:Search widget`)
|
|
877
904
|
* ```
|
|
878
905
|
*/
|
|
879
|
-
readonly searchPlaceholder: _angular_core.InputSignal<
|
|
906
|
+
readonly searchPlaceholder: _angular_core.InputSignal<_spike_rabbit_element_translate_ng_translate.TranslatableString>;
|
|
907
|
+
/**
|
|
908
|
+
* Primary action menu items shown in the edit mode of the dashboard.
|
|
909
|
+
* @defaultValue []
|
|
910
|
+
*/
|
|
911
|
+
readonly primaryEditActions: _angular_core.InputSignal<DashboardToolbarItem[]>;
|
|
912
|
+
/**
|
|
913
|
+
* Secondary action menu items shown in the edit mode of the dashboard.
|
|
914
|
+
* @defaultValue []
|
|
915
|
+
*/
|
|
916
|
+
readonly secondaryEditActions: _angular_core.InputSignal<DashboardToolbarItem[]>;
|
|
880
917
|
/**
|
|
881
918
|
* The grid component is the actual container for the widgets.
|
|
882
919
|
*/
|
|
@@ -895,9 +932,9 @@ declare class SiFlexibleDashboardComponent implements OnInit, OnChanges, OnDestr
|
|
|
895
932
|
* again and emits `false`.
|
|
896
933
|
*/
|
|
897
934
|
readonly isModified: _angular_core.OutputEmitterRef<boolean>;
|
|
898
|
-
protected labelAddWidget:
|
|
899
|
-
protected labelEditor:
|
|
900
|
-
protected labelCatalog:
|
|
935
|
+
protected labelAddWidget: _spike_rabbit_element_translate_ng_translate.TranslatableString;
|
|
936
|
+
protected labelEditor: _spike_rabbit_element_translate_ng_translate.TranslatableString;
|
|
937
|
+
protected labelCatalog: _spike_rabbit_element_translate_ng_translate.TranslatableString;
|
|
901
938
|
protected addWidgetInstanceAction: DashboardToolbarItem;
|
|
902
939
|
/**
|
|
903
940
|
* The primary action menu items shown in the edit mode of the dashboard.
|
|
@@ -905,7 +942,7 @@ declare class SiFlexibleDashboardComponent implements OnInit, OnChanges, OnDestr
|
|
|
905
942
|
readonly primaryEditActions$: BehaviorSubject<(MenuItem | DashboardToolbarItem)[]>;
|
|
906
943
|
/**
|
|
907
944
|
* The secondary action menu items shown in the edit mode of the dashboard. When all menu items are more than
|
|
908
|
-
* three, they will be
|
|
945
|
+
* three, they will be placed in the secondary menu of the content action bar.
|
|
909
946
|
*/
|
|
910
947
|
readonly secondaryEditActions$: BehaviorSubject<(MenuItem | DashboardToolbarItem)[]>;
|
|
911
948
|
/**
|
|
@@ -919,13 +956,12 @@ declare class SiFlexibleDashboardComponent implements OnInit, OnChanges, OnDestr
|
|
|
919
956
|
*/
|
|
920
957
|
readonly pageTitle: _angular_core.Signal<string | undefined>;
|
|
921
958
|
private readonly viewState;
|
|
922
|
-
private subscriptions;
|
|
923
959
|
private widgetStorage;
|
|
924
960
|
private hideAddWidgetInstanceButton$;
|
|
925
961
|
private dashboardId$;
|
|
926
|
-
private outputRefSubscription;
|
|
927
962
|
private readonly toolbar;
|
|
928
|
-
|
|
963
|
+
private readonly globalEditActions;
|
|
964
|
+
ngOnChanges(changes: SimpleChanges<this>): void;
|
|
929
965
|
ngOnInit(): void;
|
|
930
966
|
ngOnDestroy(): void;
|
|
931
967
|
/**
|
|
@@ -936,15 +972,45 @@ declare class SiFlexibleDashboardComponent implements OnInit, OnChanges, OnDestr
|
|
|
936
972
|
protected onModified(event: boolean): void;
|
|
937
973
|
private setupMenuItems;
|
|
938
974
|
private setupPrimaryMenuItems;
|
|
939
|
-
|
|
940
|
-
private proxyMenuItemAction;
|
|
975
|
+
protected editWidgetInstance(widgetConfig: WidgetConfig): void;
|
|
941
976
|
private getWidget;
|
|
942
977
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiFlexibleDashboardComponent, never>;
|
|
943
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SiFlexibleDashboardComponent, "si-flexible-dashboard", never, { "editable": { "alias": "editable"; "required": false; "isSignal": true; }; "heading": { "alias": "heading"; "required": false; "isSignal": true; }; "widgetCatalogComponent": { "alias": "widgetCatalogComponent"; "required": false; "isSignal": true; }; "widgetInstanceEditorDialogComponent": { "alias": "widgetInstanceEditorDialogComponent"; "required": false; "isSignal": true; }; "dashboardId": { "alias": "dashboardId"; "required": false; "isSignal": true; }; "widgetCatalog": { "alias": "widgetCatalog"; "required": false; "isSignal": true; }; "hideAddWidgetInstanceButton": { "alias": "hideAddWidgetInstanceButton"; "required": false; "isSignal": true; }; "hideEditButton": { "alias": "hideEditButton"; "required": false; "isSignal": true; }; "showEditButtonLabel": { "alias": "showEditButtonLabel"; "required": false; "isSignal": true; }; "hideProgressIndicator": { "alias": "hideProgressIndicator"; "required": false; "isSignal": true; }; "config": { "alias": "config"; "required": false; "isSignal": true; }; "searchPlaceholder": { "alias": "searchPlaceholder"; "required": false; "isSignal": true; }; }, { "editable": "editableChange"; "isModified": "isModified"; }, never, ["[filters-slot]", "[empty-state]"], true, never>;
|
|
978
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SiFlexibleDashboardComponent, "si-flexible-dashboard", never, { "editable": { "alias": "editable"; "required": false; "isSignal": true; }; "heading": { "alias": "heading"; "required": false; "isSignal": true; }; "widgetCatalogComponent": { "alias": "widgetCatalogComponent"; "required": false; "isSignal": true; }; "widgetInstanceEditorDialogComponent": { "alias": "widgetInstanceEditorDialogComponent"; "required": false; "isSignal": true; }; "dashboardId": { "alias": "dashboardId"; "required": false; "isSignal": true; }; "widgetCatalog": { "alias": "widgetCatalog"; "required": false; "isSignal": true; }; "hideAddWidgetInstanceButton": { "alias": "hideAddWidgetInstanceButton"; "required": false; "isSignal": true; }; "hideEditButton": { "alias": "hideEditButton"; "required": false; "isSignal": true; }; "showEditButtonLabel": { "alias": "showEditButtonLabel"; "required": false; "isSignal": true; }; "hideProgressIndicator": { "alias": "hideProgressIndicator"; "required": false; "isSignal": true; }; "config": { "alias": "config"; "required": false; "isSignal": true; }; "searchPlaceholder": { "alias": "searchPlaceholder"; "required": false; "isSignal": true; }; "primaryEditActions": { "alias": "primaryEditActions"; "required": false; "isSignal": true; }; "secondaryEditActions": { "alias": "secondaryEditActions"; "required": false; "isSignal": true; }; }, { "editable": "editableChange"; "isModified": "isModified"; }, never, ["[filters-slot]", "[empty-state]"], true, never>;
|
|
944
979
|
}
|
|
945
980
|
|
|
946
981
|
/**
|
|
947
|
-
*
|
|
982
|
+
* A presentational (dumb) component that renders a single widget instance from a
|
|
983
|
+
* {@link WidgetConfig} using the provided {@link Widget} definition. It delegates
|
|
984
|
+
* the actual rendering to the {@link SiWidgetHostComponent}.
|
|
985
|
+
*
|
|
986
|
+
* **Intended Usage**
|
|
987
|
+
*
|
|
988
|
+
* This component renders an individual widget outside of a dashboard or grid,
|
|
989
|
+
* without requiring manual host wiring. It is a self-contained widget cell that
|
|
990
|
+
* can be placed anywhere a single widget needs to be shown, for example in kiosk
|
|
991
|
+
* mode or within a custom layout such as a carousel.
|
|
992
|
+
*
|
|
993
|
+
* **Example**
|
|
994
|
+
*
|
|
995
|
+
* ```html
|
|
996
|
+
* <!-- Render a single widget instance -->
|
|
997
|
+
* <si-widget-renderer [widgetConfig]="widgetConfig" [widget]="widget" />
|
|
998
|
+
* ```
|
|
999
|
+
*/
|
|
1000
|
+
declare class SiWidgetRendererComponent {
|
|
1001
|
+
/** The configuration of the widget instance to render. */
|
|
1002
|
+
readonly widgetConfig: _angular_core.InputSignal<WidgetConfig>;
|
|
1003
|
+
/**
|
|
1004
|
+
* The {@link Widget} definition used to render the given {@link widgetConfig}.
|
|
1005
|
+
* It must match the config's `widgetId`.
|
|
1006
|
+
*/
|
|
1007
|
+
readonly widget: _angular_core.InputSignal<Widget>;
|
|
1008
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiWidgetRendererComponent, never>;
|
|
1009
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SiWidgetRendererComponent, "si-widget-renderer", never, { "widgetConfig": { "alias": "widgetConfig"; "required": true; "isSignal": true; }; "widget": { "alias": "widget"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
/**
|
|
1013
|
+
* Copyright (c) Siemens 2016 - 2026
|
|
948
1014
|
* SPDX-License-Identifier: MIT
|
|
949
1015
|
*/
|
|
950
1016
|
|
|
@@ -966,17 +1032,26 @@ declare abstract class SiWidgetStorage {
|
|
|
966
1032
|
*/
|
|
967
1033
|
abstract load(dashboardId?: string): Observable<WidgetConfig[]>;
|
|
968
1034
|
/**
|
|
969
|
-
* Saves the given widget configuration.
|
|
970
|
-
*
|
|
1035
|
+
* Saves the given widget configuration. New widgets have `id`
|
|
1036
|
+
* generated through the `SiWidgetIdProvider.generateWidgetId` implementation
|
|
1037
|
+
* and if ids comes from backend then it is in the responsibility of the implementor to update
|
|
1038
|
+
* the ids of the new widgets with the ids returned from backend upon save. In addition,
|
|
971
1039
|
* the implementor needs to check if objects that have been available before are missing. These
|
|
972
1040
|
* widgets have been removed by the user. As a result of this method, the observables returned
|
|
973
1041
|
* by the `load()` method should emit the new widget config objects, before also returning them.
|
|
974
|
-
* @param
|
|
1042
|
+
* @param modifiedWidgets - The existing widget config objects to be saved.
|
|
1043
|
+
* @param addedWidgets - The new widget config objects to be saved.
|
|
1044
|
+
* @param removedWidgets - The widget config objects that have been removed.
|
|
1045
|
+
* @param dashboardId - The id of the dashboard if present to allow dashboard specific storage.
|
|
1046
|
+
* @returns An observable that emits the saved widget config objects with their ids.
|
|
975
1047
|
*/
|
|
976
|
-
abstract save(
|
|
1048
|
+
abstract save(modifiedWidgets: WidgetConfig[], addedWidgets: WidgetConfig[], removedWidgets?: WidgetConfig[], dashboardId?: string): Observable<WidgetConfig[]>;
|
|
977
1049
|
/**
|
|
978
1050
|
* Optional method to provide primary and secondary toolbar menu items.
|
|
979
1051
|
* @param dashboardId - The id of the dashboard if present to allow dashboard specific menu items.
|
|
1052
|
+
*
|
|
1053
|
+
* @deprecated use {@link provideDashboardToolbarItems} to provide common toolbar items.
|
|
1054
|
+
* Additionally configure individual dashboard actions via {@link SiFlexibleDashboardComponent.primaryEditActions} and {@link SiFlexibleDashboardComponent.secondaryEditActions} respectively.
|
|
980
1055
|
*/
|
|
981
1056
|
getToolbarMenuItems?: (dashboardId?: string) => {
|
|
982
1057
|
primary: Observable<(MenuItem | DashboardToolbarItem)[]>;
|
|
@@ -1013,59 +1088,132 @@ declare class SiDefaultWidgetStorage extends SiWidgetStorage {
|
|
|
1013
1088
|
private widgets?;
|
|
1014
1089
|
constructor();
|
|
1015
1090
|
load(dashboardId?: string): Observable<WidgetConfig[]>;
|
|
1016
|
-
save(
|
|
1017
|
-
protected update(
|
|
1091
|
+
save(modifiedWidgets: WidgetConfig[], addedWidgets: WidgetConfig[], removedWidgets?: WidgetConfig[], dashboardId?: string): Observable<WidgetConfig[]>;
|
|
1092
|
+
protected update(widgetConfigs: WidgetConfig[], dashboardId?: string): void;
|
|
1018
1093
|
protected loadFromStorage(dashboardId?: string): WidgetConfig[];
|
|
1019
1094
|
}
|
|
1020
1095
|
|
|
1021
1096
|
/**
|
|
1022
|
-
* Copyright (c) Siemens 2016 -
|
|
1097
|
+
* Copyright (c) Siemens 2016 - 2026
|
|
1023
1098
|
* SPDX-License-Identifier: MIT
|
|
1024
1099
|
*/
|
|
1025
1100
|
|
|
1101
|
+
/**
|
|
1102
|
+
* Injection token to optionally inject the {@link SiWidgetIdProvider} implementation
|
|
1103
|
+
* to provide custom widget id generation logic. The default implementation
|
|
1104
|
+
* is {@link SiWidgetDefaultIdProvider}.
|
|
1105
|
+
*
|
|
1106
|
+
* * @example
|
|
1107
|
+
* The following shows how to provide your own widget id provider.
|
|
1108
|
+
* ```
|
|
1109
|
+
* providers: [..., { provide: SI_WIDGET_ID_PROVIDER, useClass: CustomWidgetIdProvider }]
|
|
1110
|
+
* ```
|
|
1111
|
+
*
|
|
1112
|
+
*/
|
|
1113
|
+
declare const SI_WIDGET_ID_PROVIDER: InjectionToken<SiWidgetIdProvider>;
|
|
1114
|
+
/**
|
|
1115
|
+
* Abstract class to provide widget id generation logic.
|
|
1116
|
+
*/
|
|
1117
|
+
declare abstract class SiWidgetIdProvider {
|
|
1118
|
+
/**
|
|
1119
|
+
* Generates a transient widget id for newly added widgets in edit mode.
|
|
1120
|
+
*
|
|
1121
|
+
* @param widget - The widget instance config without any id.
|
|
1122
|
+
* @param dashboardId - The id of the dashboard where the widget is added.
|
|
1123
|
+
* @returns A transient widget id as a string.
|
|
1124
|
+
*/
|
|
1125
|
+
abstract generateWidgetId(widget: Omit<WidgetConfig, 'id'>, dashboardId?: string): string;
|
|
1126
|
+
}
|
|
1127
|
+
/**
|
|
1128
|
+
* The default implementation of the {@link SiWidgetIdProvider} which
|
|
1129
|
+
* generates random widget ids.
|
|
1130
|
+
*/
|
|
1131
|
+
declare class SiWidgetDefaultIdProvider extends SiWidgetIdProvider {
|
|
1132
|
+
/**
|
|
1133
|
+
* Generates a unique widget id.
|
|
1134
|
+
*
|
|
1135
|
+
* The method uses `crypto.randomUUID()` which generates a RFC4122 version 4 UUID
|
|
1136
|
+
* (a cryptographically secure random identifier with 122 bits of entropy).
|
|
1137
|
+
*
|
|
1138
|
+
* @param widget - The widget instance config without any id.
|
|
1139
|
+
* @param dashboardId - The id of the dashboard where the widget is added.
|
|
1140
|
+
* @returns A unique widget id string in the format `crypto.randomUUID()`.
|
|
1141
|
+
*/
|
|
1142
|
+
generateWidgetId(widget: Omit<WidgetConfig, 'id'>, dashboardId?: string): string;
|
|
1143
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiWidgetDefaultIdProvider, never>;
|
|
1144
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<SiWidgetDefaultIdProvider>;
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
/**
|
|
1148
|
+
* Copyright (c) Siemens 2016 - 2026
|
|
1149
|
+
* SPDX-License-Identifier: MIT
|
|
1150
|
+
*/
|
|
1151
|
+
|
|
1152
|
+
type WidgetFactoryType = FederatedModule['factoryType'] | FederatedBridgeModule['factoryType'];
|
|
1026
1153
|
type SetupComponentFn = <T>(factory: WidgetComponentFactory, componentName: string, host: ViewContainerRef, injector: Injector, envInjector: EnvironmentInjector) => Observable<ComponentRef<T>>;
|
|
1154
|
+
/** @internal */
|
|
1027
1155
|
declare const widgetFactoryRegistry: {
|
|
1028
|
-
_factories: {
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
getFactoryFn(name: string): SetupComponentFn;
|
|
1033
|
-
hasFactoryFn(name: string): boolean;
|
|
1156
|
+
_factories: { [key in WidgetFactoryType]?: SetupComponentFn; };
|
|
1157
|
+
register(name: WidgetFactoryType, factoryFn: SetupComponentFn): void;
|
|
1158
|
+
getFactoryFn(name: WidgetFactoryType): SetupComponentFn | undefined;
|
|
1159
|
+
hasFactoryFn(name: WidgetFactoryType): boolean;
|
|
1034
1160
|
};
|
|
1035
1161
|
declare const setupWidgetInstance: (widgetComponentFactory: WidgetComponentFactory, host: ViewContainerRef, injector: Injector, envInjector: EnvironmentInjector) => Observable<ComponentRef<WidgetInstance>>;
|
|
1036
1162
|
declare const setupWidgetEditor: (widgetComponentFactory: WidgetComponentFactory, host: ViewContainerRef, injector: Injector, envInjector: EnvironmentInjector) => Observable<ComponentRef<WidgetInstanceEditor>>;
|
|
1037
1163
|
|
|
1038
1164
|
/**
|
|
1039
|
-
* Copyright (c) Siemens 2016 -
|
|
1165
|
+
* Copyright (c) Siemens 2016 - 2026
|
|
1040
1166
|
* SPDX-License-Identifier: MIT
|
|
1041
1167
|
*/
|
|
1042
1168
|
|
|
1169
|
+
/**
|
|
1170
|
+
* Common factory configuration fields required for federated module loading.
|
|
1171
|
+
* @internal
|
|
1172
|
+
*/
|
|
1173
|
+
interface FederationFactoryBase {
|
|
1174
|
+
exposedModule?: string;
|
|
1175
|
+
[key: string]: unknown;
|
|
1176
|
+
}
|
|
1177
|
+
/**
|
|
1178
|
+
* Module loaded from federation, containing exported components keyed by name.
|
|
1179
|
+
* @internal
|
|
1180
|
+
*/
|
|
1181
|
+
type FederatedModuleExports<T> = Record<string, Type<T>>;
|
|
1182
|
+
/**
|
|
1183
|
+
* Options for handling federated module loading.
|
|
1184
|
+
*/
|
|
1185
|
+
interface FederatedModuleLoadOptions<T> {
|
|
1186
|
+
loadPromise: Promise<FederatedModuleExports<T> | null | undefined>;
|
|
1187
|
+
factory: FederationFactoryBase;
|
|
1188
|
+
componentName: string;
|
|
1189
|
+
host: ViewContainerRef;
|
|
1190
|
+
injector: Injector;
|
|
1191
|
+
environmentInjector: EnvironmentInjector;
|
|
1192
|
+
}
|
|
1193
|
+
/**
|
|
1194
|
+
* Handles the result of a federated module loading promise.
|
|
1195
|
+
* This is the main utility function that encapsulates the common loading pattern
|
|
1196
|
+
* used across module-federation, native-federation, and mf-bridge loaders.
|
|
1197
|
+
*
|
|
1198
|
+
* @param options - Configuration options for loading and creating the component
|
|
1199
|
+
* @returns Observable that emits the ComponentRef once the component is created
|
|
1200
|
+
* @internal
|
|
1201
|
+
*/
|
|
1202
|
+
declare const handleFederatedModuleLoad: <T>({ loadPromise, factory, componentName, host, injector, environmentInjector }: FederatedModuleLoadOptions<T>) => Observable<ComponentRef<T>>;
|
|
1203
|
+
|
|
1043
1204
|
declare class SiDashboardsNgModule {
|
|
1044
|
-
/**
|
|
1045
|
-
* @deprecated The module configuration `forRoot` is not needed any more. You can use the injection tokens
|
|
1046
|
-
* `SI_DASHBOARD_CONFIGURATION` and `SI_WIDGET_STORE` direct in your app configuration. We migrated to standalone
|
|
1047
|
-
* components already and will delete this module definition later.
|
|
1048
|
-
*/
|
|
1049
|
-
static forRoot({ config, dashboardApi }: {
|
|
1050
|
-
config?: Config;
|
|
1051
|
-
/**
|
|
1052
|
-
* Provide a custom widget storage.
|
|
1053
|
-
*
|
|
1054
|
-
* @deprecated Use the provider tokens in your app config instead.
|
|
1055
|
-
*
|
|
1056
|
-
* @example
|
|
1057
|
-
* ```typescript
|
|
1058
|
-
* const appConfig: ApplicationConfig = {
|
|
1059
|
-
* providers: [{provide: SI_WIDGET_STORE, useClass: YourWidgetStorage}]
|
|
1060
|
-
* }
|
|
1061
|
-
* ```
|
|
1062
|
-
*/
|
|
1063
|
-
dashboardApi?: Provider;
|
|
1064
|
-
}): ModuleWithProviders<SiDashboardsNgModule>;
|
|
1065
1205
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiDashboardsNgModule, never>;
|
|
1066
1206
|
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<SiDashboardsNgModule, never, [typeof SiFlexibleDashboardComponent, typeof SiGridComponent, typeof SiWidgetCatalogComponent, typeof SiWidgetInstanceEditorDialogComponent], [typeof SiFlexibleDashboardComponent, typeof SiGridComponent, typeof SiWidgetCatalogComponent, typeof SiWidgetInstanceEditorDialogComponent]>;
|
|
1067
1207
|
static ɵinj: _angular_core.ɵɵInjectorDeclaration<SiDashboardsNgModule>;
|
|
1068
1208
|
}
|
|
1209
|
+
/**
|
|
1210
|
+
* @deprecated Use {@link SiDashboardsNgModule} instead. The `Simpl` prefix is deprecated and will be removed in v51.
|
|
1211
|
+
*/
|
|
1212
|
+
declare const SimplDashboardsNgModule: typeof SiDashboardsNgModule;
|
|
1213
|
+
/**
|
|
1214
|
+
* @deprecated Use {@link SiDashboardsNgModule} instead. The `Simpl` prefix is deprecated and will be removed in v51.
|
|
1215
|
+
*/
|
|
1216
|
+
type SimplDashboardsNgModule = SiDashboardsNgModule;
|
|
1069
1217
|
|
|
1070
|
-
export {
|
|
1071
|
-
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 };
|
|
1218
|
+
export { DEFAULT_GRIDSTACK_OPTIONS, DEFAULT_WIDGET_STORAGE_TOKEN, SI_DASHBOARD_CONFIGURATION, SI_DASHBOARD_TOOLBAR_ITEMS, SI_WIDGET_ID_PROVIDER, SI_WIDGET_STORE, STORAGE_KEY, SiDashboardsNgModule, SiDefaultWidgetStorage, SiFlexibleDashboardComponent, SiGridComponent, SiWidgetCatalogComponent, SiWidgetDefaultIdProvider, SiWidgetIdProvider, SiWidgetInstanceEditorDialogComponent, SiWidgetRendererComponent, SiWidgetStorage, SimplDashboardsNgModule, createWidgetConfig, handleFederatedModuleLoad, provideDashboardToolbarItems, setupWidgetEditor, setupWidgetInstance, widgetFactoryRegistry };
|
|
1219
|
+
export type { Config, DashboardToolbarItem, DashboardToolbarItemAction, DashboardToolbarItemLink, DashboardToolbarItemRouterLink, FederatedBridgeModule, FederatedModule, FederatedModuleExports, FederationFactoryBase, GridConfig, LoadRemoteBridgeOptions, LoadRemoteModuleEsmOptions, LoadRemoteModuleManifestOptions, LoadRemoteModuleOptions, LoadRemoteModuleScriptOptions, ObjectFit, SetupComponentFn, WebComponent, Widget, WidgetComponentFactory, WidgetComponentTypeFactory, WidgetConfig, WidgetConfigEvent, WidgetConfigStatus, WidgetImage, WidgetInstance, WidgetInstanceEditor, WidgetInstanceEditorWizard, WidgetInstanceEditorWizardState, WidgetPositionConfig };
|