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