@spike-rabbit/dashboards-ng 49.0.0-next.1

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/index.d.ts ADDED
@@ -0,0 +1,1071 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { InjectionToken, InputSignal, OutputEmitterRef, EventEmitter, TemplateRef, OnInit, OnChanges, OnDestroy, ViewContainerRef, SimpleChanges, Type, Injector, EnvironmentInjector, ComponentRef, Provider, ModuleWithProviders } from '@angular/core';
3
+ import { AccentLineType, MenuItem } from '@spike-rabbit/element-ng/common';
4
+ import { SiDashboardComponent } from '@spike-rabbit/element-ng/dashboard';
5
+ import { Subject, BehaviorSubject, Observable } from 'rxjs';
6
+ import { GridStackOptions, GridStackNode, GridStack, GridItemHTMLElement } from 'gridstack';
7
+ 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
+ import { ViewType, ContentActionBarMainItem } from '@spike-rabbit/element-ng/content-action-bar';
11
+ import { MenuItem as MenuItem$1 } from '@spike-rabbit/element-ng/menu';
12
+ export * from '@spike-rabbit/dashboards-ng/translate';
13
+
14
+ /**
15
+ * Configuration object for the si-grid component, including
16
+ * the options of gridstack.
17
+ */
18
+ interface GridConfig {
19
+ /**
20
+ * The configuration options of gridstack.
21
+ */
22
+ gridStackOptions?: GridStackOptions;
23
+ }
24
+ /**
25
+ * The default gridstack configuration options.
26
+ */
27
+ declare const DEFAULT_GRIDSTACK_OPTIONS: GridStackOptions;
28
+
29
+ /**
30
+ * Copyright (c) Siemens 2016 - 2025
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
53
+ * SPDX-License-Identifier: MIT
54
+ */
55
+
56
+ /**
57
+ * Widgets describe the entries within the widget catalog and holds all
58
+ * default configuration and factory functionality to instantiate a widget
59
+ * instance, represented as {@link WidgetConfig} objects.
60
+ */
61
+ interface Widget {
62
+ /** A unique id of the widget. */
63
+ id: string;
64
+ /** An optional version string. */
65
+ version?: string;
66
+ /** The name of the widget that is presented in the widget catalog. */
67
+ name: string;
68
+ /** An optional description that is visible in the widget catalog. */
69
+ description?: string;
70
+ /** A CSS icon class that specifies the widget icon, displayed in the catalog. */
71
+ iconClass?: string;
72
+ /** The factory to instantiate a widget instance component that is added to the dashboard. */
73
+ componentFactory: WidgetComponentFactory;
74
+ /** Optional default values that can be set to widget instances. */
75
+ defaults?: Pick<WidgetConfig, 'width' | 'height' | 'minWidth' | 'minHeight' | 'heading' | 'expandable' | 'immutable' | 'image' | 'accentLine'>;
76
+ /** Optional default payload object that is copied into every widget instance {@link WidgetConfig}. */
77
+ payload?: any;
78
+ }
79
+ /** Factory type that is either a {@link WidgetComponentTypeFactory}, {@link FederatedModule} or {@link WebComponent}. */
80
+ type WidgetComponentFactory = WidgetComponentTypeFactory | FederatedModule | WebComponent;
81
+ type CommonFactoryFields = {
82
+ componentName: string;
83
+ editorComponentName?: string;
84
+ /**
85
+ * CSS class that is added to the modal dialog when component editor dialog is shown.
86
+ * Provides the option to change the size if the dialog.
87
+ */
88
+ editorModalClass?: string;
89
+ };
90
+ type WidgetComponentTypeFactory = CommonFactoryFields & {
91
+ factoryType?: 'default';
92
+ moduleName: string;
93
+ moduleLoader: (name: string) => Promise<any>;
94
+ [index: string]: any;
95
+ };
96
+ type FederatedModule = CommonFactoryFields & LoadRemoteModuleOptions & {
97
+ factoryType: 'module-federation';
98
+ [index: string]: any;
99
+ };
100
+ type WebComponent = CommonFactoryFields & {
101
+ factoryType: 'web-component';
102
+ url: string;
103
+ [index: string]: any;
104
+ };
105
+ /**
106
+ * ObjectFit configuration options for a widget image.
107
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit}
108
+ */
109
+ type ObjectFit = 'contain' | 'cover' | 'fill' | 'none' | 'scale-down';
110
+ /**
111
+ * Image is used to configure an image to be displayed on a widget instance.
112
+ */
113
+ interface WidgetImage {
114
+ /**
115
+ * The image URL (See [<img>](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#src)).
116
+ */
117
+ src: string;
118
+ /**
119
+ * The HTMLImageElement property [alt](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#usage_notes)
120
+ * provides fallback (alternate) text to display when the image specified by the <img> element is not loaded.
121
+ */
122
+ alt: string;
123
+ /**
124
+ * Defines if an image is placed on top or start (left) of the card.
125
+ */
126
+ dir?: 'horizontal' | 'vertical';
127
+ /**
128
+ * Sets the image [object-fit](https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit) CSS property.
129
+ */
130
+ objectFit?: ObjectFit;
131
+ /**
132
+ * Sets the image [object-position](https://developer.mozilla.org/en-US/docs/Web/CSS/object-position) CSS property.
133
+ */
134
+ objectPosition?: string;
135
+ }
136
+ /**
137
+ * A {@link WidgetConfig} holds the configuration of a widget instance component that is visible on a dashboard.
138
+ * It can be persisted and used to restore a dashboards state.
139
+ */
140
+ interface WidgetConfig {
141
+ /** A unique id of a widget instance */
142
+ id: string;
143
+ /**
144
+ * The id of the widget descriptor that was used to instantiate
145
+ * the `WidgetConfig` and the widget instance component.
146
+ */
147
+ widgetId: string;
148
+ /**
149
+ * Optionally, the version widget description that was used to create the widget config.
150
+ */
151
+ version?: string;
152
+ /**
153
+ * Width of the grid item, where number represents how many columns it spans (default?: 1)
154
+ */
155
+ width?: number;
156
+ /**
157
+ * Height of the grid item, where number represents how many rows it takes. (default?: 1)
158
+ */
159
+ height?: number;
160
+ /**
161
+ * Grid item position on x axis of the grid (default?: 0)
162
+ */
163
+ x?: number;
164
+ /**
165
+ * Grid item position on y axis of the grid (default?: 0)
166
+ */
167
+ y?: number;
168
+ /**
169
+ * minimum width allowed during resize/creation (default?: undefined = un-constrained)
170
+ */
171
+ minWidth?: number;
172
+ /**
173
+ * maximum height allowed during resize/creation (default?: undefined = un-constrained)
174
+ */
175
+ minHeight?: number;
176
+ /**
177
+ * grid item header text.
178
+ */
179
+ heading?: string;
180
+ /** Defines whether the widget instance component can be expanded and enlarged over the dashboard. */
181
+ expandable?: boolean;
182
+ /** A widget specific payload object. Placeholder to pass in additional configuration. */
183
+ payload?: any;
184
+ actionBarViewType?: ViewType;
185
+ isNotRemovable?: boolean;
186
+ 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
+ /**
195
+ * Optional configuration for an image to be displayed on the widget instance.
196
+ */
197
+ image?: WidgetImage;
198
+ /**
199
+ * Optional type of the accent line.
200
+ */
201
+ accentLine?: AccentLineType;
202
+ }
203
+ /**
204
+ * Object is used to inform the editor hosting component about configuration
205
+ * changes to configure (e.g. enable/disable) the control buttons accordingly.
206
+ */
207
+ interface WidgetConfigStatus {
208
+ /**
209
+ * Indicates that the configuration was changed. If true, canceling
210
+ * the editor will first show a dialog to confirm the discard.
211
+ */
212
+ modified: boolean;
213
+ /**
214
+ * If true, save or add button will be disabled.
215
+ */
216
+ invalid: boolean;
217
+ }
218
+ /**
219
+ * An editor component for a widget instance need to implement this interface.
220
+ * After initializing the instance editor component, with widget configuration
221
+ * is set. Optionally, the component can emit changes during editing to control
222
+ * e.g. the dialog behavior like disabling the save button.
223
+ */
224
+ interface WidgetInstanceEditor {
225
+ /**
226
+ * The hosting component of the widget instance editor sets the configuration
227
+ * after initialization. The editor component should use the configuration as
228
+ * input and persist all relevant changes within the config. The hosting component
229
+ * takes the config after adding of saving the widget instance and updates the
230
+ * dashboard.
231
+ */
232
+ config: WidgetConfig | Omit<WidgetConfig, 'id'> | InputSignal<WidgetConfig | Omit<WidgetConfig, 'id'>>;
233
+ /**
234
+ * Optionally, emit updated widget configuration using an event emitter.
235
+ */
236
+ configChange?: Subject<WidgetConfig | Omit<WidgetConfig, 'id'>> | OutputEmitterRef<WidgetConfig | Omit<WidgetConfig, 'id'>>;
237
+ /**
238
+ * Optionally, inform the hosting component about widget configuration status changes.
239
+ */
240
+ statusChanges?: Subject<Partial<WidgetConfigStatus>> | OutputEmitterRef<Partial<WidgetConfigStatus>>;
241
+ }
242
+ /**
243
+ * State to control the behavior of a widget instance editor wizard.
244
+ * The wizard state is used to control the behavior of the dialog buttons
245
+ * provided by the catalog and editor components.
246
+ */
247
+ interface WidgetInstanceEditorWizardState {
248
+ hasNext: boolean;
249
+ hasPrevious: boolean;
250
+ disableNext?: boolean;
251
+ }
252
+ /**
253
+ * A widget instance editor component that shall support a multi-page
254
+ * widget configuration can implement this interface. The wizard-like
255
+ * page state {@link WidgetInstanceEditorWizardState} needs to be managed
256
+ * by the editor itself and is used to control wizard dialog buttons
257
+ * that are provided by the catalog and editor component.
258
+ */
259
+ interface WidgetInstanceEditorWizard extends WidgetInstanceEditor {
260
+ /**
261
+ * The current state of the multi-page widget instance editor. The state
262
+ * is access after `#next()` or `#previous()` is invoked.
263
+ */
264
+ state: WidgetInstanceEditorWizardState;
265
+ /**
266
+ * Emit changes as needed during the user interaction with the editor.
267
+ */
268
+ stateChange?: Subject<WidgetInstanceEditorWizardState> | OutputEmitterRef<WidgetInstanceEditorWizardState>;
269
+ /**
270
+ * Is invoked from the next button. Display next page as consequence.
271
+ * For web components, implementing `next()` requires adding an event listener
272
+ * for the `next` event on the element.
273
+ */
274
+ next(): void;
275
+ /**
276
+ * Is invoked from the previous button. Display previous page as consequence.
277
+ * For web components, implementing `previous()` requires adding an event listener
278
+ * for the `previous` event on the element.
279
+ */
280
+ previous(): void;
281
+ }
282
+ /**
283
+ * Event type used when a widget config is changed from within
284
+ * a widget instance. For example, a widget instance component
285
+ * may assign and change the primary actions. It needs to publish the
286
+ * change so that the UI in the hosting dashboard card can be updated.
287
+ */
288
+ type WidgetConfigEvent = {
289
+ /** Primary actions that are visible in normal view mode. */
290
+ primaryActions?: (MenuItem | ContentActionBarMainItem)[];
291
+ /** Secondary (collapsed) actions that are visible in normal view mode. */
292
+ secondaryActions?: (MenuItem | MenuItem$1)[];
293
+ /** Primary actions that are visible in editable dashboard mode. */
294
+ primaryEditActions?: (MenuItem | ContentActionBarMainItem)[];
295
+ /** Secondary (collapsed) actions that are visible in editable dashboard mode. */
296
+ secondaryEditActions?: (MenuItem | MenuItem$1)[];
297
+ };
298
+ /**
299
+ * Every widget component implementation needs to implement the {@link WidgetInstance}
300
+ * interface. It provides the interface between the component implementation and the
301
+ * dashboard.
302
+ */
303
+ interface WidgetInstance {
304
+ /** The WidgetConfig is set after instantiating the widget component. */
305
+ config: WidgetConfig | InputSignal<WidgetConfig>;
306
+ /**
307
+ * The dashboard will set the editable property to `true`, if the dashboard
308
+ * enters the editable mode. The attribute is used to inform every
309
+ * widget instance.
310
+ */
311
+ editable?: boolean;
312
+ /** Primary actions that are visible in normal view mode. */
313
+ primaryActions?: (MenuItem | ContentActionBarMainItem)[];
314
+ /** Secondary (collapsed) actions that are visible in normal view mode. */
315
+ secondaryActions?: (MenuItem | MenuItem$1)[];
316
+ /** Primary actions that are visible in editable dashboard mode. */
317
+ primaryEditActions?: (MenuItem | ContentActionBarMainItem)[];
318
+ /** Secondary (collapsed) actions that are visible in editable dashboard mode. */
319
+ secondaryEditActions?: (MenuItem | MenuItem$1)[];
320
+ /** {@link WidgetInstance} component implementations should emit change
321
+ * events after changing the instance configuration like the actions.
322
+ */
323
+ configChange?: EventEmitter<WidgetConfigEvent>;
324
+ /**
325
+ * An optional footer template that is added into the dashboard card's footer.
326
+ */
327
+ footer?: TemplateRef<unknown>;
328
+ }
329
+ /**
330
+ * Type to define the position of a widget instance, consisting of
331
+ * the instance id and x, y, width and height.
332
+ */
333
+ type WidgetPositionConfig = Pick<WidgetConfig, 'id' | 'x' | 'y' | 'width' | 'height'>;
334
+ /**
335
+ * Function creates a new {@link WidgetConfig} without id from a {@link Widget} and
336
+ * copies all default values into the {@link WidgetConfig}.
337
+ * @param widget - The source to create the new {@link WidgetConfig} from.
338
+ * @returns The created {@link WidgetConfig} without id.
339
+ */
340
+ declare const createWidgetConfig: (widget: Widget) => Omit<WidgetConfig, "id">;
341
+ /**
342
+ * The Remote Module definition is based on `@angular-architects`.
343
+ * We take it over into this file to prevent adding a hard dependency.
344
+ */
345
+ type LoadRemoteModuleOptions = LoadRemoteModuleScriptOptions | LoadRemoteModuleEsmOptions | LoadRemoteModuleManifestOptions;
346
+ type LoadRemoteModuleScriptOptions = {
347
+ type?: 'script';
348
+ remoteEntry?: string;
349
+ remoteName: string;
350
+ exposedModule: string;
351
+ };
352
+ type LoadRemoteModuleEsmOptions = {
353
+ type: 'module';
354
+ remoteEntry: string;
355
+ exposedModule: string;
356
+ };
357
+ type LoadRemoteModuleManifestOptions = {
358
+ type: 'manifest';
359
+ remoteName: string;
360
+ exposedModule: string;
361
+ };
362
+
363
+ interface GridWrapperEvent {
364
+ event: Event;
365
+ items?: GridStackNode[];
366
+ grid: GridStack;
367
+ el?: GridItemHTMLElement;
368
+ }
369
+ declare class SiGridstackWrapperComponent implements OnInit, OnChanges, OnDestroy {
370
+ /**
371
+ * Grid items to render inside the gridstack
372
+ *
373
+ * @defaultValue []
374
+ */
375
+ readonly widgetConfigs: _angular_core.InputSignal<WidgetConfig[]>;
376
+ /**
377
+ * Whenever gridstack allows to drag, resize or delete the grid item
378
+ *
379
+ * @defaultValue false
380
+ */
381
+ readonly editable: _angular_core.InputSignal<boolean>;
382
+ /**
383
+ * Module configuration
384
+ */
385
+ readonly gridConfig: _angular_core.InputSignal<GridConfig | undefined>;
386
+ /**
387
+ * Emits dashboard grid events.
388
+ */
389
+ readonly gridEvent: _angular_core.OutputEmitterRef<GridWrapperEvent>;
390
+ /**
391
+ * Emits the id of a widget instance that shall be removed.
392
+ */
393
+ readonly widgetInstanceRemove: _angular_core.OutputEmitterRef<string>;
394
+ /**
395
+ * Emits the id of a widget instance that shall be edited.
396
+ */
397
+ readonly widgetInstanceEdit: _angular_core.OutputEmitterRef<WidgetConfig>;
398
+ readonly gridstackContainer: _angular_core.Signal<ViewContainerRef | undefined>;
399
+ private grid;
400
+ private markedForRender;
401
+ private gridItems;
402
+ private readonly itemIdAttr;
403
+ private widgetIdSubscriptionMap;
404
+ private ngZone;
405
+ private elementRef;
406
+ ngOnChanges(changes: SimpleChanges): void;
407
+ ngOnInit(): void;
408
+ ngOnDestroy(): void;
409
+ mount(items: WidgetConfig[]): void;
410
+ unmount(items: WidgetConfig[]): void;
411
+ getLayout(): WidgetPositionConfig[];
412
+ private updateLayout;
413
+ private addToView;
414
+ private removeFromView;
415
+ /**
416
+ * GridItemComponents are created dynamically, change detection won't trigger as there is no \@Input binding.
417
+ * We have to update instance and run ChangeDetectionRef manually.
418
+ */
419
+ private updateViewComponents;
420
+ private hookEvents;
421
+ 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>;
423
+ }
424
+
425
+ /**
426
+ * The Dialog component is utilized when editing a widget instance within a dashboard.
427
+ * It dynamically loads and creates the associated widget editor and incorporates it
428
+ * into its content. The dialog component is accountable for interacting with the dashboard
429
+ * and offers options for saving changes or terminating the editing process.
430
+ */
431
+ declare class SiWidgetInstanceEditorDialogComponent implements OnInit, OnDestroy {
432
+ /**
433
+ * Input for the widget instance configuration. It is used to populate the
434
+ * widget editor.
435
+ */
436
+ readonly widgetConfig: _angular_core.ModelSignal<WidgetConfig>;
437
+ /**
438
+ * Input for the widget definition. It is required to retrieve the component
439
+ * factory to instantiate the widget editor.
440
+ */
441
+ readonly widget: _angular_core.InputSignal<Widget>;
442
+ /**
443
+ * Emits the edited widget instance configuration if the user confirms by
444
+ * saving, or `undefined` if the user cancels the dialog.
445
+ */
446
+ readonly closed: _angular_core.OutputEmitterRef<WidgetConfig | undefined>;
447
+ /**
448
+ * Emits when the editor instantiation is completed.
449
+ */
450
+ 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
+ protected readonly showNextButton: _angular_core.Signal<boolean>;
455
+ protected readonly disableNextButton: _angular_core.Signal<boolean>;
456
+ protected readonly showPreviousButton: _angular_core.Signal<boolean>;
457
+ protected readonly disablePreviousButton: _angular_core.Signal<boolean>;
458
+ protected labelSave: string;
459
+ protected labelCancel: string;
460
+ protected labelPrevious: string;
461
+ protected labelNext: string;
462
+ protected labelDialogMessage: string;
463
+ protected labelDialogHeading: string;
464
+ protected labelDialogSave: string;
465
+ protected labelDialogDiscard: string;
466
+ protected labelDialogCancel: string;
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;
478
+ private dialogService;
479
+ ngOnInit(): void;
480
+ ngOnDestroy(): void;
481
+ protected onCancel(): void;
482
+ protected onNext(): void;
483
+ protected onPrevious(): void;
484
+ protected onSave(): void;
485
+ private tearDownEditor;
486
+ private isEditorWizdard;
487
+ private handleStatusChanges;
488
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiWidgetInstanceEditorDialogComponent, never>;
489
+ 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
+ }
491
+
492
+ declare const NEW_WIDGET_PREFIX = "new-widget-";
493
+ /**
494
+ * The grid component is the actual component on which the widget instances are placed and visualized. You can think of
495
+ * a headless dashboard, without a title, toolbar or edit buttons.
496
+ */
497
+ declare class SiGridComponent implements OnInit, OnChanges, OnDestroy {
498
+ private storeSubscription?;
499
+ private gridService;
500
+ private modalService;
501
+ private widgetStorage;
502
+ /**
503
+ * Configuration options for a grid instance. Default is the optional
504
+ * value from the {@link SI_DASHBOARD_CONFIGURATION}.
505
+ *
506
+ * @defaultValue inject(SI_DASHBOARD_CONFIGURATION)?.grid
507
+ */
508
+ readonly gridConfig: _angular_core.InputSignal<GridConfig | undefined>;
509
+ /**
510
+ * Sets the grid into editable mode, in which the widget instances can be moved,
511
+ * resized, removed or new ones added.
512
+ *
513
+ * @defaultValue false
514
+ */
515
+ 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
+ /**
525
+ * An optional, but recommended dashboard id that is used in persistence and passed
526
+ * to the widget store for saving and loading data.
527
+ */
528
+ readonly dashboardId: _angular_core.InputSignal<string | undefined>;
529
+ /**
530
+ * Provides the available widgets to the grid. When loading the widget configurations from
531
+ * the storage, we need to have the widget definition available to be able to create the widget
532
+ * instances on the grid.
533
+ *
534
+ * @defaultValue [] */
535
+ readonly widgetCatalog: _angular_core.InputSignal<Widget[]>;
536
+ /**
537
+ * When the user clicks edit on a widget instance, an editor need to appear and the
538
+ * widget editor component need to be loaded. When the grid is used standalone, it
539
+ * takes care and opens a modal dialog and loads the configured widget editor component.
540
+ * When the grid is used in a container like the flexible dashboard, the container manages
541
+ * where the widget instance editor is displayed. In this case this options prevents the grid
542
+ * from showing the editor in the dialog, and emits on `widgetInstanceEdit` on clicking the
543
+ * widget `edit` action.
544
+ *
545
+ * @defaultValue false */
546
+ readonly emitWidgetInstanceEditEvents: _angular_core.InputSignal<boolean>;
547
+ /**
548
+ * Option to turn off the loading spinner on save and load operations.
549
+ *
550
+ * @defaultValue false
551
+ */
552
+ readonly hideProgressIndicator: _angular_core.InputSignal<boolean>;
553
+ /**
554
+ * Option to configure a custom widget instance editor dialog component. The component provides the
555
+ * editor hosting and the buttons to save and cancel.
556
+ */
557
+ readonly widgetInstanceEditorDialogComponent: _angular_core.InputSignal<Type<SiWidgetInstanceEditorDialogComponent> | undefined>;
558
+ /**
559
+ * Emits the modification state of the grid. It is `unmodified` when the visible state
560
+ * is equal to the loaded state from the widget storage. When the user modifies the dashboard by
561
+ * e.g. while moving the widgets, the dashboard is marked as `modified` and emits `true` and when the user
562
+ * persists the change by saving, or reverts the state by canceling, the state is `unmodified`
563
+ * again and emits `false`.
564
+ */
565
+ readonly isModified: _angular_core.OutputEmitterRef<boolean>;
566
+ /**
567
+ * Modified state that is emitted in the `isModified` output. Should only be
568
+ changed using the {@link setModified} method.
569
+ */
570
+ private modified;
571
+ /**
572
+ * Emits to notify about edit events of widget instances. Only emits
573
+ * if `emitWidgetInstanceEditEvents` is set to `true`.
574
+ */
575
+ readonly widgetInstanceEdit: _angular_core.OutputEmitterRef<WidgetConfig>;
576
+ /**
577
+ * All widget configuration objects of the visible widget instances.
578
+ *
579
+ * @internal
580
+ */
581
+ readonly visibleWidgetInstances$: BehaviorSubject<WidgetConfig[]>;
582
+ /**
583
+ * All widget instance configs that are on the grid by loading from the widget
584
+ * storage. Thus, these widget are persisted.
585
+ *
586
+ * @defaultValue []
587
+ * @internal
588
+ */
589
+ persistedWidgetInstances: WidgetConfig[];
590
+ /**
591
+ * Widget instance configs that are added to the grid in edit mode, but not
592
+ * persisted yet, as the user did not confirm the modification by save.
593
+ *
594
+ * @defaultValue []
595
+ * @internal
596
+ */
597
+ transientWidgetInstances: WidgetConfig[];
598
+ /**
599
+ * All widget instance configurations that are removed from the grid in edit mode.
600
+ * These instances are persistently removed on save or re-added again on cancel.
601
+ *
602
+ * @defaultValue []
603
+ * @internal
604
+ */
605
+ markedForRemoval: WidgetConfig[];
606
+ /** @defaultValue viewChild.required(SiGridstackWrapperComponent) */
607
+ 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
+ /**
616
+ * Indication for load and save operations.
617
+ */
618
+ readonly isLoading: BehaviorSubject<boolean>;
619
+ protected initialLoad: boolean;
620
+ protected get showEmptyState(): boolean;
621
+ ngOnChanges(changes: SimpleChanges): void;
622
+ ngOnInit(): void;
623
+ ngOnDestroy(): void;
624
+ /**
625
+ * Set dashboard grid in editable mode to modify widget instances.
626
+ */
627
+ edit(): void;
628
+ /**
629
+ * Persists the current widget instances to the widget storage and
630
+ * changes the editable and isModified modes.
631
+ */
632
+ save(): void;
633
+ /**
634
+ * Cancel current changes and restore last saved state.
635
+ */
636
+ cancel(): void;
637
+ /**
638
+ * Adds a new widget instance configuration to the dashboard grid. It is not
639
+ * persisted yet and is added to the transient widget instances.
640
+ *
641
+ * @param widgetInstanceConfig - The new widget configuration.
642
+ */
643
+ addWidgetInstance(widgetInstanceConfig: Omit<WidgetConfig, 'id'>): void;
644
+ /**
645
+ * Removes a widget instance from the visible widgets and puts it in the
646
+ * {@link markedForRemoval} array.
647
+ *
648
+ * @param widgetInstanceId - The id of the widget instance to be removed.
649
+ */
650
+ removeWidgetInstance(widgetInstanceId: string): void;
651
+ /**
652
+ * Opens the provided widget configuration in the related editor or
653
+ * emits on {@link widgetInstanceEdit}, if {@link emitWidgetInstanceEditEvents}
654
+ * is true.
655
+ *
656
+ * @param widgetInstanceConfig - The config of the widget instance to edit.
657
+ */
658
+ editWidgetInstance(widgetInstanceConfig: WidgetConfig): void;
659
+ /**
660
+ * Updates the visible widgets with an updated configuration. Will update the
661
+ * user interface and emit on {@link isModified}.
662
+ *
663
+ * @param editedWidgetConfig - The config of the widget instance that was updated.
664
+ */
665
+ updateWidgetInstance(editedWidgetConfig: WidgetConfig): void;
666
+ protected handleGridEvent(event: GridWrapperEvent): void;
667
+ private loadAndSubscribeWidgets;
668
+ private updateWidgetPositions;
669
+ private setModified;
670
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiGridComponent, never>;
671
+ 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
+ }
673
+
674
+ /**
675
+ * Copyright (c) Siemens 2016 - 2025
676
+ * SPDX-License-Identifier: MIT
677
+ */
678
+
679
+ /** Interface representing an action item in the dashboard toolbar. */
680
+ interface DashboardToolbarItemAction {
681
+ type: 'action';
682
+ /** Label that is shown to the user. */
683
+ label: TranslatableString;
684
+ /** Action that called when the item is triggered. */
685
+ action: (grid: SiGridComponent) => void;
686
+ }
687
+ /** Interface representing a router link item in the dashboard toolbar. */
688
+ interface DashboardToolbarItemRouterLink {
689
+ type: 'router-link';
690
+ /** Label that is shown to the user. */
691
+ label: TranslatableString;
692
+ /** Link for the angular router. Accepts the same values as {@link RouterLink}. */
693
+ routerLink: string | any[];
694
+ /** Navigation extras that are passed to the {@link RouterLink}. */
695
+ extras?: NavigationExtras;
696
+ }
697
+ /** Interface representing a link item in the dashboard toolbar. */
698
+ interface DashboardToolbarItemLink {
699
+ type: 'link';
700
+ /** Label that is shown to the user. */
701
+ label: TranslatableString;
702
+ /** The href property of the anchor. */
703
+ href: string;
704
+ /** The target property of the anchor. */
705
+ target?: string;
706
+ }
707
+ /** Union type for all possible items in the dashboard toolbar. */
708
+ type DashboardToolbarItem = DashboardToolbarItemAction | DashboardToolbarItemRouterLink | DashboardToolbarItemLink;
709
+
710
+ /**
711
+ * Default widget catalog implementation to show all available widgets that can be added
712
+ * to a dashboard. It consists of a list view, that lists all available widgets and after
713
+ * selection, a host in which the widget specific editor is loaded. Applications can either
714
+ * stay with the default catalog or implement their own by extending this class.
715
+ */
716
+ declare class SiWidgetCatalogComponent implements OnInit, OnDestroy {
717
+ /**
718
+ * Placeholder text for the search input field in the widget catalog.
719
+ *
720
+ * @defaultValue
721
+ * ```
722
+ * t(() => $localize`:@@DASHBOARD.WIDGET_LIBRARY.SEARCH_PLACEHOLDER:Search widget`)
723
+ * ```
724
+ */
725
+ readonly searchPlaceholder: _angular_core.InputSignal<string>;
726
+ /**
727
+ * Emits when the catalog is `closed`, either by canceling or by adding or saving
728
+ * a widget configuration. On cancel `undefined` is emitted, otherwise the related
729
+ * widget configuration is emitted.
730
+ */
731
+ readonly closed: _angular_core.OutputEmitterRef<Omit<WidgetConfig, "id"> | undefined>;
732
+ /**
733
+ * View defines if the catalog widget list or the widget editor is visible.
734
+ *
735
+ * @internal
736
+ * @defaultValue 'list'
737
+ */
738
+ readonly view: _angular_core.WritableSignal<"list" | "editor" | "editor-only">;
739
+ protected readonly editorHost: _angular_core.Signal<ViewContainerRef>;
740
+ /**
741
+ * Property to provide the available widgets to the catalog. The flexible
742
+ * dashboard creates the catalog by Angular's `createComponent()` method
743
+ * and sets the available widgets to this attribute.
744
+ *
745
+ * @defaultValue [] */
746
+ widgetCatalog: Widget[];
747
+ /**
748
+ * Holds the search term from the catalog to be visible when going back
749
+ * by pressing the previous button from the widget edit view.
750
+ */
751
+ protected searchTerm: string;
752
+ /**
753
+ * Array used to hold the search result on the widget catalog.
754
+ * @defaultValue [] */
755
+ protected filteredWidgetCatalog: Widget[];
756
+ protected readonly selected: _angular_core.WritableSignal<Widget | undefined>;
757
+ private widgetConfig?;
758
+ private readonly hasEditor;
759
+ protected labelCancel: string;
760
+ protected labelPrevious: string;
761
+ protected labelNext: string;
762
+ protected labelAdd: string;
763
+ protected labelEmpty: string;
764
+ protected labelDialogHeading: string;
765
+ protected labelDialogCancel: string;
766
+ protected labelDialogMessage: string;
767
+ protected labelDialogDiscard: string;
768
+ protected readonly showAddButton: _angular_core.Signal<boolean>;
769
+ protected readonly showNextButton: _angular_core.Signal<boolean>;
770
+ protected readonly showPreviousButton: _angular_core.Signal<boolean>;
771
+ protected readonly disableAddButton: _angular_core.Signal<boolean>;
772
+ 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
+ private dialogService;
786
+ private injector;
787
+ private envInjector;
788
+ ngOnInit(): void;
789
+ ngOnDestroy(): void;
790
+ protected onSearch(searchTerm?: string): void;
791
+ protected onCancel(): void;
792
+ protected onNext(): void;
793
+ protected onPrevious(): void;
794
+ private setupWidgetInstanceEditor;
795
+ private tearDownEditor;
796
+ private setupCatalog;
797
+ protected onAddWidget(): void;
798
+ protected selectWidget(widget?: Widget): void;
799
+ private isEditorWizdard;
800
+ private handleStatusChanges;
801
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiWidgetCatalogComponent, never>;
802
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<SiWidgetCatalogComponent, "si-widget-catalog", never, { "searchPlaceholder": { "alias": "searchPlaceholder"; "required": false; "isSignal": true; }; }, { "closed": "closed"; }, never, never, true, never>;
803
+ }
804
+
805
+ /**
806
+ * The component implements a dashboard with adding, removing and resizing widgets.
807
+ * It consists and connects a toolbar, a grid with widgets, and a widget catalog.
808
+ */
809
+ declare class SiFlexibleDashboardComponent implements OnInit, OnChanges, OnDestroy {
810
+ /**
811
+ * Input to change the dashboard editable state.
812
+ *
813
+ * @defaultValue false
814
+ */
815
+ readonly editable: _angular_core.ModelSignal<boolean>;
816
+ /**
817
+ * Heading for the dashboard.
818
+ */
819
+ readonly heading: _angular_core.InputSignal<string | undefined>;
820
+ /**
821
+ * Optionally, provide a custom subclass of the SiWidgetCatalogComponent
822
+ * to use your own catalog component.
823
+ */
824
+ readonly widgetCatalogComponent: _angular_core.InputSignal<Type<SiWidgetCatalogComponent> | undefined>;
825
+ /**
826
+ * Optionally, provide a custom subclass of the {@link SiWidgetInstanceEditorDialogComponent}
827
+ * to use your own implementation.
828
+ */
829
+ readonly widgetInstanceEditorDialogComponent: _angular_core.InputSignal<Type<SiWidgetInstanceEditorDialogComponent> | undefined>;
830
+ /**
831
+ * Optionally, but it is recommended to include an id for a dashboard.
832
+ * The id is utilized in the persistence calls on the {@link SiWidgetStorage}.
833
+ */
834
+ readonly dashboardId: _angular_core.InputSignal<string | undefined>;
835
+ /**
836
+ * Sets the available widgets for the widget catalog to the dashboard.
837
+ *
838
+ * @defaultValue [] */
839
+ readonly widgetCatalog: _angular_core.InputSignal<Widget[]>;
840
+ /**
841
+ * Option to remove the add widget instance button from the primary toolbar.
842
+ *
843
+ * @defaultValue false
844
+ */
845
+ readonly hideAddWidgetInstanceButton: _angular_core.InputSignal<boolean>;
846
+ /**
847
+ * Option to hide the dashboard edit button.
848
+ *
849
+ * @defaultValue false
850
+ */
851
+ readonly hideEditButton: _angular_core.InputSignal<boolean>;
852
+ /**
853
+ * Option to display the edit button as a text button instead, only if the window is larger than xs {@link SiResponsiveContainerDirective}.
854
+ *
855
+ * @defaultValue false
856
+ */
857
+ readonly showEditButtonLabel: _angular_core.InputSignal<boolean>;
858
+ /**
859
+ * Option to turn off the loading spinner on save and load operations.
860
+ *
861
+ * @defaultValue false
862
+ */
863
+ readonly hideProgressIndicator: _angular_core.InputSignal<boolean>;
864
+ /**
865
+ * Option to configure a dashboard instance. Default is the optional value from
866
+ * the {@link SI_DASHBOARD_CONFIGURATION}.
867
+ *
868
+ * @defaultValue inject(SI_DASHBOARD_CONFIGURATION)
869
+ */
870
+ readonly config: _angular_core.InputSignal<Config | undefined>;
871
+ /**
872
+ * Placeholder text for the search input field in the widget catalog.
873
+ *
874
+ * @defaultValue
875
+ * ```
876
+ * t(() => $localize`:@@DASHBOARD.WIDGET_LIBRARY.SEARCH_PLACEHOLDER:Search widget`)
877
+ * ```
878
+ */
879
+ readonly searchPlaceholder: _angular_core.InputSignal<string>;
880
+ /**
881
+ * The grid component is the actual container for the widgets.
882
+ */
883
+ readonly grid: _angular_core.Signal<SiGridComponent>;
884
+ /** Property to access the dashboard component instance.
885
+ */
886
+ readonly dashboard: _angular_core.Signal<SiDashboardComponent>;
887
+ /** The view child holds the container that hosts the widget catalog.
888
+ */
889
+ protected readonly catalogHost: _angular_core.Signal<ViewContainerRef>;
890
+ /**
891
+ * Emits the modification state of the grid. It is `unmodified` when the visible state
892
+ * is equal to the loaded state from the widget storage. When the user modifies the dashboard by
893
+ * e.g. while moving the widgets, the dashboard is marked as `modified` and emits `true` and when the user
894
+ * persists the change by saving, or reverts the state by canceling, the state is `unmodified`
895
+ * again and emits `false`.
896
+ */
897
+ readonly isModified: _angular_core.OutputEmitterRef<boolean>;
898
+ protected labelAddWidget: string;
899
+ protected labelEditor: string;
900
+ protected labelCatalog: string;
901
+ protected addWidgetInstanceAction: DashboardToolbarItem;
902
+ /**
903
+ * The primary action menu items shown in the edit mode of the dashboard.
904
+ */
905
+ readonly primaryEditActions$: BehaviorSubject<(MenuItem | DashboardToolbarItem)[]>;
906
+ /**
907
+ * 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 places in the secondary menu of the content action bar.
909
+ */
910
+ readonly secondaryEditActions$: BehaviorSubject<(MenuItem | DashboardToolbarItem)[]>;
911
+ /**
912
+ * @returns True, if the dashboard shows its widgets and not a catalog or and editor.
913
+ */
914
+ readonly isDashboardVisible: _angular_core.Signal<boolean>;
915
+ /**
916
+ * The page title of the dashboard, which is either {@link SiFlexibleDashboardComponent.heading} for the
917
+ * default widget view or `DASHBOARD.WIDGET_EDITOR_DIALOG.TITLE` or 'DASHBOARD.WIDGET_LIBRARY.TITLE' when
918
+ * adding new or editing widgets.
919
+ */
920
+ readonly pageTitle: _angular_core.Signal<string | undefined>;
921
+ private readonly viewState;
922
+ private subscriptions;
923
+ private widgetStorage;
924
+ private hideAddWidgetInstanceButton$;
925
+ private dashboardId$;
926
+ private outputRefSubscription;
927
+ private readonly toolbar;
928
+ ngOnChanges(changes: SimpleChanges): void;
929
+ ngOnInit(): void;
930
+ ngOnDestroy(): void;
931
+ /**
932
+ * Shows the widget catalog of the dashboard. If a widget instance is expanded
933
+ * it restores the widget instances before.
934
+ */
935
+ showWidgetCatalog(): void;
936
+ protected onModified(event: boolean): void;
937
+ private setupMenuItems;
938
+ private setupPrimaryMenuItems;
939
+ private editWidgetInstance;
940
+ private proxyMenuItemAction;
941
+ private getWidget;
942
+ 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>;
944
+ }
945
+
946
+ /**
947
+ * Copyright (c) Siemens 2016 - 2025
948
+ * SPDX-License-Identifier: MIT
949
+ */
950
+
951
+ /**
952
+ * Injection token to configure your widget store implementation. Use
953
+ * `{ provide: SI_WIDGET_STORE, useClass: AppWidgetStorage }` in your app configuration.
954
+ */
955
+ declare const SI_WIDGET_STORE: InjectionToken<SiWidgetStorage>;
956
+ /**
957
+ * Widget storage api to provide the persistence layer of the widgets of a dashboard
958
+ * (typically from a web service). The dashboard grid uses this API to load and save
959
+ * the widget configurations. Applications using siemens-dashboard needs to implement
960
+ * this abstract class and provide it in the module configuration.
961
+ */
962
+ declare abstract class SiWidgetStorage {
963
+ /**
964
+ * Returns an observable with the dashboard widget configuration. The dashboard subscribes to the
965
+ * observable and updates when a new value emits.
966
+ */
967
+ abstract load(dashboardId?: string): Observable<WidgetConfig[]>;
968
+ /**
969
+ * Saves the given widget configuration. Existing widgets have a `id`. New widgets have no `id`
970
+ * and it is in the responsibility of the implementor to set the ids of the new widgets. In addition,
971
+ * the implementor needs to check if objects that have been available before are missing. These
972
+ * widgets have been removed by the user. As a result of this method, the observables returned
973
+ * by the `load()` method should emit the new widget config objects, before also returning them.
974
+ * @param widgets - The existing and new widget config objects to be saved.
975
+ */
976
+ abstract save(widgets: (WidgetConfig | Omit<WidgetConfig, 'id'>)[], removedWidgets?: WidgetConfig[], dashboardId?: string): Observable<WidgetConfig[]>;
977
+ /**
978
+ * Optional method to provide primary and secondary toolbar menu items.
979
+ * @param dashboardId - The id of the dashboard if present to allow dashboard specific menu items.
980
+ */
981
+ getToolbarMenuItems?: (dashboardId?: string) => {
982
+ primary: Observable<(MenuItem | DashboardToolbarItem)[]>;
983
+ secondary: Observable<(MenuItem | DashboardToolbarItem)[]>;
984
+ };
985
+ }
986
+ /**
987
+ * The {@link SiDefaultWidgetStorage} uses this key to persist the dashboard
988
+ * configurations in the session of local storage.
989
+ */
990
+ declare const STORAGE_KEY = "dashboard-store";
991
+ /**
992
+ * Injection token to optionally inject the {@link Storage} implementation
993
+ * that will be used by the {@link SiDefaultWidgetStorage}. The default implementation
994
+ * is {@link sessionStorage}.
995
+ *
996
+ * @example
997
+ * The following shows how to provide the localStorage.
998
+ * ```
999
+ * providers: [..., { provide: DEFAULT_WIDGET_STORAGE_TOKEN, useValue: localStorage }]
1000
+ * ```
1001
+ *
1002
+ */
1003
+ declare const DEFAULT_WIDGET_STORAGE_TOKEN: InjectionToken<Storage>;
1004
+ /**
1005
+ * Default implementation of {@link SiWidgetStorage} that uses the
1006
+ * {@link Storage} implementation provided by the {@link DEFAULT_WIDGET_STORAGE_TOKEN}.
1007
+ * In general, it persists the dashboard's configurations in the Browser's session or local
1008
+ * storage. *
1009
+ */
1010
+ declare class SiDefaultWidgetStorage extends SiWidgetStorage {
1011
+ storage: Storage;
1012
+ private map;
1013
+ private widgets?;
1014
+ constructor();
1015
+ load(dashboardId?: string): Observable<WidgetConfig[]>;
1016
+ save(widgets: (WidgetConfig | Omit<WidgetConfig, 'id'>)[], removedWidgets?: WidgetConfig[], dashboardId?: string): Observable<WidgetConfig[]>;
1017
+ protected update(newConfigs: WidgetConfig[], dashboardId?: string): void;
1018
+ protected loadFromStorage(dashboardId?: string): WidgetConfig[];
1019
+ }
1020
+
1021
+ /**
1022
+ * Copyright (c) Siemens 2016 - 2025
1023
+ * SPDX-License-Identifier: MIT
1024
+ */
1025
+
1026
+ type SetupComponentFn = <T>(factory: WidgetComponentFactory, componentName: string, host: ViewContainerRef, injector: Injector, envInjector: EnvironmentInjector) => Observable<ComponentRef<T>>;
1027
+ declare const widgetFactoryRegistry: {
1028
+ _factories: {
1029
+ [key: string]: SetupComponentFn;
1030
+ };
1031
+ register(name: string, factoryFn: SetupComponentFn): void;
1032
+ getFactoryFn(name: string): SetupComponentFn;
1033
+ hasFactoryFn(name: string): boolean;
1034
+ };
1035
+ declare const setupWidgetInstance: (widgetComponentFactory: WidgetComponentFactory, host: ViewContainerRef, injector: Injector, envInjector: EnvironmentInjector) => Observable<ComponentRef<WidgetInstance>>;
1036
+ declare const setupWidgetEditor: (widgetComponentFactory: WidgetComponentFactory, host: ViewContainerRef, injector: Injector, envInjector: EnvironmentInjector) => Observable<ComponentRef<WidgetInstanceEditor>>;
1037
+
1038
+ /**
1039
+ * Copyright (c) Siemens 2016 - 2025
1040
+ * SPDX-License-Identifier: MIT
1041
+ */
1042
+
1043
+ 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
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiDashboardsNgModule, never>;
1066
+ static ɵmod: _angular_core.ɵɵNgModuleDeclaration<SiDashboardsNgModule, never, [typeof SiFlexibleDashboardComponent, typeof SiGridComponent, typeof SiWidgetCatalogComponent, typeof SiWidgetInstanceEditorDialogComponent], [typeof SiFlexibleDashboardComponent, typeof SiGridComponent, typeof SiWidgetCatalogComponent, typeof SiWidgetInstanceEditorDialogComponent]>;
1067
+ static ɵinj: _angular_core.ɵɵInjectorDeclaration<SiDashboardsNgModule>;
1068
+ }
1069
+
1070
+ export { CONFIG_TOKEN, DEFAULT_GRIDSTACK_OPTIONS, DEFAULT_WIDGET_STORAGE_TOKEN, NEW_WIDGET_PREFIX, SI_DASHBOARD_CONFIGURATION, SI_WIDGET_STORE, STORAGE_KEY, SiDashboardsNgModule, SiDefaultWidgetStorage, SiFlexibleDashboardComponent, SiGridComponent, SiWidgetCatalogComponent, SiWidgetInstanceEditorDialogComponent, SiWidgetStorage, SiDashboardsNgModule as SimplDashboardsNgModule, createWidgetConfig, setupWidgetEditor, setupWidgetInstance, widgetFactoryRegistry };
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 };